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
1
vote
1 answer

cypress intercept not overriding cypress alias

I'm doing some testing and I intercept some api calls to the same url, I do one beforeEach, and then another one on the test, but for some reason I does not understand that I changed the alias. I was doing some reading, and the overriding was fixed,…
Mario Garcia
  • 177
  • 1
  • 4
  • 15
1
vote
0 answers

CyPress unable to mock API call

We are working on a react + typescript project & trying to implement unit testing using cypress. I have a component called GettingStartedForm where two APIs are called on componentDidMount Create API Get API - is called once the creation is…
1
vote
3 answers

How to check the number of points <=10 in Cypress

cy.get('div[id="base-table-\[object\ Object\]-body"] > .MuiGrid-root, .jss505').should('have.length', 10) How to make a check <=10 ? Maybe to.have.length.most() DOM
Linkin
  • 11
  • 2
1
vote
0 answers

Cypress not finding DOM elements even though playground selector shows it

I've added data-cy id's to specific DOM elements in my Next/react application. Yet, when it proceeeds to the cy.get() command it errors out with Timed out retrying after 4000ms: Expected to find element: [data-cy=button-buy], but never found…
Aaron Z
  • 73
  • 1
  • 5
1
vote
0 answers

Unable to install Cypress

I have been finding it difficult to install cypress using vs code. I need to install it to run automated test. But I keep getting the error response below. Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new…
1
vote
0 answers

Cypress- Whoops, there is no test to run. error on trying to visit a browser

I am trying to launch a browser. It launches the browser and fails to perform the next steps by throwing "Whoops, there is no test to run" error. Can someone please help. Below is the code for reference. List item describe("Salesforce…
Sowjanya H M
  • 11
  • 1
  • 5
1
vote
1 answer

How to specify firefox version on cypress run

I'm trying a way to launch cypress with a specified firefox version, if i launch something like cypress run --browser firefox I only see version 89 running, how can I force it to launch it with different versions? FYI, I'm launching it inside a…
1
vote
1 answer

Cypress: extract value from JSON body to a variable

I am using cypress.io to test an API(Created using Node.js). I want to extract value from JSON response of the API and save it to a variable. I have tried solutions mentioned in the below links it did not work: Cypress - get value from json response…
JustAG33K
  • 1,403
  • 3
  • 13
  • 28
1
vote
0 answers

Test a zoom of d3js with cypress

I'm testing a chart made with d3.js. This graph zooms in by scrolling on it. I would like with cypress to trigger the zoom with the scroll, I have made these attempts but nothing happens. cy.get('.pippo > svg') .trigger('wheel', 500, 500, {…
Luca
  • 335
  • 3
  • 19
1
vote
0 answers

How to click multiple buttons, specific number of times in Cypress?

I'm trying to write a test where I need to check if a list of blogs is rendered in the descending order of likes for each blog. For this, I've created 3 mock blogs in Cypress and want to give them a specific number of likes (3 - 1 - 2) before I test…
1
vote
1 answer

Input field gets hidden behind banner when focusing on it to test it

I'm writing integration tests with Cypress for a form inside a modal, with the particularity that it has a fixed height, a fixed header and a fixed footer, which means the form scrolls and remains always partly covered those.
1
vote
3 answers

Cypress + Dom Testing Library: getByText does not find input's value

I'm using Cypress with Cypress Testing Library to test my React application. I have an input with a name ('Steve') as its value and I'm trying to find it with cypress like this: // In the component: // In the spec…
J. Hesters
  • 13,117
  • 31
  • 133
  • 249
0
votes
0 answers

Property 'to' does not exist on type 'JestMatchers>'.ts(2339)

When I run the Cypress test with my React app (created using npx) I am getting the error: Property 'to' does not exist on type 'JestMatchers>'.ts(2339). How can I fix it? Here is my Cypress test file: import axios from…
3gwebtrain
  • 14,640
  • 25
  • 121
  • 247
0
votes
0 answers

How can I call cloud functions (Firebase) to my cypress tests?

I'm working on e2e testing on cypress. During generating user account details, I need to switch to admin mode from user mode to accept the request of account details request. I want to switch user between the test. We're using firebase. I've tried…
0
votes
0 answers

Cypress smoke test is failing with cypress version 10

I have cypress smoke test which is working fine with cypress version 8.7.0 but failing with version 10. Sample test looks like { describe("Smoke - test login flow", () => { const userId = Cypress.env("test_user"); const customPassword =…