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 does not recognize list element

I am trying to run Cypress tests for a Angular based Frontend. In this application there is a list-component that includes several message-list-items. The problem I'm currently facing is that Cypress does not recognize all message-list-items…
1
vote
2 answers

How to avoid .then() nesting when working with API Calls in Cypress?

With my team we're trying to find a more readable way to handle dependent API calls in Cypress. We have some code just like this nowadays: // nested code cy.request('GET', myUrl).its('body').then(res => { cy.request('GET',…
1
vote
2 answers

Cypress get element inside each

I have this code cy.visit('http://localhost:3000/') cy.get('.list').each((list, index, lists) => { cy.contains('Learn').click() cy.url().should('include', '/localhost') …
Robert Veselý
  • 219
  • 3
  • 11
1
vote
0 answers

cypress code coverage for react application

I am facing below issue while making code coverge of my application. My application has below folder structure. Help me to get code coverage of all src folder. Thanks in advance
1
vote
1 answer

Is there a simple way to execute cypress tests parallelly without using dashboard?

I'm working on a cypress test execution on Github actions and I need to know whether there is a way to execute the tests in parallel mode without using the cypress dashboard (Open source solution) Tried the solution with 'Sorry Cypress'…
1
vote
2 answers

Is it possible to use findByRole for input of type search?

I am trying to select a search input using react-testing-library in the more semantic way possible. I tagged the input with type=search, and I was expecting to be able to do something like this: …
Danielo515
  • 5,996
  • 4
  • 32
  • 66
1
vote
2 answers

How to have two different tests for conditional tables that render on a page based upon the prop passed by parent?

I have a cypress test that checks the table on a page, however there are two different tables that could render depending on the table type conditional. If the type of the table is product one table will render, if the type is equipment a different…
1
vote
2 answers

How to check if an element has 'any' value Cypress?

I am writing some basic cypress tests and I just want to make sure that a table we have has all of the correct columns and that any data is rendering. I know .contains() checks the element selection AND allows text matching, but there could be all…
LovelyAndy
  • 841
  • 8
  • 22
1
vote
2 answers

Cypress: How to get value of div (mixing up async and sync code)

I have a div with the following html
12,300
I am trying to get 12,3001 convert it to a int and save the value for use in another function. I am getting this error. cy.then() failed because you are…
1
vote
2 answers

Cypress: how to split numbers found in divs?

I have a test that is going into an elements span > div but there are two of them so when I run the test it concatenates both of them into one number 13,900879,210. I need it to give me them separately to compare them such as 13,900 and 879,210.…
1
vote
1 answer

Another possibilities than wait?

I am trying to automate a website where the testing environment is reduced and the page loads nearly two minutes(120000). I don't want to use cy.wait(120000) or cy.pause() command. Could anyone help by giving more suggestions to solve the issue even…
1
vote
0 answers

Cypress Incorrect Behavior with Quasar Virtual Scroll Table and Sticky Header: NOT solved by { scrollBehavior: false }

I am using Quasar 2 to create a virtual-scroll table with a sticky header. The table loads results dynamically and the default number of initially loaded results is 100. The table header is sticky and contains the column names, and a search input…
1
vote
0 answers

How can I post my test reports to an API?

I've created a test using the samples. It works great. Test works really nice. But I couldn't find about how can I send reports to an API after each test. I want to post the reports like "Test Successfull and these are passed" or "Test Failed and…
1
vote
0 answers

Cypress: Intercept an image/png GET request?

I am trying to intercept a png image request and check part of its request. For instance, the GET request data:image/png;base64,ASDFASDGHTRADBT#$%GDFWSDFDAAAAAAAAA, I wan't to check that there are more than 5 A's. So far I have tried this but it…
Steve
  • 197
  • 7
  • 17
1
vote
1 answer

In cypress Returning Api reponse to another function is displaying undefined

I'm calling a function GetApiResponse() from CallApi() which is returning an object of Api response. If I'm printing that response in GetApiResponse() in display complete object in console. But i'm passing this to 'passstatus' variable in CallApi…