j40-cejst-2/client/cypress/integration/About/about.js
Vim 47df35b77e
Gherkin cypress spike (#673)
* integrate gherkin/cucumber w/ cypress

- change cypress.json config from e2e back to standard integration
- add cypress-cucumber-preprocessor
- add integration test of about page

* add a title to each page

* add intl to the 404 page

* Refactor explore tool page

- add intl to static strings
- replace component css with <Grid> layout

* Add title to contact page

* add intl to title of page

* Add gherkin tests for nav to about page

- navigate from any page to the about page
- ensure each link has the title correct on that page
2021-09-15 12:06:13 -07:00

32 lines
908 B
JavaScript

// / <reference types="Cypress" />
import {Given, When} from 'cypress-cucumber-preprocessor/steps';
import {ENDPOINTS} from '../LegacyTests/constants';
// eslint-disable-next-line new-cap
Given('I am on the About page', () => {
cy.viewport(1060, 800);
cy.visit(ENDPOINTS.ABOUT);
});
// eslint-disable-next-line new-cap
Given('I am on the Explore Tool page', () => {
cy.viewport(1060, 800);
cy.visit(ENDPOINTS.EXPLORE_THE_TOOL);
});
// eslint-disable-next-line new-cap
Given('I am on the Data & Methodology page', () => {
cy.viewport(1060, 800);
cy.visit(ENDPOINTS.METHODOLOGY);
});
// eslint-disable-next-line new-cap
Given('I open the Contact page', () => {
cy.viewport(1060, 800);
cy.visit(ENDPOINTS.CONTACT);
});
// eslint-disable-next-line new-cap
When(`I click on the {string} page in the navigation`, (page) => {
cy.get(`[data-cy="nav-link-${page.toLowerCase()}"]`).click();
});