Questions tagged [cypress]

Questions about using Cypress.io, an open source tool for testing anything that runs in a browser.

Filter by
Sorted by
Tagged with
-1 votes
1 answer
86 views

How to connect with Mysql db using Cypress 12?

I want to connect to Mysql DB in the server to delete several records. I have tried using some of the tutorials and answers available. Since all of them are regarding older versions of Cypress, I can'...
  • 1,179
0 votes
1 answer
50 views

Will Selenium Webdriver become less popular in coming years? [closed]

Lot of Automation engineers have shifted to new Web automation tools like Cypress, WebDriverIO, Pupeeter, Playwritght, Katalon Studio, AI tools like Testium, Functionize etc and i am still working on ...
0 votes
1 answer
58 views

Cypress Error on chaining Cypress-If / Cypress-Drag-Drop commands with Cypress-iFrame commands

The application, which I have to automate, is completely inside an iframe. To continue, I used cypress-iframe plugin. However, when I am trying to chain the commands of cypress-drag-drop or cypress-if ...
  • 101
0 votes
0 answers
294 views

How to pass dynamically JSON test data file to json spec.js file to get data in Cypress + Cucumber?

I want to run same test for the same web page for different combinations. Therefore I'm planning to created different scenarios in same feature file or different files. I have already tried passing ...
  • 1,179
1 vote
5 answers
140 views

Is it possible to use Cypress for data validation?

I'm writing some end-to-end automated tests for a CRM-alike web application. One of the development team leaders is asking me to do something that I've never done before. The problem is that the data ...
  • 11
0 votes
2 answers
504 views

What is the best cypress approach for waiting on data from an API?

