Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
82 views

In my web page I have a locator which is identified by... cy.get('.app-text') In my case, I want to execute different flows based on the visibility of the above locator in the page. If above locator ...
sandy qa's user avatar
3 votes
1 answer
105 views

This button has 2 states, "chevron_right" when disabled. And "expand_more" when enabled. Its default state is "chevron_right" The following code will click on the button ...
Jessa Brandy's user avatar
-1 votes
1 answer
88 views

My script looks like below const item ["a1", "a2",..............,"a45"] const regex = new RegExp(`${item .join('|')}`, 'g') if(cy.get('body').contains(regex)){ ...
AM10's user avatar
  • 3
1 vote
1 answer
68 views

what is expected from the below code is get_plz_ChooseGroup will be skipped and not trigger a test failure if the element is not visible after 5000 seconds Login_Page_POS.get_plz_ChooseGroup({ timeout:...
Asmoun's user avatar
  • 1,759
0 votes
0 answers
45 views

I am not able connect DB connection using Cypress. Facing issue e2e.js by giving loadDBCommand. DBConnection.feature Scenanrio: Connect DB using SQL Server Given Update the Agent Details Package.json ...
sakthivel j's user avatar
0 votes
1 answer
39 views

I am writing a test in Cypress where I enter two values into two separate inputs and then compare them by clicking a button. If the button displays "=", I need to reset and reenter two new ...
Cholis's user avatar
  • 109
0 votes
2 answers
589 views

I have test that opens every item on the list. Then it validates if there are no empty ('--') fields. I want to log in console that there were empty fields and go to another item and run the loop till ...
Natalia Orzeł's user avatar
0 votes
2 answers
70 views

In the Material UI table there is one record which can exist or not. The scenario is if that row is present based on 'Name' column then delete it, otherwise go to the else block and log that record is ...
Manoj's user avatar
  • 23
-1 votes
3 answers
651 views

When I try cy.get('div.userId') I want to add condition div.userId is exists/not in dom. I am expecting not to fail test before checking existence of element in dom. Like sometimes div.userId is not ...
Bilal Hussain's user avatar
0 votes
1 answer
254 views

I'm currently building a e2e regression test suit for an eCommerce website developed in Angular JS, I have written a loop and provided a condition in it, this is my code: const productText =...
George Beres's user avatar
0 votes
1 answer
113 views

I have an element job-ad which is dynamic i want it to be handle when it’s displayed and not displayed For example if .job-ad is displayed log me a text it’s Visible, but else log it’s hidden. I tried ...
Kim Jay Luta's user avatar
0 votes
1 answer
140 views

I am trying to create an if-else condition that includes cy.get() if (!cy.get('.modal.modal--active')) { cy.reload() } else { // some codes here } Upon testing the code the .modal.modal--...
KiritoLyn's user avatar
  • 662
0 votes
1 answer
838 views

I have a Nextjs project that is using Percy (with Cypress integration) to run visual tests. My project fetches images from a CMS. How can I make sure all images on the page have loaded before (taking ...
grabury's user avatar
  • 5,589
-1 votes
1 answer
412 views

I have 30 rows in a table and I need to perform scroll twice or it may be thrice if rows increases in future. I am using each and store first 20 element with 1 scroll but the element I need will need ...
Surya Singh's user avatar
-1 votes
1 answer
88 views

I would like to have the ability to handle the situation of both cases: the element exists and does not exist. All my trials ended with an exception when it didn't find the item and therefore I couldn'...
dushkin's user avatar
  • 2,123
0 votes
2 answers
143 views

I want to know whether an element exists or not and do stuff according to that. I tried many options but failed. For example: cy.get(deleteCellButtonLocator).then(($el) => { if ($el.length > ...
dushkin's user avatar
  • 2,123
1 vote
2 answers
331 views

We have a table in our application: if the table length is more than 5 it shows the pagination and if the length is less than 5 it doesn't Cypress doesn't consider it a good practice to use conditions ...
Zain's user avatar
  • 95
0 votes
5 answers
948 views

I am trying to pass an assertion to if condition and execute a logic when the condition is met and another logic when condition is failed. Since the test is failing on failure of assertion i am not ...
sandy qa's user avatar
1 vote
2 answers
565 views

I have the following lines of code in my before() hook. before(() ==> { cy.get(this.testPopup).then(($el) => { if ($el.length) { cy.get(this.testPopupCloseButton).click(); cy.get(...
Eddy's user avatar
  • 11
0 votes
1 answer
255 views

Use case: I have to search and click the course. I have 10 pages, each page contains 20 courses. I need to find the course(which is random). If the course is available in the first page, it will click ...
BugBee's user avatar
  • 139
1 vote
1 answer
548 views

How do you do conditional testing in cypress with labels? For example: I want to know if there is the "ole" written in between the span: <div> <span role="test">ole&...
Jonas's user avatar
  • 394
0 votes
2 answers
149 views

In Cypress I'm simply trying to to close a filter using it's class "const filterRemoveElement = '.position-absolute > img';" But the problem is that if cypress found that element then it'...
Qadeer Hussain's user avatar
1 vote
1 answer
954 views

I want to skip a test case based on the IF ELSE statement. I'm sharing the code below but although it couldn't find the element rather than skipping, it's failing the test case then continues with the ...
Ziya I. Erogul's user avatar
0 votes
2 answers
128 views

I have some front-end test written in Groovy and I need to rewrite them in Cypress. I am currently having problem with rewriting an if condition to Cypress.If the popin window is displayed click on it,...
user avatar
0 votes
4 answers
4k views

I am trying to avoid the wait() function on my tests. I'm aware, based on the official docs, that Cypress works async and we dont need to use the wait() function, especially the visit() command ...
Theo Itzaris's user avatar
  • 4,706
1 vote
3 answers
223 views

I have a table as image below. I try to check in checkboxes having 'ST - ' text then Delete them. Here my code: cy.get('td').invoke('text').then(text => { //1st IF if (text ...
HNhu's user avatar
  • 113
1 vote
1 answer
196 views

I have this code on Cypress cy.wrap(null).then(() => { const $calculatorPayout = Cypress.$(".flex.flex-col.items-center.justify-center.h-\\[50px\\].w-10.border.border-solid.border-black-...
Hristo Atanasov's user avatar
0 votes
1 answer
208 views

In Cypress, I am trying to write function to type in the editable field. If multiple elements found for the same locator, then enter the string in last editable field, else type the text in the ...
Rama's user avatar
  • 877
0 votes
3 answers
459 views

I am trying to add else if /switch case in my test , but else if - it goes to only if case, if 'if' fail it doesn't go in else if it's happen in switch case also it('Deve cadastrar um CNPJ válido', () ...
Gilberto Vieira's user avatar
1 vote
3 answers
235 views

I'm writing Cypress End-to-End tests where I need first to check if a specific button is present on my web page (conditional testing). This is what I did: cy.get('body') .then($body => { ...
Julien Berthoud's user avatar
0 votes
1 answer
157 views

In my e2e, I need to check if the datatable is populated first before before checkboxes in the table are clicked. I am able to check the count like so cy.get('.p-datatable-table').find('tr').its('...
OLA's user avatar
  • 993
2 votes
1 answer
266 views

I'm writing E2E tests in Cypress (version 12.3.0). I have a page with a table in a multi-step creation process that requires some data from back-end application. In some cases (rarely, but it occurs) ...
Jonasz's user avatar
  • 1,852
0 votes
2 answers
283 views

I want to find out if imprint links are working. Sometimes there are cookie consistent banners and you can not click the link on the page. But is there a way to find out if there is a second imprint ...
Al Kativo's user avatar
  • 135
1 vote
2 answers
124 views

After updating to cypress 12.0.0, I get the following error, how can I fix it?
Oleh Dymych's user avatar
1 vote
1 answer
998 views

I'm working on a cypress test that toggles a checkbox that toggles items which causes the button to appear and it click the button. The test itself works as intended for when there are items togglable....
rody401's user avatar
  • 111
7 votes
2 answers
7k views

So I think this is probably me mixing up sync/async code (Mainly because Cypress has told me so) but I have a function within a page object within Cypress that is searching for customer data. I need ...
msmith1114's user avatar
  • 3,307
2 votes
4 answers
517 views

I have some inputs in the following div cy.get("div[data-test-letterinputcontainer='0']") One of them have a value, but it is not known which. It could for example look like this <div ...
Boris Grunwald's user avatar
0 votes
2 answers
282 views

I have a test case of my site with cypress. however the site, which is been built in vue.js has lets say 2 journeys. in one of them there is an button which I want to click. So, what I want to do is ...
A Bit Of Everything's user avatar
1 vote
1 answer
990 views

There is a lot online about testing if an element exists, but i can't find anything really specific that could help in my case. For context, I am working on a website that has certain elements in them ...
WirbleWind's user avatar
4 votes
2 answers
2k views

I'm trying to do something very similar to this post: https://stackoverflow.com/questions/56145926/how-to-check-if-element-exists-using-cypress-io I'm using typsecript. Here's my code: cy.get("...
NicolasM's user avatar
1 vote
3 answers
2k views

so I have to use cy.contains to find the element I want, but all I can find online is how to use if() with cy.find or cy.get if there a way to do this with contains? Example code: if(cy.contains('div....
FlawFull's user avatar
  • 149
4 votes
1 answer
711 views

I need to handle the case where my page may display a popup dialog at the load stage, or it may not appear. Clicking anywhere will remove it and I'm not interested in testing this dialog, but it ...
Lisa La's user avatar
2 votes
2 answers
3k views

I am writing a test in which if I land on a page and if any records are available, I need to click on three dots buttons near the record. But I should skip the test if no records are available on the ...
Bhawin Joshi's user avatar
0 votes
2 answers
562 views

I have a case when I need to wait for element (advertising), if it's visible then needs to click it, but if element wasn't found after timeout then needs to keep executing a test. How to handle the ...
Igor Vlasuyk's user avatar
0 votes
2 answers
3k views

I have an application, where feedback pop up comes in a page randomly; like pop up may or may not come in the page after loading it for nearly 3000ms. How to handle this pop up in cypress. I tried ...
ss333iiii's user avatar
1 vote
2 answers
612 views

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 ...
LovelyAndy's user avatar
0 votes
3 answers
1k views

I see some posts about this exact topic, but none of them using data classes like I am as selectors, so it makes this conditional test a bit harder to write. The idea is that I have a table with ...
LovelyAndy's user avatar
0 votes
3 answers
555 views

On the HTML page nested div tags are there. And either div tag ID = x or tag ID =y. in different HTML pages. <--! example 1 --> <body> <div> <div></div> &...
Chintan's user avatar
  • 51
1 vote
1 answer
633 views

I have an E-commerce application, in which i want to delete the products from my cart if anything is there before my automation tests starts(kind of cleaning up the cart before test starts). We are ...
ss333iiii's user avatar
1 vote
2 answers
460 views

I just want to ask how to properly conditional testing? I have this code here cy.get('[data-slug="add-to-any"] > .plugin-title > strong').then(($slug) => { if (expect($...
Noel's user avatar
  • 401