Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDG-9102 Cypress Tests - Glossary - Glossary interaction flow #1563

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions cypress/e2e/glossary terms/glossary-terms.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
describe('Glossary terms interaction flow', () => {
beforeEach(() => {
cy.visit('/').wait(3000);
cy.findAllByText('Resources').click();
cy.findAllByText('Glossary')
.click()
.wait(3000);
});
it('Verifies Glossary opens and closes correctly', () => {
cy.findByText('Search the glossary').should('exist');
cy.findByLabelText('Close glossary').click();
cy.findByText('Search the glossary').should('not.exist');
});

it('Search bar search and Back to list interaction', () => {
cy.findAllByLabelText('Search the glossary').should('be.visible');
cy.findAllByLabelText('Search the glossary')
.eq(1)
.type('Revenue');
cy.findAllByText('Back to list')
.should('exist')
.click();
cy.findAllByLabelText('Search the glossary')
.eq(1)
.type('Debt Ceiling')
.click();
cy.findAllByText('Back to list')
.should('exist')
.click();
});
it('Search bar click into a selected search', () => {
cy.findAllByLabelText('Search the glossary')
.eq(1)
.type('Debt Ceiling');
cy.findAllByText('Debt Ceiling')
.should('exist')
.click();
cy.findAllByText(
'This is the maximum amount of money the federal government is allowed to borrow without receiving additional authority from Congress.'
).should('exist');
});
it('Search bar interaction with Floating Rate Notes and external link', () => {
cy.findAllByLabelText('Search the glossary')
.eq(1) // Target the correct search bar
.should('be.visible')
.type('Floating Rate Notes');
cy.findAllByText('Floating Rate Notes')
.should('exist')
.click();
cy.findAllByText('TreasuryDirect')
.should('exist')
.invoke('attr', 'href')
.should('include', '/marketable-securities/floating-rate-notes/');

cy.findAllByText('TreasuryDirect')
.invoke('removeAttr', 'target')
.click();
});
});
Loading