Giter VIP home page Giter VIP logo

cypress-javascript-example's Introduction

The example repository about how to set up Cypress E2E tests in JavaScript.

How to Run

  1. Install dependencies (make sure Node and NPM installed)

    npm install
    
  2. Run Cypress with Test Runner

    Prerequisite for Cypress against localhost: Boot your server first, then run Cypress (e.g. in two separate terminals) (see Setup CI)

    npm run cypress:open
    

    NOTE: Cypress watches the ./cypress/integration folder. Hence, new e2e integration tests can be added without relaunch with the existing support/*.

How to Write Tests

Cypress relies on Mocha syntax for writing tests and provides additional Cypress API & Concepts for writing methods and test the web application.

// cypress/integration/sample.spec.js

describe("My First Test", () => {
  it("does not do much!", () => {
    expect(true).to.equal(true);
  });
});

Continuous Integration (CI) Documentation

  1. Run Cypress via CLI in Headless mode.

    npm run cypress:ci
    

    NOTE:

    • Cypress is capable to do video recording (by default) of the processed E2E integration tests and stores them into ./cypress/videos, rewriting files on every run. Path is in .gitignore for now.
    • Cypress is capable to do screenshot comparison if the precessed E2E integration tests called specific cypress command to take a screenshot, which would be stored into ./cypress/screenshots and would be compared with the previous version of the screenshot (with the same name). Path is in .gitignore for now.

cypress-javascript-example's People

Contributors

nikolsi avatar

Watchers

 avatar  avatar

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.