Giter VIP home page Giter VIP logo

cypress-case-study's Introduction

Cypress Testing for Vuori Website

Project Overview

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.

Project Structure

├── 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

Utility Details

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.

Setup

  1. Clone the repository:
git clone https://github.com/chrisbremmer/cypress-case-study.git
  1. Navigate to the project directory:
cd cypress-case-study
  1. Install the required dependencies:
npm install

Running the Tests

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

Best Practices

  • Always use the Utility class methods to fetch configurations or perform common functionalities.
  • Refer to fixtures when asserting static data to ensure consistency.

Reporting

After running the tests, Cypress will automatically generate photos of any failing tests. These can be found in cypress/screenshots directories.

Notes

  • 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.