Questions tagged [cypress-testing-library]

Questions about Cypress end-to-end testing with the **Cypress Testing Library** utilities (a subset of the Testing Library).

Documentation can be found at Cypress Testing Library.

Testing Library provides additional testing commands to the Cypress framework.

214 questions
9
votes
4 answers

Cucumber tags are not working after Cypress and cucumber-preprocessor upgrade

I upgraded Cypress from 9.5.2 to 10.3.0 and previously I was using cypress-cucumber-preprocessor:4.3.1 now I upgrade it to @badeball/cypress-cucumber-preprocessor:^11.4.0. Before the upgrade, I was using cypress-tags for running the test using…
8
votes
1 answer

Cypress 10 shows "The 'task' event has not been registered in the setupNodeEvents method. You must register it before using cy.task()"

In the cypress.config.js , I'm trying to register tasks / plug in events and set my env configuration exactly as documented on their guide. However, when trying to use "on" inside setupNodeEvents I'm getting the error in the title about needing to…
7
votes
1 answer

Getting error when comapre the existing screen shot with real time application in cypress

If I do compare the screen shot with the real time application then it's getting failed. What would be best approach and how to compare the screen shot in Cypress Output: getting error log on cypress for installed dependency for comparing the…
6
votes
5 answers

How to wait for cypress command to finish before moving forward

I have a custom cypress command which performs some asynchronous tasks, and based on the result of the command I want to perform some assertions But the problem is the tests that come after calling the command will either run before the command…
5
votes
2 answers

Cypress - difference between find() and within() methods

What are the differences are there between using either of these methods: cy.get('.wtv').find('.sub-wtv'); cy.get('.wtv').within(() => {cy.get('.sub-wtv');}); From the documentation…
notihs
  • 654
  • 7
  • 19
4
votes
1 answer

How can I specify .env file to use for my dev server when running cypress tests?

How can I specify which .env file to use for my dev server when running cypress tests? These are system level env vars not cypress test env vars. I have an env file that I want to use for my server when running cypress tests: .env.local.cypress In…
grabury
  • 4,797
  • 14
  • 67
  • 125
4
votes
3 answers

CYPRESS REMIX Error: Webpack Compilation Error

Im currently using the indie Stack from Remix, but trying to run the test with cypress send me that error in the browser of cypress, does anyone have a similiar issue? im using the indie stack from…
4
votes
2 answers

Removing an intercept in Cypress

I have an intercept that serves up a stubbed json response like this: cy.intercept('GET', '**/api/v1/myroute/*', { fixture: 'myData.json' }).as('myAlias') Is there a way I can remove this intercept halfway through a test somehow? I was hoping…
Ben Power
  • 1,786
  • 5
  • 27
  • 35
4
votes
1 answer

Cypress: what is the difference between `cy.contains` and `cy. findByText`

findByText is from Cypress Testing Library https://testing-library.com/docs/cypress-testing-library/intro and contains comes with Cypress "natively" I wonder what is the difference between them and when I should use one over the other?
Joji
  • 4,703
  • 7
  • 41
  • 86
3
votes
1 answer

ReferenceError : $el is not defined in cypress []

///\ ///\ describe("Interacting with dropdowns", function () { it("Auto Suggest Dynamic Dropdown: We need to write function", function () { …
3
votes
1 answer

Cypress: assert argument of stubbed function with Regex

I have a stubbed method that is having the following structure printed in the Cypress console: myMethod('start', Object{5}) I know that the object has a key, segmentB -> when console logging it in the stub, I see it but I do not want to start making…
Shushiro
  • 577
  • 1
  • 9
  • 32
3
votes
0 answers

Cypress-cucumber error as Your configFile threw an error from: cypress.config.js We stopped running your tests because your config file crashed

When i try to run cucumber tests with cypress, i get error saying Your configFile threw an error from: cypress.config.js We stopped running your tests because your config file crashed. Tried upgrading and downgrading node. Also tried with different…
3
votes
4 answers

Waiting for DOM to load: Cypress

I try to make and E2E test with Cypress. I have to visit multiple links from a table and make an assertion after visiting the page. In the Cypress UI I see the page is loaded, also if I check I can see the elements in the DOM. But my Cypress…
Phaki
  • 210
  • 4
  • 18
3
votes
2 answers

Why added value en each loop hasn't been stored on next iteration?

Brief logic is the next: after clicking on 'li' element, request is sent, and based on response value of 'contacts', it should select if it's greater than 0, once such element is find, i need to break each loop. But currently, despite I set value,…
Michael
  • 35
  • 2
3
votes
2 answers

How to run tests related to changed files in cypress

I'm using cypress to set E2E tests. But i'm facing some troubles, because every time I implement a new feature or refactor some code, i need to run all my tests to see if my modifications doesn't broke something in my application. In Jest we have…
1
2 3
14 15