Skip to content

bahmutov/flaky-test-cypress

 
 

Repository files navigation

flaky-test-cypress

The Flaky Test Challenge

App

Levels

There are several flaky situations. Each example is in its own branch and includes changes to the application source code and the testing code. Can you solve each one by fixing the test code only? Try fixing the spec before watching the video that shows my solution.

📝 Read the blog post Cypress Flaky Tests Exercises

If you like practicing Cypress test writing and want more hands-on exercises, check out my Cypres courses. Also 📝 read the blog post Flaky IFrame Online Store Test.

Install and run the app

  • clone this repo to your local machine
  • check out a branch with the flaky test git checkout level1, git checkout level2, etc
  • run npm install to install all dependencies
  • start the app in one terminal with npm start. You should see:
Compiled successfully!

The app is running at:

  http://localhost:3000/

Note that the development build is not optimized.
To create a production build, use npm run build.
  • open Cypress test runner with npx cypress open command. Click on the app.cy.js spec to run it.

Did the spec pass?

Small print

The original application code forked from dangi13/flaky-test-cypress.

Author: Gleb Bahmutov <gleb.bahmutov@gmail.com> © 2024

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

About

Hands-on exercises for finding and fixing Cypress test flake

Topics

Resources

Stars

Watchers

Forks

Languages

  • JavaScript 88.0%
  • HTML 10.5%
  • CSS 1.5%