Given the following Cypress v10.9.0 spec: it('can search the database', () => { cy.get('[data-cy=searchInput]').type('my search'); cy.get('[data-cy=searchOutput]').contains('Searching...')...
0 votes
1 answer
1k views

Verify read-only fields using cypress

I have a few text fields which when I login as a specific user (rights of a read only) , all the text fields are not allowed to be edited. I am trying to automate this page in Cypress. I tried using : ...
0 votes
0 answers
15 views

Connection to DB is lost out 8-10 times when connecting through cypress for a test, Need help

I am writing a test in cypress where I hit an endpoint>it saves a token in DB(MySql)>I wrote a query to extract the token(in the test)>The use the token in the next API request and pass it in ...
0 votes
2 answers
535 views

Conditional statement in cypress

I have a scenario that I'm having difficulty with - in 2 separate environments I have 2 expected outcomes due to multi factor authentication. In one environment I have a popup notification that needs ...
  • 1,190
0 votes
1 answer
40 views

How to assert whether the file has been uploaded or not?

<div class="form-fill-file"> <input data-val="true" data-val-requiredif="Please upload invoice file." id="Upload_File" name="Upload.File" ...
0 votes
1 answer
731 views

How to set cypress to automatically detect proxy for automated executions?

I have a cypress test and its not loading the website properly. When I manually open the website using chrome, the website is working ok. Also I can find that my chrome proxy setting is set as "...
0 votes
0 answers
434 views

Issue connecting Cypress to Postgres database

I'm running into an issue connecting to the database using cypress-postgres. The server has multiple databases along with multiple schemas. I tried multiple plugins, but can't find a solution that ...
0 votes
0 answers
2k views

Cypress - Identify when page is fully loaded

I am new to Cypress, but wanted to capture the time from visiting a page, up until the page is fully rendered and available to use. I understand I can use the Window: load event to identify when the ...
  • 1
0 votes
1 answer
2k views

Cypress: cy.type() requires a valid time with the format with the format HH:mm, HH:mm:ss or HH:mm:ss.SSS

I am automating using cypress, there is a time input in the application. The html of it as follows: <label>Time</label> <input data-testid="time" type="time" name=&...
  • 139
0 votes
1 answer
1k views

Testing Stripe payment integration using Cypress

We've recently implemented Stripe for customers to checkout. However, using Cypress to automate our regression tests was incredibly painful as the fields are inside an iframe (and, for some reason, ...
  • 2,480
2 votes
1 answer
2k views

Conditional testing on checkbox in Cypress

I have a checkbox which I want to check if it is not checked and want to uncheck it if it is checked in Cypress. How can I do that?
0 votes
1 answer
66 views

How can I create a test starter page for Cypress

I'm having a hard time finding any information on creating a basic HTML page from which I can start my Cypress tests. I want to create a simple page with a few options/buttons for running different ...
1 vote
1 answer
3k views

How to return a value from a then() block and use it in another then block in cypress

cy.get('div:nth-child(1) > div:nth-child(1) > div.MuiGrid-root.MuiGrid-item.MuiGrid-grid-xs-6 > div > span.MuiChip-label').then(($today) => { const today=$today.text() cy....
0 votes
1 answer
1k views

How to get list of disabled elements on page using Cypress

How to get a list of disabled elements on a page using Cypress? Thanks in advance.
2 votes
2 answers
121 views

Test Coverage Report in Cypress

I write my test cases in Confluence and then automate them in Cypress. I was wondering is there any way I can get the test coverage report. I already looked into Istanbul but it is for code coverage. ...
  • 31
2 votes
2 answers
813 views

Whats the best approach to select elements for automated testing?

I read following in cypress's best practices. Anti-Pattern: Using highly brittle selectors that are subject to change. Best Practice: Use data-* attributes to provide context to your selectors and ...
  • 121
3 votes
2 answers
956 views

End to end application tests when separate repo for the front-end and back-end tests

We have separate repos for the backend and the front end. The backend which is just microservices has its unit tests(jest), microservice integration tests(jest), and microservice end-to-end tests(jest)...
1 vote
2 answers
139 views

Running Cypress with Git Hub Actions

I want to run Cypress tests on Git Hub action. The GH page is enabled and the workflow seems to be passed: But when I click Actions I should see the workflows, instead, it shows "There are no ...
-2 votes
1 answer
2k views

Return multiple variables from custom command in Cypress

What I am trying to do: I have a custom command, inside which i am declaring few variables(boolean). I am setting the values for the variables as per my code. I wanna use the variables to assert in ...
-1 votes
1 answer
839 views

Cypress detects uncaught errors originated from application [closed]

My test was running successfully. I did not update anything, but suddenly my spec is failing. This is the error displayed: The funny thing is I don't see the a.focus on my cypress code and Cypress ...
0 votes
3 answers
2k views

How do I deal with duplicated testing steps in Cypress?

Writing test cases using Cypress and Cucumber. I have a few test cases written in Cucumber Syntax like following: @focus Scenario: All Accessibility tabs (Color scheme, Font size, Zoom) are visible ...
  • 9,810
2 votes
1 answer
8k views

How to wait the loading spinner disappears in Cypress

When I run Cypress, the page of my application shows the loading spinner spinning indefinitely. While it is spinning the other components of the page are not displayed, so I need this spinner to ...
0 votes
1 answer
226 views

Handle web tables with Shadow DOM in Cypress

I am struggling to make Cypress see my web table that is in a Shadow DOM. My test Scenario is: After I type invalid data on the search bar, e.g 'oo', Cypress ensures that the table is empty, this ...
0 votes
2 answers
5k views

XHR requests are cancelled in Cypress

My test in Cypress does the following: Do the login On the next page clicks a button The button clicked in step 2, Cypress starts to load the correct URL but then the landing page (login screen from ...
11 votes
3 answers
23k views

How to simulate a simple keypress in Cypress

Working on webpage test automation with Cypress atm. Ran into a problem. I need to simulate a pressing of the ESCAPE key from a user. Cypress has its own type() method, but it is required to chain ...
  • 9,810
0 votes
1 answer
2k views

How to handle menu bar in Cypress

I am trying to click the search bar either on the sidebar <im-sidebar class="hydrated"> or top menu <nav_class = "top-menu">. This is the code So I tried: cy.get('....
1 vote
3 answers
1k views

Breaking a loop after resolving a promise

I am writing a program to check the health endpoint of one of our APIs. So, before starting execution, I try to hit the health endpoint 5 times. If I get the desired response code during the 5 ...
  • 1,722
4 votes
1 answer
972 views

Shall I put my e2e tests and performance test frameworks on the same repository?

I am using Cypress for my e2e tests and k6 for my performance tests. They are both in Javascript and access the same config json files (I use this for my environment variables). The folder structure ...
  • 143
0 votes
2 answers
407 views

What is the extent that the cypress.io has support for iframe related scripting?

I am trying out to use cypress.io tool for my web automation. My application has iframes and cypress.io on their website has mentioned that it has limited support for iframe pages. I wrote the ...
  • 3
1 vote
1 answer
514 views

How to avoid repeated requests in Cypress tests

Since aliases are cleared after each test (it) when using Cypress, it seems subsequent tests needs to execute the same request again and again, while I would prefer to get it only once. This can be ...
  • 202
1 vote
2 answers
2k views

How to run a web browser automated test in mobile mode using cypress version 5?

I want to run my browser tests against tablet versions of a release targeting iOS tablets-how can i script it in cypressio or is it possible in alternation web automation tools? The objective to write ...
2 votes
2 answers
4k views

How to get cookie value in cypress from a cy.request response?

I am using the following before my test to try and get a cookie value from the request cy.request({ method:'GET', url:`https://test:test!@mf-test-magento19.test.com/meat/meat-...
4 votes
3 answers
1k views

How can Cypress be seen as an End-to-end testing tool when it cannot travel across different domains?

I want to use cypress as an alternative to webdriver.io but I am struggling to get my arguments across to the rest of my team as it cannot travel across other superdomains whereas Webdriver.io does ...
0 votes
1 answer
120 views

Assert that options (text) in drop down are unique

I’m creating test in cypress using typescript, I’m not sure how to assert that all options in drop down are unique - I found bug where is situation that values are duplicated multiple times - it’s a ...
2 votes
0 answers
3k views

Trouble with assertions when testing PDF files

Objective: To find distinctive data that has been encoded in a pdf and write assertions using cypress to ensure data accuracy. Observed Behavior: Assertions that have been written do not execute. I ...
0 votes
1 answer
124 views

Is it considered an anti-pattern for me to group Cypress test steps this way?

Writing end2end tests with Cypress and cucumber, on a high level the test cases are as following: Feature: Users can change color scheme @focus Scenario: The user changes color scheme from Black ...
  • 9,810
1 vote
0 answers
449 views

Accessing elements within a Frame in Cypress

I am trying to interact with elements within a frame. <frame name="content" scrolling="AUTO" src="empty.jsp"> #document <html lang="en">...
  • 383
1 vote
1 answer
631 views

Accessing element within a frame, nested within tables in Cypress

I've written two custom functions to allow Cypress to access a frame and select a menu item from this code: <frame name="leftFrame" scrolling="YES" noresize="" src=...
  • 383
0 votes
2 answers
769 views

In Gherkin files, should I repeat the steps in the previous scenario if my following scenario depends on it?

I have read about the Cardinal Rule of BDD from various places when writing Gherkin files. In many of these examples, they have the following scenarios in a feature file: Feature: Google Searching ...
  • 151
4 votes
6 answers
5k views

How can I measure the coverage of my E2E tests?

I'm looking for a way to measure the coverage of my end-to-end tests. I have some existing E2E tests already and I'm adding more test scenarios to it. But I would like to have a way to quantify the ...
  • 151
1 vote
1 answer
2k views

Hover on svg in cypress and test tooltip

Scenario: I have something similar: <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <!-- Using g to inherit presentation attributes --> <g fill=&...
  • 209
2 votes
2 answers
14k views

visiting a dynamic link that opened in new tab in cypress

Scenario: While clicking a link/button in the application, a new tab is opened (with a dynamic url) Is there a way in cypress to test somethings in the newly opened tab? I cannot use cy.visit() as ...
  • 209
10 votes
5 answers
3k views

Is Cypress set to replace Selenium as the preferred tool for automating web applications? [closed]

I see many articles pointing out the effectiveness of Cypress as against Selenium for automating web applications. From most of the articles I've read, I see some points for Cypress such as: Cypress ...
  • 457
0 votes
2 answers
2k views

How to add two data attribute check in cypress?

Example: <div data-component="tab" data-value="first_tab"> </div> How can I get data-component="tab" and data-value="first_tab" together in cypress ...
  • 209
2 votes
1 answer
359 views

How do I automate the setting of Cypress environment variables on a windows machine via a text file?

On Unix and Mac machines, environmental variables can be read from .env files which have 'export' commands in them. For example: export USER_ENV=test export CLIENT=company In windows, there's no ...
  • 457