This repository contains tests for the Vuori website using the Cypress testing framwork. The tests ensure the website operates consistently and optimally across different locales and environments.
├── cypress
│ ├── e2e
│ │ ├── header
│ │ │ ├── header.spec.cy.js
│ │ │ └── search.spec.cy.js
│ │ └── homepage
│ │ └── homepage.spec.cy.js
│ ├── fixtures
│ │ ├── header
│ │ │ └── searchData.json
│ │ └── homepage
│ │ └── homepageData.json
│ ├── screenshots
│ └── support
│ │ ├── commands.js
│ │ ├── constants.js
│ │ ├── e2e.js
│ │ └── utility.js
| └── videos
├── node_modules
├── cypress.config.js
├── package-lock.json
└── package.json
The utility.js
file provides a utility class that assists with functionalities such as determining the base URL based on provided LOCALE and ENV settings.
Supported locales include:
- en-au, en-ca, fr-fr, de-de, zh-hk, en-ie, es-mx, nl-nl, zh-sg, ar-ae, en-gb, en-us.
- Clone the repository:
git clone https://github.com/chrisbremmer/cypress-case-study.git
- Navigate to the project directory:
cd cypress-case-study
- Install the required dependencies:
npm install
To run the tests, you'll need to specify the LOCALE
and ENV
settings. Here's how you do it:
npx cypress run --env LOCALE=en-us,ENV=production
Repalce en-us
with your desired locale and production
with your desired environment.
NOTE: Only production has been used for these tests but future enhancements may include other supported environments.
Supported environments are:
- sandbox
- staging
- production
- Always use the
Utility
class methods to fetch configurations or perform common functionalities. - Refer to fixtures when asserting static data to ensure consistency.
After running the tests, Cypress will automatically generate photos of any failing tests. These can be found in cypress/screenshots
directories.
- The JSON files in the fixtures directory are used for static test data.
- Ensure you have the necessary environment variables set before running the tests.