Giter Club home page Giter Club logo

cypress-e2e-testing-examples's Introduction

E2E testing a Vue app with Cypress

This is an example repo on how to build clean e2e tests with Cypress.

I am using Vue CLI 3 to bootstrap a generic Vue app. For an API we are using json-server.

Installation

Install the deps

npm install

You need to start the API in a separate command prompt.

npm run api

Then you are ready to run the app or run tests.

Running the app

npm run serve

Running tests

You have essentially 2 options each with 2 variants.

Run the e2e tests in headless mode or in GUI mode.

Headless mode opens a browser behind the scenes and outputs the results in the terminal.

GUI mode opens the nice Cypress GUI and is more suited while developing e2e tests.

Each can run their own webpack dev server or use the one that is already started by you.

Headless mode

npm run test:e2e -- --headless - this starts e2e tests and runs its own dev server

npm run test:e2e -- --headless --url http://locahost:8080 - this runs e2e tests on the provided url

GUI Mode

npm run test:e2e - opens the Cypress GUI and runs its own dev server

npm run test:e2e -- --url http://locahost:8080 - opens the Cypress GUI pointing to the provided url

Author: Dobromir Hristov

cypress-e2e-testing-examples's People

Contributors

dobromir-hristov 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.