Questions tagged [cypress]

Cypress an all-in-one web testing framework and assertion library developed in JavaScript, complete with automatic waits, request mocking, and request stubbing.

Cypress is an open-source end-to-end testing tool built to handle modern JavaScript frameworks well. Cypress doesn't use any language or driver bindings. All tests are written in JavaScript and executed inside the browser.

It doesn't use Selenium. Whereas Selenium executes remote commands through the network, Cypress runs in the same run-loop as your application.

References:

Related tags:

9737 questions
374
votes
17 answers

Cypress: Test if element does not exist

I want to be able to click on a check box and test that an element is no longer in the DOM in Cypress. Can someone suggest how you do it? // This is the Test when the checkbox is clicked and the element is…
Maccurt
  • 12,655
  • 7
  • 32
  • 43
259
votes
16 answers

Cypress: run only one test

I want to toggle only running one test, so I don't have to wait for my other tests to see the result of one test. Currently, I comment out my other tests, but this is really annoying. Is there a way to toggle only running one test in Cypress?
kuceb
  • 16,573
  • 7
  • 42
  • 56
203
votes
11 answers

In Cypress how to count a selection of items and get the length?

I'm starting to learn Cypress. I have a 4 row table (with a class of datatable). I can verify the number of rows this way: cy.get('.datatable').find('tr').each(function(row, i){ expect(i).to.be.lessThan(4) }) This is fine, but it seems…
Katharine Osborne
  • 6,571
  • 6
  • 32
  • 61
126
votes
14 answers

ESLint: 'cy' is not defined (Cypress)

I've just started using Cypress with my React Typescript project. I've gotten some simple tests to run: describe('settings page', () => { beforeEach(() => { cy.visit('http://localhost:3000') }); it('starts in a waiting state, with no…
Jonathan Tuzman
  • 11,568
  • 18
  • 69
  • 129
102
votes
12 answers

How to select nth item inside select element in cypress

say I have the HTML: