https://cypress.io logo
Join Discord
Powered by
# i-need-help
  • Cypress is becoming laggy when opening chrome or edge
    l

    lively-library-21721

    02/24/2023, 2:35 PM
    Today my first time experiencing lag when running cypress. When i ran test in chrome or edge for several times, then it will become very laggy until all my case failed. Even cypress cannot open chrome or edge browser frequently. I need to force close cypress windows 1st, then reopen again to get back the normal performance. But it did not solve the issue coz just temporary and will get laggy again But when i chose electron, cypress works fine. Not sure what happening, any suggestion on this issue? Also because of this issue my pc became hang and laggy also, my pc has 16gb of ram, and when using cypress it cost me about 4gb of ram. It works just find before, i already used cypress for 3 months. Already using cypress 12.6.0
    • 1
    • 1
  • Cypress is running code from a different branch
    m

    melodic-egg-83620

    02/24/2023, 3:07 PM
    I've run into a Cypress bug where regardless of what branch I'm on, it's trying to run some cached version of the FE. I've tried the following: Change branches, uninstall and install node modules, change back, repeat Downgrade and upgrade Cypress version Install Cypress globally and clear its cache Restart computer (tried on my mac and PC) I've had this issue before, but it was easy to just restart my PC and everything was fixed, but now, it's only running code from the same branch both computers have access at some point. Here's proof in the image. You can see where it's pointing as the error in the code, but in that opened file, the code is completely different.
    l
    • 2
    • 5
  • Tests not retaining location between iterations
    m

    many-needle-50240

    02/24/2023, 3:17 PM
    First time running cypress and the tests are not retaining the location as expected. Instead, I have to run the previous commands to have them pass. Note the sample code has the lines needed to pass commented out. Am I misunderstanding something?
    Copy code
    describe("Cypress", () => {
      it("opens the app", () => {
        cy.visit("http://localhost:3000")
      })
    
      it("opens the app and clicks on a hotel", () => {
        //cy.visit("http://localhost:3000")
        cy.get("a").first().click()
        cy.location("pathname").should("include", "hotel")
      })
    
      it("navigates to the form to add a review", () => {
        //cy.visit("http://localhost:3000")
        //cy.get("a").first().click()
        cy.get("button").contains("+ Add Review").click()
        cy.location("pathname").should("include", "new")
      })
    })
    b
    l
    e
    • 4
    • 17
  • Issue with cookies and SAML (Azure AD)
    a

    acceptable-family-97943

    02/24/2023, 3:17 PM
    Hi, I'm currently trying to write a test to assert the login flow with a SAML setup. I have followed the guide on the Cypress website to deal with logging in via Microsoft, but stumbled on a different issue altogether. (guide: https://docs.cypress.io/guides/end-to-end-testing/azure-active-directory-authentication#Microsoft-AAD-Application-Setup) Our app creates a cookie, which we send along in a request after the redirect is done from Microsoft to our app again. However, this cookie is cleared and this causes our flow to fail as we cannot handle the authentication further. Our Cypress version is 10.8.0 and I've read that the option
    testIsolation
    might help with this. However, this does not work, not on global config level (legacy nor strict does anything) or on describe/suite level (the option isn't even available in the typings). Any help would be appreciated on how to deal with this 🙂
  • Cypress - auto open devtools focused on console tab
    e

    early-alligator-31669

    02/24/2023, 3:52 PM
    I would like Cypress to open Chrome devtools with the Console tab selected when executing my test suites. I have seen the approach to set the
    --auto-open-devtools-for-tabs
    flag as described [here][1] to launch devtools via cypress config, but it selects the Elements tab by default. Are there any other args that can be supplied to get the Console tab selected instead? [1]: https://docs.cypress.io/api/plugins/browser-launch-api#Open-devtools-by-default
  • cy.clock time mock instance access?
    b

    brave-doctor-62978

    02/24/2023, 6:35 PM
    for a test setup that uses cy.clock to mock the system date, is there a way to expose an instance of that library with the mocked system clock, something like...
    Copy code
    Cypress.moment = moment
    except moment would have its time mocked like the tests do?
  • Have you ever logged in to OneDrive using cypress?
    f

    faint-ocean-92094

    02/24/2023, 9:42 PM
    I hav to do a verification in OneDrive, because we have an integration for it. I can't login through the browser apparantly because they have security measures. I'm trying to create an API integration but is a long process, so I wanted to ask the community if you did something like this before and have a way. Or else I will just go and say this can´t be done hehe
  • Cypress component testing- TS not happy!
    r

    ripe-apple-15128

    02/25/2023, 1:30 AM
    I think I have the mount command setup and typed... Trying to import a React component and pass props, but I can't get TS to cooperate. Any help.advice much appreciated. TS is saying it "can't find name [name of of one of my props]."
    Copy code
    import Sparkline from "./Sparkline";
    
    describe('Sparkline', () => {
      it('Displays correct stat trend', () => {
        cy.mount(
          <Sparkline
            description="foo"
            data={[]}
            previousData={[]}
            valueFunction={()=> 2}
          />
        );
        
      });
    });
    
    export {};
    g
    • 2
    • 2
  • Can We upload test result JSON/xlsx files generated in runtime to Cypress cloud?
    r

    ripe-carpenter-12616

    02/25/2023, 5:12 AM
    I have a framework where i am storing the results in a JSON and XLSX file during the runtime . Is there a possibility to include these in cypress cloud along with screenshots and videos ?
  • Closing iFrame by relaunching
    f

    full-agent-46561

    02/25/2023, 1:07 PM
    I am testing an application where a specific page is covered by survey form sometimes. The survey is displayed in an iframe. My tests are failing as the element beneath the survey form is not clickable as it’s covered by iframe. This is happening randomly as every time survey form won’t appear. Can anyone help me how to write cypress code to check whether an element is clickable or not. If it’s not clickable then relaunch the page so that survey form disappears? Feel free to suggest anyway if you think this way won’t help in getting rid of the iFrame. Attaching the iframe path of the survey when inspected:
  • how to parallelize my tests.
    c

    cold-author-79999

    02/25/2023, 3:48 PM
    I want to run my tests in parallel so as to reduce the time for the build but i am stuck on how to implement it.The tests are dependent on each other.Let's say test 1, test 2, test 3 can execute in a suite (testsuite1) but the test 4, test 5, test 6 of testsuite2 require the testsuite1 to execute first before it.Right now the build takes 8 mins which is quite a long time. I need someone to help me out.
    g
    • 2
    • 16
  • Cypress Component Test Issues
    r

    ripe-apple-15128

    02/25/2023, 8:04 PM
    Can anyone provide a way to resolve this error when running component tests?
    Copy code
    ERROR in   Error: Child compilation failed:
      Entry module not found: Error: Can't resolve '/cypress/support/component-index  .html' in '/':
    I'm also seeing this error "Parsing error: Unexpected token" error after private/public keyword. Been trying to get component tests up and running for a while. Would really appreciate any feedback.
    w
    d
    • 3
    • 5
  • Unable to test against http://maple-syrup.localhost/
    c

    clever-teacher-79310

    02/26/2023, 12:22 AM
    Hi, I've got a docker setup running traeffic to allow multiple projects to have their own domain under localhost I'd been testing against https://pbweb-6936.maplesyrup.pbtech.store/ which as far as i can tell is also unreachable from outside our systems so i dont think its an issue with a cypress server trying to connect, i suspect it may be more the fact we're using subdomains on localhost Only other thing i think i can try is running the site using the hosts file to make it look different, but am at a loss as to why cypress hates wsl so much. Also am running cypress 12.6.0 Anyone able to shed some light on this ?
  • github actions cypress logging
    a

    adamant-printer-77643

    02/26/2023, 3:51 PM
    Hey, I would like to see all the console.log logs from my vuejs application when using the github actions runner. Any idea how to do that? I'm trying to debug a connection issue.
    Copy code
    - name: Cypress run
          uses: cypress-io/github-action@v5
          env:
            API_BASE_URL: http://127.0.0.1:1234/
          with:
            start: npm run dev
            wait-on: "http://127.0.0.1:1234/"
    • 1
    • 1
  • Having trouble with comboboxes and datepickers
    i

    incalculable-wall-61750

    02/26/2023, 4:56 PM
    Hello, I'm a newb to Cypress and I'm trying to figure out how to pick a date, say 01/01/1980, from a date picker. I am also trying to select a value from a combobox and while I can get Cypress to click the dropdown, I'm having trouble getting it to select a value. The elements are screenshotted along with the errors I'm getting. Below is the code I'm trying. For the DoB, I am trying this which does nothing: cy.get('input[name="birthDate"]').invoke('val','01/01/1980').should('eq', '01/01/1980').then((text) => { expect('01/01/1980').to.equal(text); }); For the sex selection, I am trying: cy.get('INPUT').parent('div.ui.search.selection.dropdown').click() cy.contains("Male").click() This opens the dropdown to make the selection but can't find the Male value. Thank you in advance for any help!
    g
    • 2
    • 2
  • Cypress + Playwright Error
    g

    gifted-book-25305

    02/26/2023, 10:11 PM
    Seriously
    • 1
    • 2
  • Nx and cypress
    c

    cool-businessperson-62347

    02/26/2023, 10:31 PM
    I am trying to use nx since we have a mono repo. I'm using @nrwl/cypress:cypress, but I'm trying to open up the cypress window. For the life of it I can't seem to figure out, how to pass the command "cypress open" to it. Anyone who has worked on this would love to hear from you
    b
    • 2
    • 2
  • Cypress cloud
    c

    calm-gigabyte-78371

    02/27/2023, 12:56 AM
    Hi guys, so I am trying to make my project and access it through cypress cloud, but I believe cypress is blocked internally, hence, I was wondering does anyone have the necessary links to provide to my managers to whitelist all cypress applications?
  • Component test- public/private TS keywords error
    r

    ripe-apple-15128

    02/27/2023, 1:22 AM
    When running Cypress component tests- I get the error below. I'm running cypress in a docker container (package.json and node_modules are mounted inside Cypress container). Cypress config file is copied from cypress docs. I put the foo field property in there to check and see if error was going to be thrown for anything TS related, but it seems to only be throwing an error for public/private keywords. The tests still run and succeed.
    Copy code
    ✖ 「wdm」:    1032 modules
    
    src/utilities/ReportUtilities.ts
      Line 59:10:  Parsing error: Unexpected token
      57 | export default class ReportUtilities {
      58 |   foo: number = 5;
    > 59 |   public static WORST_PERCENTILE = 90;
    
    ℹ 「wdm」: Failed to compile.
    I tried putting eslint config inside Cypress docker container. Not really sure where to go from here.
  • How to check all assertions before failing test execution ?
    b

    bumpy-insurance-8581

    02/27/2023, 2:02 PM
    Hello, I have some steps, all steps assert one value to deeply equal another one. But my problem is that if one assert fail, the next one will not be checked. And I would like to check ALL assertion before failing my test. Any idea on how to achieve this ?
    g
    • 2
    • 8
  • selectFile doesnt work for me in one test, and in another it does
    b

    brainy-answer-45873

    02/27/2023, 2:42 PM
    Hi guys, i have problem with selectFile, i am using it one test and it works okay, in another it doesnt. When i try to check cypress buffer in than in non working test it fails (expect(Cypress.Buffer.isBuffer(file)).to.be.true)
    g
    • 2
    • 1
  • How to change Webkit browser settings in Cypress?
    k

    kind-eve-72052

    02/27/2023, 4:42 PM
    Hello! In my project we need to change auto-policy and settings for all browers. Thanks to Cypress documentation we are able to change auto-policy for Chrome by using flags
    --no-user-gesture-required
    and
    --user-gesture-required
    and for Firefox by setting
    media.autoplay.blocking_policy
    and
    media.autoplay.default
    . But not sure how I am supposed to do this for Webkit/Safari. Also in one test I need to uncheck "Block all cookies" and "Prevent cross-site tracking" settings for Safari only. Is there a way to change these settings for Webkit in Cypress?
    b
    • 2
    • 1
  • Testing email invitation process
    m

    many-musician-13324

    02/27/2023, 6:18 PM
    Hello there! I'm new to Cypress, and I was wondering how could I build a e2e test with an invitation process. Put simply, I've got a logged-in user that can invite others by sending an email through the service. This email contains a link with a unique token to register as a new user. For now, I was thinking about making the backend sending the token in response to the invitation (only in non-production environment 😅 ). Is this a good approche ? Do you think there could be any security risks ? Thank you!
    g
    • 2
    • 1
  • Location null when using download verification workaround
    p

    purple-ice-75399

    02/27/2023, 7:45 PM
    Hello! Currently experiencing a very similar issue to this guy: https://github.com/cypress-io/cypress/issues/14857 However, the workaround provided (https://github.com/cypress-io/cypress/issues/14857#issuecomment-785717474) isn't working for us. We're getting the error:
    Cannot read properties of null (reading 'reload')
    Does this workaround need to be different for Cypress 11.0.1+? Or what can I do here? Thanks!
    • 1
    • 2
  • GHA Custom Docker Image - No Commit Message on Cypress Dashboard
    e

    echoing-tent-95037

    02/27/2023, 10:33 PM
    I created custom docker image to use within our GHA workflows, and I noticed the Cypress Dashboard commit messages are empty. I understand that generally that is pulled from
    .github
    location which isn't on the docker container image. How can I go about adding that commit message back to Cypress dashboard?
    a
    • 2
    • 11
  • Docker- cypress interactive mode
    r

    ripe-apple-15128

    02/28/2023, 1:37 AM
    Has anyone ran into this error after selecting testing type:
    Copy code
    Circular symlink detected: "/usr/bin/X11" points to "/usr/bin"
    X11 works and GUI appears, but when I click a testing type, cypress exits and I get the above code.
  • Unable to launch Microsoft teams app.
    w

    wonderful-zoo-99437

    02/28/2023, 6:53 AM
    I am not able to launch Microsoft teams app within the Cypress UI. I have created a Github issue regarding the same. https://github.com/cypress-io/cypress/issues/25883 Here is the code snippet : **describe('Microsoft Teams automation', () => { it('Logs in and navigates to a channel', () => { cy.visit('https://teams.microsoft.com/%27); cy.get('input[type=email]').type('your-email-address'); cy.get('input[type=password]').type('your-password'); cy.get('button[type=submit]').click(); }); });** Attached screenshot for reference. Kindly help me to proceed further.
    e
    • 2
    • 6
  • spy on vue instance method
    w

    witty-magazine-45881

    02/28/2023, 7:14 AM
    Im trying to spy on vue instance method via cy.mount(MyComponent) .then(w => { cy.spy(w.vm, 'myMethod').as('myMethodSpy) }) But im getting an a TypeError "Cannot read properties of undefined (reading 'value')". Is there any way to spy on vue method inside my test ?
  • how to check if text is cleared
    s

    swift-kitchen-62493

    02/28/2023, 10:15 AM
    cypress how to check if text is cleared... if button did its work
    g
    • 2
    • 1
  • checkboxes sometimes not get checked or unchecked
    b

    brash-tiger-52405

    02/28/2023, 10:34 AM
    In various of test, i test checkboxes whether they are checkable or uncheckable. Sometimes the test fails, because the checkbox is not checked after checking or otherwise.
1...101112...26Latest