63 questions
0
votes
1
answer
82
views
In cypress, I wanted to execute a flow based on a web locator visiblity. How to achieve it? [duplicate]
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 ...
3
votes
1
answer
105
views
Cypress - How to only click button if it contains "chevron_right"
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 ...
-1
votes
1
answer
88
views
Cypress If-Else using Contains [closed]
My script looks like below
const item ["a1", "a2",..............,"a45"]
const regex = new RegExp(`${item .join('|')}`, 'g')
if(cy.get('body').contains(regex)){
...
1
vote
1
answer
68
views
How to skip failing part in Cypress test script
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:...
0
votes
0
answers
45
views
Cypress e2e.js file giving error while connecting SQL server using Cucumber [duplicate]
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
...
0
votes
1
answer
39
views
Making a function inside an if statement run until you get a false value for the conditional using JS in Cypress
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 ...
0
votes
2
answers
589
views
cypress - how to continue running loop after assertion error
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 ...
0
votes
2
answers
70
views
If condition fails and does not go in else block as using 'contains' [closed]
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 ...
-1
votes
3
answers
651
views
I am facing a problem to verify element visibility if element in visible or not using cypress
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 ...
0
votes
1
answer
254
views
CSS property: display: none Cypress error - Cannot click Add buttons to add products to basket
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 =...
0
votes
1
answer
113
views
How to handle hidden elements in Cypress with if statement? [duplicate]
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 ...
0
votes
1
answer
140
views
if-else containing a cy.get as an condition
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--...
0
votes
1
answer
836
views
How to wait until all images have loaded before running Cypress test?
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 ...
-1
votes
1
answer
412
views
How to scroll the table in a page and catch all the elements using each in cypress? [closed]
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 ...
-1
votes
1
answer
87
views
How to be able to handle both cases of element exists and does not exist? [duplicate]
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'...