Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const { defineConfig } = require('cypress');
module.exports = defineConfig({
e2e: {
baseUrl: 'http://localhost:9000',
experimentalRunAllSpecs: true,
setupNodeEvents(on, config) {
// implement node event listeners here
},
Expand Down
9 changes: 2 additions & 7 deletions cypress/e2e/about-us/about-us-links.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ describe('About Us Links interaction flow', () => {

it('Validates all links on the page function as intended', () => {
const links: object[] = [
{
name: 'Bureau of the Fiscal Service (Fiscal Service)',
url: 'https://fiscal.treasury.gov/about.html',
external: true,
},
{
name: 'getting started section',
url: 'api-documentation/#getting-started',
Expand Down Expand Up @@ -73,7 +68,7 @@ describe('About Us Links interaction flow', () => {
},
{
name: 'Economic Impact Payments Page',
url: 'http://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
url: 'https://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
external: true,
},
{
Expand All @@ -93,7 +88,7 @@ describe('About Us Links interaction flow', () => {
},
{
name: 'Economic Impact Payments Page',
url: 'http://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
url: 'https://www.irs.gov/coronavirus-tax-relief-and-economic-impact-payments',
external: true,
},
];
Expand Down
15 changes: 14 additions & 1 deletion cypress/e2e/about-us/about-us-sub-nav.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
describe('About us interaction flow', () => {
const pageLoadTimeout = 15000;

const visitAboutUsPage = () => {
cy.intercept('GET', '**/api/**').as('apiCalls'); // Adjust the pattern to match your actual API endpoints
cy.visit('/about-us/');
cy.wait('@apiCalls', { timeout: pageLoadTimeout })
.its('response.statusCode')
.should('be.oneOf', [200, 304]);
cy.findAllByText('About Fiscal Data', { timeout: pageLoadTimeout })
.should('exist')
.should('be.visible');
};

beforeEach(() => {
cy.visit('/about-us/').wait(1500);
visitAboutUsPage();
});

it('Verifies about us page loads', () => {
Expand Down
50 changes: 32 additions & 18 deletions cypress/e2e/currency-exchange-rates/currency-exchange-rates.cy.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,52 @@
const getLastCompletedYear = () => {
return new Date().getFullYear() - 1;
};

const pageLoadTimeout = 15000;

const visitCurrencyExchangeRatePage = () => {
cy.intercept('GET', '**/services/api/fiscal_service/**').as('fiscalData');
cy.visit('/currency-exchange-rates-converter/');
cy.wait('@fiscalData', { timeout: pageLoadTimeout })
.its('response.statusCode')
.should('be.oneOf', [200, 304]);
cy.findAllByText('Published Date', { timeout: pageLoadTimeout })
.should('exist')
.should('be.visible');
};

describe('Currency exchange rates interaction flow', () => {
beforeEach(() => {
cy.visit('/currency-exchange-rates-converter/').wait(3000);
});

it('Validates currency exchange rates url goes to the correct page', () => {
cy.findByTitle('Currency Exchange Rates Converter').click();
cy.url().should('include', '/currency-exchange-rates-converter/');
visitCurrencyExchangeRatePage();
});

it('Validates foreign currency loads on Euro Zone-Euro', () => {
cy.findAllByText('Euro Zone-Euro').should('exist');
});
it('Validates published date info tip', () => {
cy.findByLabelText('More information about Published Date.').focus();
cy.findAllByText('Treasury Reporting Rates of Exchange').click();
cy.url().should('include', '/treasury-reporting-rates-of-exchange');
cy.findByLabelText('More information about Published Date.')
.first()
.click({ force: true });
cy.findByTestId('popupContainer').should('be.visible');
});
it('Validates country currency info tip', () => {
cy.findByLabelText('More information about Country-Currency.').click();
cy.findAllByText(
'Currencies listed in grey do not have available data for the date range selected. Please ensure that the desired currency does not appear by another name, or change the date selected for available results.'
).should('exist');
cy.findByLabelText('More information about Country-Currency.')
.first()
.click({ force: true });
cy.findByTestId('popupContainer').should('be.visible');
});

it('Validates published date dropdown selector', () => {
cy.findAllByTitle('December 31, 2024').click({ force: true });
cy.findAllByTitle(`December 31, ${getLastCompletedYear()}`).click({ force: true });
cy.findByText('March 31, 2024').click();
cy.findByTitle('March 31, 2024').should('exist');
});
});

describe('Currency exchange rates with different published date', () => {
beforeEach(() => {
cy.visit('/currency-exchange-rates-converter/').wait(3000);
cy.findAllByTitle('December 31, 2024').click({ force: true });
visitCurrencyExchangeRatePage();
cy.findAllByTitle(`December 31, ${getLastCompletedYear()}`).click({ force: true });
cy.findByText('March 31, 2024').click();
cy.findByTitle('March 31, 2024').should('exist');
});
Expand Down Expand Up @@ -81,8 +95,8 @@ describe('Currency exchange rates with different published date', () => {

describe('Currency exchange rates with different published date', () => {
beforeEach(() => {
cy.visit('/currency-exchange-rates-converter/').wait(3000);
cy.findAllByTitle('December 31, 2024').click({ force: true });
visitCurrencyExchangeRatePage();
cy.findAllByTitle(`December 31, ${getLastCompletedYear()}`).click({ force: true });
cy.findByText('September 30, 2024').click();
cy.findByTitle('September 30, 2024').should('exist');
});
Expand Down
Loading
Loading