https://cypress.io logo
Join Discord
Powered by
# i-need-help
  • checkboxes sometimes not get checked or unchecked
    b

    brash-tiger-52405

    02/28/2023, 10:35 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.
    r
    • 2
    • 3
  • cy.task('sqlServer:execute') failed with the following error: > Failed to connect to
    a

    adamant-beard-17074

    02/28/2023, 1:07 PM
    Bom dia pessoal, tudo bem? Estou tendo problema para fazer a conexão com o SQL Server, teriam como me ajudar? Segue minhas configurações: package.json image 1 cypress.config.js image 2 support/e2e.js image 3 cy.js image 4 Erro image 5
    c
    g
    • 3
    • 3
  • Selecting Cypress for Functional Testing
    c

    chilly-secretary-34320

    02/28/2023, 2:20 PM
    Hi, I am evaluating Cypress as an alternate to Selenium, or Playwright. Most examples i see use Cypress as a Testing framework for testing a local application, and not something similar to Selenium, where all URLs are in a remote domain. Is Cypress meant to be a replacement for Selenium, or is only to be used as an Integration Testing Framework, where the target application must be available locally, and Cypress Tests The ( let's say ) React Internals, and not much suited for Functional Testing of WebApplication or WebSites?
    w
    • 2
    • 1
  • Integration of Cypress tests into Zephyr Scale
    i

    icy-zoo-67885

    02/28/2023, 2:55 PM
    Hey, I am trying to integrate my tests into my company's Zephyr Scale, but i cannot really do it. I created a StackOverflow issue about it: https://stackoverflow.com/questions/75593006/how-to-connect-cypress-to-zephyr-scale
  • How to retrieve browser console logs in Webkit/Safari?
    k

    kind-eve-72052

    02/28/2023, 4:30 PM
    Hello! In my project we need to retrieve and store browser console logs while the test is running to later assert if a certain log is present in the test. Currently for Chrome and Firefox we are using
    --remote-debugging-port
    flag and
    chrome-remote-interface
    library to retrieve and store these logs. Is something like this possible to do for Webkit/Safari or any other way to do it in Cypress?
  • CI requirements
    s

    stocky-salesclerk-42224

    02/28/2023, 5:16 PM
    We are looking for a Selenium replacement and have started using Cypress. And we faced with the fact that the tests are extremely unstable on Azure. We use the default agents on Ubuntu with 2 cores and 7 GB of RAM. Is this enough? What advice can you give to keep the tests stable?
    b
    e
    +2
    • 5
    • 11
  • Couldn't get Button Hover State Snapshot. Please help.
    s

    shy-accountant-52090

    02/28/2023, 5:26 PM
    Hi All, I'm failing to get a snapshot of Button- hover state. I'm using realHover and cypress-plugin-snapshot to acheive this. Can anyone please share me your thoughts. Thanks.
    e
    • 2
    • 1
  • Cy.session is not storing local storage when the session is created
    w

    wonderful-carpenter-84941

    02/28/2023, 6:24 PM
    I'm using cy.session to log in with API. When the session is created, I can see that LocalStorage was saved. However, LocalStoreage is empty for the 1st test where cypress uses the "created" session and LocalStorage is not empty for all the other test where cypress uses the "restored" session. any Idea LocalStorage is empty for the 1st test where the session is created in beforeEach hook?
  • Desperately Trying to get component tests running- TS access modifiers (i.e. public and private
    r

    ripe-apple-15128

    02/28/2023, 8:00 PM
    component tests are running and passing, but I'm getting the following error:
    Copy code
    ℹ 「wdm」: Failed to compile.
    ✖ 「wdm」:    1031 modules
    
    ERROR in 
    src/components/Sparkline.tsx
      Line 46:11:  Parsing error: Unexpected token
    
      44 |
      45 | class Sparkline extends React.Component<Props, State> {
    > 46 |   private static TREAT_NULLS_AS_ZERO = false;
    `
    • 1
    • 3
  • API requests with nextjs-auth0
    r

    rhythmic-lizard-86607

    02/28/2023, 8:09 PM
    We are using nextjs-auth0 and cypress-nextjs-auth0 libraries for Login. Since Authentication happens on the server-side in nextjs we are not able to get Access Token and make any API requests. Anyone seen this issue?
  • How can I handle errors like this?
    a

    aloof-minister-26761

    02/28/2023, 9:36 PM
    I get this warning when the passwords don't match. I can't find any selecotr in DOM?
    e
    g
    • 3
    • 5
  • help with AWS Cognito
    s

    square-gigabyte-37939

    03/01/2023, 4:37 AM
    Hi everyone! I’m experiencing issue with AWS Cognito. There’s plenty of examples, but seems like none works, it’s either outdated or it’s not worded properly. I’m trying to get idToken from cognito. I could log in through front end and access local storage, but while point is not to do it. Does anyone have a working solution, and could provide a guide that they used? Thank you
  • one file and log in a same website with two account?
    l

    little-translator-68537

    03/01/2023, 2:24 PM
    My testing line starts from creating a new client account > login as a new client and create a new project > client logout > create a new employee account > login as a new employee and edit personal information > employee logout > client login > add this employee into the project In my imagination, when running a cypress file, it will be like a user open a new browser, so the tokens will be shared. Therefore, the only way to switch identities is to frequently log in and log out. And one cy.description will open a new browser, so my question is: Is it possible to run a cypress file but log in with two different accounts?
    e
    m
    • 3
    • 7
  • Are there any reports of high disk usage?
    c

    chilly-vase-64353

    03/01/2023, 5:09 PM
    Hi everyone, fairly new to actually using Cypress and very pleased so far. It's just that recently started running out of disk space in my computer and this started happening when I began running my e2e tests. Does anyone have a pointer to what I could look for? Logs I can erase maybe? Anything would be appreciated.
  • Cypress click problem
    s

    stocky-salesclerk-42224

    03/01/2023, 7:47 PM
    I need to click on an element and see a popup 1) In Open mode, the test failed, but if I click manually on the browser before doing the click by Cypress, the test popup appears. I tried setting the focus to the panel, nothing helped, but if I run in Run mode the test passes on Electron 2) In Chrome, the test always fails. Any ideals how I can handle it? In general Cypress make click but popup does not appear
    m
    w
    • 3
    • 4
  • Unknown file extension ".ts" even when node_modules at root contains typescript
    r

    ripe-apple-15128

    03/02/2023, 1:18 AM
    Using cypress/included:12.1.0 image. I have a volume mount for node_modules that contains typescript and yet I still get this error
    Copy code
    Your configFile is invalid: /cypress.config.ts
    It threw an error when required, check the stack trace below:
    TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /cypress.config.ts
    l
    • 2
    • 5
  • Get value property from a list of elements
    m

    magnificent-lamp-44201

    03/02/2023, 2:35 AM
    I attempted to get the
    value
    property from a list of input elements, but I just only get the first value. I tried something like this, to get all the values:
    Copy code
    typescript
    cy.get('table tbody tr td:nth-child(2) input')invoke('prop', 'value').each(($el) => actualResult.push($el));
    but I'm getting an error since it's not possible to chain the
    invoke()
    and
    each()
    commands together. Is there a way to get the values for my list of elements? And other question that comes to me, related to this: How can I get the values for the other existing properties of my list of elements? Thanks in advance for your answers!
    g
    • 2
    • 6
  • [Cypress/grep] does not filter spec with unmatched tags
    b

    broad-ram-1055

    03/02/2023, 8:07 AM
    Context - I have written mocha tests at UI and API layer - All test and
    describe()
    have tags - I'm using
    cypress/grep
    plugin to enable to tagging mechanism - Config is correct and can run cases linked with specific tags Concern - This plugin parses though all the spec files at runtime to find the tags and consumes execution time. Solution - This plugin has a filtering mechanism using
    grepFilterSpecs
    parameter so it'll only run those spec files where the tag will match and not all the spec files Issue - I have done all the config required for this and still it runs all the spec file instead of just couple of them where the tag exist. - Can see message on console as
    Could not determine test names in file: ${filePath}
    Versions -
    "@cypress/grep": "^3.1.4",
    -
    "cypress": "^10.11.0",
    Adding Code reference in the thread
    • 1
    • 2
  • Run cypress tests in Gitlab with parallel
    m

    most-airline-43297

    03/02/2023, 6:02 PM
    I would like to run my tests from Gitlab in the Cypress cloud dashboard in parallel. When I use the command in my gitlab ci file:
    Copy code
    npx cypress run --record --key <some key> --parallel --headless
    I expected that Cypress will run the tests in parallel across multiple machines, when I verify in the dashboard if it ran on multiple machines, it just states that it ran on 1 machine, and the speed could be improvement by adding more machines. For this PoC it just has 4 tests. Apparently I am doing something wrong, but I am not entirely sure what. - What am I missing? - How I can distribute the tests over multiple machines to speed up the execution? Because there are multiple runners available in our Gitlab instance. Thanks in advance! Gitlab file
    Copy code
    variables:
      npm_config_cache: "$CI_PROJECT_DIR/.npm"
      CYPRESS_CACHE_FOLDER: "$CI_PROJECT_DIR/cache/Cypress"
    
    cache:
      key: ${CI_COMMIT_REF_SLUG}
      paths:
        - .npm
        - cache/Cypress
        - node_modules
    
    build_cypress:
      image: <cypress image in container registry>
      <<: *cypress_rules
      stage: prepare
      script:
        - cd legacy/e2e
        - npm ci
        - npx cypress cache path
        - npx cypress cache list
    
    run_cypress_folder_1:
      image: <cypress image in container registry>
      <<: *cypress_rules
      stage: test
      parallel: 5
      script:
        - cd legacy/e2e
        - npm install cypress
        - npx cypress run --record --key <SOMEKEY> --parallel --headless
      artifacts:
        when: always
        paths:
          # the path here is needed to expose the file and be able to send it to Datadog.
          - $CI_PROJECT_DIR/legacy/e2e/cypress/results/**/*.xml
    https://docs.cypress.io/guides/guides/parallelization https://docs.cypress.io/guides/continuous-integration/gitlab-ci
    e
    g
    • 3
    • 6
  • Okta Authentication Code Flow
    b

    busy-tailor-13324

    03/02/2023, 6:17 PM
    I am trying to get the Cypress Real World App running using an Okta OIDC (authentication code flow) and am having no luck using either okta_programmatic_login code path or the default. Is there someone that might be able to help me with this?
  • How to add `@cypress/code-coverage` to my Typescript Cypress project
    k

    kind-eve-72052

    03/02/2023, 7:00 PM
    Hello! In my Typescript Cypress project where we test client SDK functions we are trying to add
    @cypress/code-coverage
    library to retrieve current code coverage for these tests. I was able to successfully add
    @cypress/code-coverage
    library, but was getting an error shown in the screenshot. After digging deeper into
    @cypress/code-coverage
    readme noticed this error could be shown if there is NO frontend code coverage, is this the case in my situation or do I need to add some extra libraries? Also tried to set
    expectBackendCoverageOnly: true
    to get rid of the error, but not sure what I am supposed to set as my url in this case is there extra code needed on clients side of the code?
  • Okta Authorization Code Flow
    b

    busy-tailor-13324

    03/02/2023, 8:36 PM
    I am trying to get the Cypress Real World App running using an Okta OIDC (authorization code flow) and am having no luck using either okta_programmatic_login code path or the default. Is there someone that might be able to help me with this?
  • how can I find an object in an api response if I just know the value of a key?
    e

    echoing-tent-95037

    03/02/2023, 11:13 PM
    Not sure I fully understand the question, but you can use
    cy.intercept
    followed with
    .then(resp)
    to gather the response values from the
    resp
    n
    • 2
    • 2
  • Hi, Just a simple question :)
    b

    busy-soccer-31234

    03/02/2023, 8:46 PM
    How can I stay on the same WEB page in different tests. it('test_one', () => { cy.visit('www.google.com'); window.localStorage.setItem('test_one', 'test'); }) it('test_two', () => { //How can this second test of mine start already on the google page and with the things //I saved in the previous test in local storage? })
    a
    e
    • 3
    • 9
  • Cy.session restored not working in GitLab CI but works very well in local
    w

    wonderful-carpenter-84941

    03/02/2023, 9:02 PM
    I'm using cy.session for login and once the session is restored, I'm not logged in. I have tried both chrome and the electron browser in gitlab ci and magically it only worked once. But I don't see any issue with this in my local. here is my login logic
    Copy code
    Cypress.Commands.add('loginWithSession', () => {
      cy.session('loginWithSession', () =>{
        cy.loginWithWeb();
      },{
        cacheAcrossSpecs: true,
      });
      cy.visit('/');
    });
    g
    w
    • 3
    • 7
  • In cypress its possible add action after click submit form button? If yes, how?
    b

    busy-soccer-31234

    03/02/2023, 9:34 PM
    fields in the form and after click submit execute action?
    g
    • 2
    • 10
  • Puppeteer with Cypress
    e

    echoing-tent-95037

    03/02/2023, 11:12 PM
    I am stuck on getting a chrome extension to work within Cypress. I can get the extension to load but Cypress can not interact with it. I know puppeteer can be used alongside Cypress, and was wondering if anyone knows of where some good documentation might be for that?Im having a hard time find anything useful.
  • Verify data outside of browser
    l

    loud-telephone-11500

    03/03/2023, 6:37 AM
    How to verify a file (excel sheet) that is downloaded from browser and stored in a local sorce file in cypress
    m
    • 2
    • 1
  • Execute a test for each fetched data from API
    b

    brash-plumber-51185

    03/03/2023, 10:21 AM
    What I'm trying to do is first and foremost fetching data from an API - transforming the data into an array - later to loop through each item in the array and create a test for each item. It's a basic setup:
    Copy code
    js
    describe("fetch data and create tests", () => {
      const fetchData = async () => {
        const res = fetch(myUrl)
        const data = res.json()
    
        // map to array
    
        return data
      }
    
      fetchData().then(data => 
        it(`Test ${data}`, () => {
          // expect something
        })
      )}
    })
    The issue is that the tests never runs. I've tried moving the fetching logic inside
    before
    with no luck. I'm really out of options here. How do I accomplish this?
    g
    • 2
    • 11
  • Login with Azure AD
    q

    quick-city-89997

    03/03/2023, 2:23 PM
    Hey, is it possible to login once for all tests? Seems like cypress is removing the cookies after a test finishes, so currently I login within
    beforeEach
    but it's taking so long... Want to avoid the msal.js. Any other thoughts about this?
    c
    • 2
    • 2
1...111213...26Latest