https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • l

    lively-balloon-98986

    01/08/2023, 8:37 AM
    did anyone has same issue like this?
  • l

    lively-balloon-98986

    01/08/2023, 8:49 AM
    how can i clear element inside editor element? also -
  • p

    powerful-orange-86819

    01/08/2023, 9:42 AM
    cy.wait('@reponseFromBackend').its('response.statusCode').should('eq',200) and also move the interceptor before the action (click)
  • p

    powerful-orange-86819

    01/08/2023, 9:43 AM
    remove the wait(3000) and add .should('exist') after cy.get('button[data-test="register-button"]'), try to benefit as much as possible from the retryability and use 'wait' as least as possible. Also add the url to your domain inside the cypress.config.js file under e2e.baseUrl then just use cy.visit('/'). Make sure your login is not in an iframe. If it is write a custom command to generate a token to use in the tests
  • m

    modern-dawn-86006

    01/08/2023, 3:35 PM
    Debug it by running one command at a time. Comment out the lines and remove the comment 1 by 1.
  • m

    modern-dawn-86006

    01/08/2023, 3:40 PM
    I visited the website, onetrust-accept-btn-handler doesn't exist on the website
  • c

    clever-salesmen-46486

    01/08/2023, 8:25 PM
    Does anyone know how to detect the current system's theme (dark/light) in a cypress test?
  • g

    gray-kilobyte-89541

    01/08/2023, 8:31 PM
    I think it depends on the implementation, I remember looking at this a long time ago, you can find my blog posts about it by searching https://cypress.tips/search
  • m

    mysterious-psychiatrist-29678

    01/08/2023, 8:33 PM
    will it solve the issue? I mean moving the interceptor above that's clear but checking the status code doesn't make the script start intercepting earlier, does it?
  • m

    mysterious-psychiatrist-29678

    01/08/2023, 8:38 PM
    I'm having another similar issue but the way around. I want to assert label field on the next page after clicking 'next'. but what happens is the script clicks then immediately checks label and found one but the assertion fails. however the flow remains the same page that's why the assertion fails. I can image that the script doesn't click or assertion is way faster than needed. It occurs around 1-2 times of out 10. what would you suggest to fix? how should I make sure that the next page is fully loaded?
  • c

    clever-salesmen-46486

    01/08/2023, 8:40 PM
    Any advice for implementing this on TS? I'm getting a bunch of errors
    Copy code
    on('before:browser:launch', (browser = {}, args) => {
        console.log('browser', browser)
    
        if (browser.family === 'chrome') {
          console.log('adding dark mode browser flags')
          args.push('--force-dark-mode=true')
    
          return args
        }
      })
  • p

    powerful-orange-86819

    01/08/2023, 10:22 PM
    add .should('exist') after the get/find for the retryabiliity to kick in
  • m

    mysterious-psychiatrist-29678

    01/08/2023, 10:29 PM
    tried and the same happens. still waits for the response that never comes
  • m

    mysterious-psychiatrist-29678

    01/08/2023, 11:45 PM
    what does should('exist') add in addition to a simple contains('element', 'text') or get('element')? could you explain it a bit more, please? I've added what you suggested.
    Copy code
    cy.get('label')
        .should('exist')
        .and('contain.text', 'Email address')
        .and('be.visible')
  • b

    billions-king-35651

    01/09/2023, 6:56 AM
    Hello everyone, Trust your day is going on well. Please, I need your help. I'm trying to integrate code coverage into my cypress test. I have installed @cypress/code-coverage and nyc but it seems I don't know how to connect both of them to work properly. If I run cypress open, I am getting a prompt that says:
    Copy code
    log⚠️ Code coverage tasks were not registered by the plugins file. See support issue for possible workarounds. [@cypress/code-coverage]
    If I run nyc cypress open, the tests are not even running. I am using NextJs. Any help to get the code coverage to work will be appreciated. Thanks
  • l

    lemon-oxygen-25956

    01/09/2023, 7:38 AM
    The company I work for developed a tool based on Cypress that runs (in headed mode) e2e testing workflows defined in Excel files. This tool uses only one generic spec file. When the Excel file is updated, Cypress reloads and opens its entry screen where the spec files list contains only that spec file. At this point, the tester needs to double-click that spec file to run it. How can we avoid the need of double-clicking that spec file in order to run it? (we would like to have Cypress running that only spec file automatically as soon as it restarts) Thanks.
  • l

    lively-match-61863

    01/09/2023, 8:42 AM
    Hello, how can I solve this
  • c

    clean-processor-42509

    01/09/2023, 8:58 AM
    How to run cypress tests in parallel without a dashboard locally and CI (Bamboo)?
  • c

    colossal-table-38461

    01/09/2023, 9:00 AM

    https://www.youtube.com/watch?v=saYovXS9Llk▾

  • c

    colossal-table-38461

    01/09/2023, 9:03 AM
    Hello All, Can we test the color of Button using Cypress?
  • c

    clean-processor-42509

    01/09/2023, 9:10 AM
    cy.get(viewDetails.changePasswordButton).should('be.visible') .and('have.css', 'background-color', 'rgb(255, 231, 30)')
  • c

    clean-processor-42509

    01/09/2023, 9:11 AM
    Does it talk about the parallel execution?
  • c

    colossal-table-38461

    01/09/2023, 9:11 AM
    Yes
  • s

    straight-microphone-66008

    01/09/2023, 12:23 PM
    hey guys, does anyone of you know why e2e tests on chrome with browsers mode pass, but on headless mode on chrome they fail due to timeout? Is it a version issue or should I add any configuration rule on the cypress.config file? I am using version 12.2.0.
  • g

    gray-kilobyte-89541

    01/09/2023, 3:26 PM
    // @ts-ignore
  • n

    nice-lifeguard-81070

    01/09/2023, 3:59 PM
    hey all I get the 404 error when I run Cypress in github. in package. json I have this code.
    Copy code
    {
      "private": true,
      "scripts": {
        "build": "nuxt build",
        "dev": "nuxt dev",
        "generate": "nuxt generate",
        "preview": "nuxt build && nuxt preview"
      },
    and In YML file
    Copy code
    steps:
          - name: Checkout the code
            uses: actions/checkout@v3
    
          - name: install npm
            run: npm ci
    
          - name: Cypress run
            uses: cypress-io/github-action@v5
            with:
              start: npm run dev
              wait-on: 'http://localhost:3000'
              wait-on-timeout: 120
              browser: chrome
    
          - name: Upload coverage to Codecov
            uses: codecov/codecov-action@v1
            with:
              token: ${{ secrets.CODECOV_TOKEN }}
              directory: ./coverage
              fail_ci_if_error: true
              verbose: true
    If instead of using npm run dev, I run npm run preview, it works fine and Cypress runs successfully, but it does not generate a code coverage report. A code coverage report can only be generated when I use npm run dev, but it gives a 404 error.
  • d

    dazzling-crowd-57204

    01/09/2023, 4:23 PM
    Hi any ideas on cypress v10 why clearCookies is timing out I increased the limit to 70000 but it still isn’t working?
  • m

    mysterious-psychiatrist-29678

    01/09/2023, 4:39 PM
    I have similar issue, and really really need help. Having visit() and intercept() in the beforEach hook I expect the script to open the link again and againg at the beginning of a new spec. but I believe it just doesn't either try to open therefore waiting for intercepted response fails every time. Interestingly it does only locally (doesn't matter if it's native headless run or in docker) but passes on Github actions. locally every spec (after the first) fails however on CI every passes. Why? The same code, same behavior it must be. on the picture you can see that one scenario has finished and instead of reopening the link it just remains on the old page where intercepted response won't come at all and when timed out it fails. I use cypress v12 and Electron here is the beforeEach hook
    Copy code
    Cypress.Commands.add('visitCustomDeployment', (deploymentLink) => {
      cy.intercept({
        url: 'https://management.azure.com/batch?api-version=2020-06-01',
          headers: {
            'x-ms-command-name': '{ Microsoft_Azure_CreateUIDef.Batch:0,Services.ArmLocations.getLocForSub:1}'
          }
        })
        .as('reponseFromBackend')
      cy.visit(deploymentLink)
      cy.wait('@reponseFromBackend', {timeout: 60000})
    })
    ---------------------
            before(() => {
                cy.loginOnUI(Cypress.env('username'), Cypress.env('password'))
            })
    
            beforeEach(() => {
                cy.visitCustomDeployment(Cypress.env('customDeploymentLink'))
            })
  • m

    modern-dawn-86006

    01/09/2023, 8:15 PM
    i found this when running this https://docs.cypress.io/guides/references/error-messages#Cypress-detected-that-an-uncaught-error-was-thrown-from-a-cross-origin-script https://docs.cypress.io/guides/references/error-messages#Uncaught-exceptions-from-your-application So, basically the website is not loading correctly or fully. In order to skip this error, just add this piece of code in your command.js file Cypress.on('uncaught:exception', (err, runnable) => { return false })
  • m

    modern-dawn-86006

    01/09/2023, 8:21 PM
    @cool-planet-811 https://discord.com/channels/755913899261296641/755913900024791046/1061670705198022718
1...182183184...192Latest