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
3
votes
1answer
41 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 ...
0
votes
1answer
14 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 ...
1
vote
1answer
25 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 ...
-1
votes
0answers
33 views

Why do I see 302 response error when running my Cypress tests?

I am frequently observing a 302 response in the console when I trigger certain Cypress automation tests (such as selecting a value from a drop down and wait for 2-3 seconds for the screen to filter ...
2
votes
2answers
75 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 ...
0
votes
1answer
213 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-...
2
votes
3answers
276 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
1answer
37 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
0answers
279 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
1answer
38 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 ...
1
vote
0answers
134 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">...
1
vote
1answer
98 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=...
0
votes
2answers
45 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 ...
1
vote
6answers
526 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 ...
0
votes
1answer
369 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=&...
0
votes
2answers
3k 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 ...
7
votes
5answers
2k 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 ...
0
votes
0answers
30 views

Is there any way I can have Cypress test steps printed out in the command prompt?

Cypress shows a log of all test cases / spec files executed while execution goes on in CMD. I want to know if there is a way that Cypress can show the test steps execution also in the command prompt. ...
-1
votes
2answers
329 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 ...
1
vote
1answer
90 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 ...
1
vote
1answer
5k views

How to wait till all components are loaded in Cypress?

My Cypress test cases are working fine when I run from my system pointing to QA. But the scheduled builds from CI are failing randomly because sometimes the page is taking more time to load. I've ...
5
votes
3answers
186 views

End to End tests on multiple build agents?

I am using Cypress for end-to-end testing on a Web App, and for some browsers I noticed slight changes in the output when changing the build agent. It is something that I didn't even consider before, ...
0
votes
1answer
259 views

My Cypress Reports Folder does not get properly deleted when I execute the rmdir command in the package.json file. Which command should I use?

I am running Cypress on a Windows machine. I am using this command (included in the package.json file) to remove the cypress/reports folder before the start of each test run: "clean:reports": "IF ...
0
votes
1answer
568 views

Cypress: Problems in merging individual test suite Mochawesome reports. Consistent Errors observed

I'm using Mochawesome with Cypress to generate reports. I am consistently observing this error when I attempt to merge my individual Mochawesome test suite files into one combined report: ERROR: ...
0
votes
0answers
1k views

Cypress catch and validate a redirect

We're creating E2E tests in Cypress. One of our tests shows a list of banks to which you can be redirected to complete a payment. After clicking a specific bank with the following code: cy.get('....
1
vote
2answers
76 views

where to put cypress tests?

I am new to Cypress and trying to find the best practices for where to store our tests. I see there seems to be plenty of resources for how to organize folders to setup fixtures, tests, plugins, etc. ...
-2
votes
1answer
157 views

What is the difference between the Selenium tool and the Cypress tool?

What is the difference between the Selenium tool and Cypress tool? How they both are works differently from each other?
1
vote
2answers
41 views

Assertions for CLI Commands in CI/CD environment

I am working with a Cypress testing framework in a CI/CD environment. There are several Cypress smoke tests that run each time my team pushes a build. However, I would like to add tests that make ...
2
votes
1answer
2k views

If else loop is not working/ element exists: cypress automation

I am new to cypress. I read some of the other if-else cypress related questions and yet fail to understand whats wrong with my code. What I am trying to accomplish: if "There are no results" found on ...
0
votes
2answers
128 views

Stubbing Responses in end-to-end tests?

So i've been trying out Cypress for the past few days, and im liking the tool so far. One feature it enables is being able to stub network requests (I think only xhr right now). Im sure other tools ...
3
votes
2answers
730 views

How to have a global alias for network requests in Cypress

In my e2e tests it happens that I have to wait for a xhr request to finish. So I have created an alias "graphql": cy.server(); cy.route({ method: "POST", url: Cypress.env('GRAPHQL_API'), })....
1
vote
1answer
732 views

Cypress redirect e2e test with stripe js

I am writing an e2e test in cypress for an online store and after clicking the confirm purchase button it redirects to stripe page (not iframe but one-time payment redirect to their website) to input ...
5
votes
2answers
5k views

Is there a way to automate multiple tabs using cypress?

Is there a way to automate multiple tabs using cypress? e.g. After login to my webpage, I get redirected to another tab. So, I would like to automate login in 1st tab and then perform other testing ...
-1
votes
1answer
622 views

how to get list of files in a directory recursively in Cypress?

I wrote this code and it works fine, that is written in TypeScript. When I use the same code in the test file in Cypress I get error TypeError: fs.readdir is not a function import * as fs from 'fs' ...
4
votes
2answers
1k views

Do something as long as element is on page - cypress

I'm new to cypress and I just hit this problem I seem unable to solve. What I'm trying to do is this: on an eshop page, there's this "Show More Products" button (sorry for the language :)): If I ...
0
votes
1answer
2k views

Reset state before each Cypress test - TypeError: cy.resetDb is not a function

I use Cypress with my local web app. I followed install and run instructions: https://github.com/gothinkster/react-mobx-realworld-example-app Tests work fine until I wanted to reset database state ...
4
votes
2answers
3k views

Testing React web application in Selenium(Java)

In my work I use Selenium(Java) to automated test. Now web application will be rewritten to React, and there's my question: Automating react application using Selenium under Java is good choice? Do ...
2
votes
3answers
6k views

Select files from system's local drive using cypress

How to select files from a local computer and upload to the website using cypress?
11
votes
3answers
30k views

How to check a button is disabled using Cypress

<button _ngcontent-c21="" color="primary" mat-button="" class="mat-button mat-primary" ng-reflect-disabled="true" ng-reflect-color="primary" disabled=""><span class="mat-button-wrapper"> ...
1
vote
1answer
2k views

Using Cypress tests how to select a feature on a map location

We have an app where we can display dataset features on an Open Layers map page. These dataset features are then selectable to allow further attributes of these datasets to be displayed. In my ...
2
votes
1answer
1k views

How to set an enviromental variable to indicate test environment in Cypress

I need to include in my test scenarios a way to determine which environment they are being executed in. We have BVT (build verification test) and a UAT (user Acceptance Test) environments. Within our ...
2
votes
1answer
8k views

Why isn't my 'if' statement working in my Cypress test

I'm trying to add an 'if' statement into my login test as there are two login pages that can be loaded. The test below is failing when it can't find the text 'Not your account?', when it should be ...
4
votes
1answer
9k views

Cypress if-then-else, while and foreach

In the context of my master’s thesis, I have been working on web application testing. My original goal was to have some form of automation on UI testing, such that easy end-to-end testing was possible....
6
votes
7answers
238 views

Test all elements in a single test or 18 separate tests

I have a test that is making sure that all elements are visible on a page, my question is should I have 18 separate test cases or just one? Example, which is better let baseURL = Cypress.env("...
8
votes
3answers
7k views

Cypress vs Protractor for end-to-end testing

I've recently stumbled upon a modern end-to-end testing framework called Cypress which is going to be released in public beta this year. It really looks awesome at the first glance - there are ...