https://cypress.io logo
Join Discord
Powered by
# general
  • How can I override baseUrl from cmd line variable CYPRESS_RUN_ENV=live/staging?
    b

    busy-football-20916

    04/27/2023, 11:47 AM
    I want to choose which url to run tests on by telling it in the cmd. I have two urls under cypress.config.js file env: {live: "x" and staging: "y"}. So idea is if i CYPRESS_RUN_ENV=live in the cmd, then baseUrl is overwritten to be x. How would i do this?
    g
    f
    l
    • 4
    • 5
  • Cypress crashing issues
    a

    abundant-crayon-56661

    04/28/2023, 1:42 PM
    We are on Cypress 12.8.1 and were having no issues until a few days ago. The UI of Cypress would stop responding on our Windows development laptops and our AWS test box has followed a day later. No updates, version changes, config changes, code changes or anything happened; the crashing across the board is seemingly random. Help.
    s
    w
    +2
    • 5
    • 8
  • Im getting error custom command name its not a function using typescript kindly check and suggestion
    q

    quiet-house-97222

    05/01/2023, 8:26 AM

    https://cdn.discordapp.com/attachments/1102511354004394064/1102511354897776650/image.png▾

    https://cdn.discordapp.com/attachments/1102511354004394064/1102511355313000488/image.png▾

    https://cdn.discordapp.com/attachments/1102511354004394064/1102511355690500146/image.png▾

    https://cdn.discordapp.com/attachments/1102511354004394064/1102511356042809424/image.png▾

    m
    • 2
    • 3
  • How to write tests for SSR Hydration Errors
    b

    bulky-air-5304

    05/02/2023, 5:35 PM
    We've seen these errors pop up here and there, but when we fix them, there's no way to make sure they don't regress in the future. Is there a way to write component tests for components which render on the server and client to make sure new hydration errors aren't introduced?
  • Cypress : How to login with two different users to execute two different files one after other
    m

    modern-eve-89801

    05/03/2023, 6:48 AM
    The application follows two factor authentication. It first navigated to application login then when we click on login it takes us to Microsoft login and then redirects back to the application. I am trying to execute two test case files(.js) one after the other. I am doing so by importing them into a spec file and running it. The first step in both files is to login and then perform some task in before each. Each file has different user credentials to login to. The first file with the first user, logs in and executes cases, but when the second file needs a different user login with his credentials, an error is thrown. I am calling a common login function for both files and only modifying the "user" parameter. Can someone help me with a solution? I have mentioned the login function I have used.                        Cypress.Commands.add("login", (user) => { cy.sqlServer(select USERID, password from table name where User=${user}).then(function (result) { var userID = result[0] var password = result[1] const credentials = { userID, password } cy.session([userID, password], () => { cy.viewport('macbook-16') cy.visit('https://applicationurl1.com/') cy.get('.login-btn').click() //clicking accept cookie button cy.get('#onetrust-accept-btn-handler').should('be.visible').click() //clicking microsoft login button cy.get('#microsoft-external-auth-button').should('be.visible').click() //redirected to microsoft login cy.origin('https://login.microsoftonline.com/', { args: credentials }, ({ userID, password }) => { //entering username //clicking next //entering password //clicking 'login' button cy.wait(1000) }) }) })})

    https://cdn.discordapp.com/attachments/1103211436794187816/1103211878466981940/MicrosoftTeams-image_12.png▾

    https://cdn.discordapp.com/attachments/1103211436794187816/1103211878735425536/MicrosoftTeams-image_11.png▾

  • Cypress vs git repo
    m

    mammoth-airport-22852

    05/03/2023, 7:11 AM
    Hi, is there a way to run cypress tests against the branch of the repo being pushed to git, without running locally? I'd like to be able to test the code in a push or pr, without a "live" app. Thanks in advance.
    m
    e
    • 3
    • 2
  • Is it possible to skip a portion of a test on a rerun?
    e

    echoing-tent-95037

    05/03/2023, 7:21 PM
    Example: I have a before call that gets a user in a specific state, if the test fails during this portion for whatever reason and then reruns it will always fail on the second run due to that state that its in now. I would like to do some kind of check that if a rerun is happening skip the before call.
    e
    a
    • 3
    • 3
  • Is it possible to edit the defaulte template generated by Cypress Studio?
    b

    blue-byte-69122

    05/04/2023, 12:30 PM
    Exactly as the title says I am curious if and how it is possible to edit the generated script by adding a new spec in Cypress studio. If this is possible that would be very usefull.
    e
    • 2
    • 4
  • SOLVED: Newer version of Chrome than 107 in docker images
    t

    thousands-house-85089

    05/04/2023, 4:37 PM
    Is there a newer version of Chrome than v107 available in docker images? https://github.com/cypress-io/cypress-docker-images/tree/master/browsers I believe we're encountering a bug in our app that only shows on this version and would like to run my tests against a newer version to see if my theory is correct. I was expecting to see some updated versions since Chrome is on v112 now and these docker images don't seem to have been updated for 6 months+ Thanks
    m
    • 2
    • 5
  • Hi Cypress Team I Just Added a code for testing the web application using cypress but could not
    f

    famous-jackal-78150

    05/05/2023, 5:53 AM
    Errors for Below codedescribe('ITUS Test', () => { beforeEach(() => { cy.visit('https://buat.itus.co.in/homepage', { pageLoadTimeout: 240000, onBeforeLoad: (win) => { // disable service worker win.navigator.serviceWorker.getRegistrations().then((registrations) => { for (const registration of registrations) { registration.unregister(); } }); }, }); });
    • 1
    • 3
  • Unable to Execute the cypress test case
    f

    famous-jackal-78150

    05/05/2023, 5:56 AM
    // test file describe('ITUS Test', () => { beforeEach(() => { cy.visit('https://buat.itus.co.in/homepage', { pageLoadTimeout: 240000, onBeforeLoad: (win) => { // disable service worker win.navigator.serviceWorker.getRegistrations().then((registrations) => { for (const registration of registrations) { registration.unregister(); } }); }, }); }); it('should display login page', () => { cy.wait(5000); cy.get('#login-form').should('be.visible').retry({ delay: 1000, // time to wait between retries, in milliseconds maxAttempts: 5, // maximum number of times to retry the assertion }); const employeenumber = 'QA'; const pwd ='Itus@2022'; }); });
  • Cypress Runner UI flashing between req and response
    a

    aloof-carpet-54145

    05/05/2023, 6:36 PM
    Anyone sene this an dhow the hell do I stop it: https://www.loom.com/share/66faf50834e642f891a18b49412284c0
  • Cypress.env Intellisense (vscode)
    r

    rough-jordan-64731

    05/08/2023, 6:32 PM
    Is there something like Intellisense for Cypress.env() available? When writing
    Cypress.env(
    I want to get a code suggestion for the available env variables defined in my cypress.config.ts. I just wanted to ask here before implementing it myself, since I'm annoyed to always have to look up my cypress.config.ts for my defined env variables 😄
  • What is Cypress Cloud?
    q

    quiet-knife-49377

    05/10/2023, 6:59 AM
    What is cypress cloud? Is it a CI tool? Where do your tests run when you run them with cypress cloud? I was under the assumption that it runs on a VM using cypress cloud.
    m
    t
    w
    • 4
    • 8
  • cypress-testing-library and Cypress's best practices on queries seem at odds with each other.
    b

    billowy-animal-75040

    05/10/2023, 10:25 PM
    Reading through the best practices document, under Selecting Elements (https://docs.cypress.io/guides/references/best-practices#Selecting-Elements), the best practice for Cypress states to use a
    data-*
    attribute to avoid brittle selectors that are subject to change. They also state that they strongly endorse the Testing Library ethos and approach to writing tests and strongly endorse their best practice (https://docs.cypress.io/guides/references/best-practices#Selecting-Elements). However, the testing library prioritizes
    data-*
    attributes as the lowest method selection (https://testing-library.com/docs/queries/about/#priority). Personally, I agree with the testing library's approach and guiding principles, but this section on Cypress's best practices guide felt very contradictory to me and am curious if I'm misunderstanding anything.
    g
    w
    • 3
    • 7
  • All specs being limited to 30, even when I run more...
    f

    faint-winter-1135

    05/11/2023, 4:42 PM
    In the past 24 hours all my suite runs limit the specs displayed in the UI to 30, even though it knows I ran more, and the overview shows the correct summary, but I cannot see more than 30 of the specs that ran. I've opened a support ticket, and support has responded they are looking at, but it has been nothing but radio silence and there are no updates on the Cypress dashboard indicating this "visual" issue. In addition, it appears video uploads past the 30 cap fail to upload--which leads me to believe that maybe it isn't a fully visual issue. Please help.
    • 1
    • 1
  • Cypress and Jenkins (Linux)
    s

    stale-bear-96866

    05/11/2023, 11:34 PM
    Goodnight! Has anyone encountered the error below when running Cypress on Jenkins, on a Linux machine? ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
    m
    l
    • 3
    • 6
  • Github Actions
    f

    famous-dress-70846

    05/12/2023, 6:06 PM
    Hello guys Im having a problem with Github Actions and I dont know how to solve it some expert willing to help me? 😦

    https://cdn.discordapp.com/attachments/1106643634431987812/1106643634805276823/image.png▾

    m
    • 2
    • 2
  • Any pointers on best way to run tests parallel via Github actions?
    p

    proud-river-89845

    05/13/2023, 12:04 AM
    We are currently not running tests in parallel. Any pointers on that
    m
    g
    • 3
    • 2
  • Subsequent retries does not properly display on terminal when using 'cypress run'
    a

    adorable-insurance-32249

    05/15/2023, 1:38 PM
    I've enabled retries by passing in the retries object in my cypress.config.json
    Copy code
    "retries" : {
        "runMode": 1,
        "openMode": 0
      }
    My full command was `npx cypress run --spec My terminal never displays the second attempt. When running it in openMode, it does show the second attempt.

    https://cdn.discordapp.com/attachments/1107663292073246770/1107663292324925592/Screen_Shot_2023-05-15_at_09.28.55.png▾

  • How to deal with functions that can't be resolved?
    b

    broad-wire-63018

    05/15/2023, 3:06 PM
    I am having issues with my i18n. I don't want to import it to cypress but i would rather fake the response of the $t fucntion but i am clueless how to do this and cannot find anything about it. Can someone send me in the right direction?
  • e2e - Login okta
    c

    calm-cartoon-89224

    05/17/2023, 2:46 PM
    Hi, I am trying to perform some e2e tests. I have to access a web application, and it redirects me to the okta login, I type user and password and click on the login button. When I do this it should redirect me again to my web application, but it does not. What it does is to return to the okta login. This does not happen manually, and using selenium either. How can I fix it? Thanks
    h
    • 2
    • 1
  • Can I mock React Context?
    f

    flat-painter-96557

    05/18/2023, 4:37 PM
    For e2e test?
    m
    • 2
    • 1
  • Chrome Extensions
    e

    echoing-tent-95037

    05/18/2023, 8:32 PM
    Has there been any updates on Cypress being able to interact with chrome extensions? The team Im working on is using dApps and it would be really beneficial for us to be able to use our wallet extension during tests.
  • please turn the general chat into a normal chat and not a forum
    q

    quiet-knife-49377

    05/18/2023, 9:56 PM
    There are other forum channels, I think a dedicated group general chat is better. Turning this into a forum has killed that chat, you could just use Reddit at that point
    w
    m
    b
    • 4
    • 11
  • Does anyone know if it's possible to 'hide' when a request has been aliased in the Cypress runner?
    h

    happy-table-33950

    05/19/2023, 6:20 AM
    For context, I have to pass a header to all outgoing requests to get past authentication and bot protection, so all requests are now shown as intercepted. This results in every request showing an interception and can make finding aliases I'm interested in tedious. I'm not even sure if this is possible, I've been hunting through the docs but have been unable to find anything. I'm hoping someone else has solved this?

    https://cdn.discordapp.com/attachments/1109002658838216704/1109002658985037894/image.png▾

  • EDDL events are not loading in cypress runner instead loading in second tab of cypress runner
    e

    early-lamp-20318

    05/19/2023, 5:54 PM
    Current behavior Hi Team, When I am hitting window.appEventData in my application, without cypress it is showing three EDDL events just after website loads. And when I am running the same thing in cypress runner then it is only showing first EDDL event. I tried to debug and I found that all three EDDLs are loading when I am opening one new tab in cypress runner window. Unfortunately, I can not automate second tab of cypress window. It there any solution to this problem? Please refer below piece of code: cy.window().then(function (win) { //Validating "Page Load Started" attribute expect(win.appEventData[0].event).equal(event1) // Passing expect(win.appEventData[1].event).equal(event2) // Failing but passing in second tab of cypress runner I am using "cypress": "12.7.0", Also I did tried the same in lower versions as well but it was not working. Desired behavior If it is able to load all all EDDL events in second tabs then it should also loads EDDL events in first tab of cypress runner. Test code to reproduce cy.window().then(function (win) { //Validating "Page Load Started" attribute expect(win.appEventData[0].event).equal(event1) // Passing expect(win.appEventData[1].event).equal(event2) // Failing but passing in second tab of cypress runner Cypress Version 12.7.0 Node version 10.24.0 Operating System Red Hat Enterprise Linux 8.6
    g
    • 2
    • 1
  • send mail
    m

    miniature-diamond-70651

    05/22/2023, 6:41 AM
    How to send mail and receive mail by using cypress
    s
    • 2
    • 1
  • Cypress and browser statistic
    s

    shy-shampoo-20893

    05/22/2023, 7:48 PM
    Hi, do we have any statistics on individual browsers. Speed of cypress loading itself, speed of test processing, etc. Did anyone do such a survey?
    • 1
    • 1
  • Job Postings? Frowned Upon?
    e

    echoing-kangaroo-83836

    05/23/2023, 1:23 PM
    I'm a Quality Engineering Tech Lead and the company I work for is going to be looking for some Cypress Quality Engineer's later this year. I just wanted to check if it's acceptable to do a post like this in the future to look for candidates? If it's against the server rules I understand, just wanted to confirm since I didn't see anything in the guidelines. Thanks!
    b
    • 2
    • 2