https://cypress.io logo
Join Discord
Powered by
# help
  • m

    magnificent-finland-58048

    04/15/2022, 2:36 PM
    It doesn't have anything to do with Cypress. You can prove this by looking at the Network tab of Chrome dev tools, the runner just shows the network traffic it is seeing there. The app is just chatty and stuff is still going on. I used to have a chatty app that hit the Auth endpoint on anything. Sometimes if too many tests ran, we'd get 429s... We had to stub out all that chatty behavior.
  • m

    magnificent-finland-58048

    04/15/2022, 2:39 PM
    you can double check with Chai assertions, but my advice is completely different There are a few advices I would like to share, and I will leave this here for all that needs to be known on the matter... https://dev.to/muratkeremozcan/crud-api-testing-a-deployed-service-with-cypress-using-cy-api-spok-cypress-data-session-cypress-each-4mlg
  • f

    flaky-airport-12178

    04/15/2022, 3:28 PM
    Hi Team, Please help me on this one
  • f

    fast-teacher-87788

    04/15/2022, 3:54 PM
    figured out my issue. even if a fixture uses the "binary" type, the result is still a byte string, so passing that as a response body encodes it as a string. You have to parse the byte string back into a byte array and pass the buffer as the response body so that it will come back as proper binary data.
  • f

    fast-teacher-87788

    04/15/2022, 4:07 PM
    Copy code
    javascript
    cy.fixture("ui_testing.wav", "binary").then((audio) => {
        var buffer = Uint8Array.from(audio, c => c.charCodeAt(0));
        cy.intercept(
            { method: "GET", hostname: "localhost", path: "/ui_testing.wav" },
            {
                headers: { "Content-Type": "application/octet-stream" },
                body: buffer.buffer,
            }
        ).as("audio_sample")
    })
  • f

    fast-teacher-87788

    04/15/2022, 4:08 PM
    This is what my working audio file fixture looks like now
  • f

    fresh-doctor-14925

    04/16/2022, 8:51 AM
    Though Aleksandar does raise a valid point around what is to be expected of Cypress between scenarios I’ve encountered failures in the second scenario because of signing in with a different user in the
    beforeEach()
    . Meanwhile the app is still chatting away and we get an uncaught exception due to our authentication broker returning a 403 Given that the conventional wisdom is that each scenario exists in its own context, I can see how this causes confusion
  • m

    magnificent-finland-58048

    04/16/2022, 12:46 PM
    shadow dom is a vague concept, esp. without a repo we can reproduce the issue with
  • m

    magnificent-finland-58048

    04/16/2022, 12:53 PM
    try it out, you might be surprised if it doesn't work for you, @gray-kilobyte-89541 came up with cy.CDP https://glebbahmutov.com/blog/when-can-the-test-click/
  • n

    numerous-secretary-63087

    04/16/2022, 5:49 PM
    Hey guys! I am fairly new to Cypress and am struggling with such a simple task. All I want to do is confirm that specific text is not visible on the page. In Codeception I would use
    dontSee()
    but I can't figure out how to do this in Cypress. ><
  • f

    fresh-doctor-14925

    04/16/2022, 6:09 PM
    👋 hi Michelle, you’ll need to make an assertion with
    .should()
    It’ll be something like
    cy.get(“#element”).should(“not.contain”, specificText)
    https://docs.cypress.io/api/commands/should (Though I suggest making assertions on test ids rather than text content, if you can)
  • n

    numerous-secretary-63087

    04/16/2022, 6:10 PM
    I have been playing around with that but the problem is the element isn't visible so I can't get it to check the text as it doesn't exist.
  • f

    fresh-doctor-14925

    04/16/2022, 6:16 PM
    Oh! I understand. Well you can assert that with
    .should(“not.be.visible”)
    If that’s chained to your
    get()
    you can then chain another assertion for the text like my example above. So:
    cy.get(“#element”).should(“not.be.visible”).and(“not.contain”, specificText)
  • a

    aloof-house-17015

    04/16/2022, 6:37 PM
    Hey Can someone tell me the name of the extension Gleb is using in a lot of his videos: I think it´s some kind of intellisense or autocomplete extension. I tried to mark it with an arrow in the picture Thanks for your help
  • n

    numerous-secretary-63087

    04/16/2022, 8:43 PM
    Ah, I was able to get it working with this. Tyvm! 😄
  • p

    purple-action-61464

    04/17/2022, 1:26 AM
    Did anyone get a cookies not found page when log in?
  • g

    gray-kilobyte-89541

    04/17/2022, 1:56 PM
    Gleb (aka me) is using GitHub Copilot for that. If only I could train it using only my tests, I would be unstoppable
  • b

    bright-monitor-4080

    04/18/2022, 5:53 PM
    I run cypress in a CI/CD pipeline on a docker image. When I tried to run a cypress container today I get a permission denied message. I can download other dockerhub containers, I am logged into dockerhub, but Cypress containers do not pull. Have the containers been made private? Tried to pull cypress/included:9.5.4.
  • a

    aloof-house-17015

    04/19/2022, 10:21 AM
    Thanks a lot😁
  • c

    creamy-coat-62912

    04/19/2022, 12:35 PM
    Hello there! Is there any Cypress supported way how to wait for / intercept messages from EventStream? Thanks a lot in advance for any help.
  • c

    curved-intern-4253

    04/20/2022, 3:38 PM
    Hi! I am trying to run tests in a project using Cypress, but run into a problem. I am under WSL2, so followed https://docs.cypress.io/guides/getting-started/installing-cypress#Windows-Subsystem-for-Linux. But
    yarn run cypress open
    ,
    yarn cypress open
    , and
    npx cypress open
    all result in
    Copy code
    It looks like this is your first time using Cypress: 9.5.4
    
    
    Cypress verification failed.
    
    This command failed with the following output:
    
    /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=564
    
    ----------
    
    Platform: linux-x64 (Ubuntu - 20.04)
    Cypress Version: 9.5.4
    error Command failed with exit code 1.
    The weird part is that if I run the command given, its exit code is 0:
    Copy code
    alexey@DESKTOP-41AVESA:~/shaka/popmenu$ /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=564
    alexey@DESKTOP-41AVESA:~/shaka/popmenu$ echo $?
    0
    Using
    cypress run
    instead of
    open
    makes no difference;
    cypress info
    looks fine to me:
    Copy code
    $ /home/alexey/shaka/popmenu/node_modules/.bin/cypress info
    
    Proxy Settings: none detected
    Environment Variables: none detected
    
    Application Data: /home/alexey/.config/cypress/cy/development
    Browser Profiles: /home/alexey/.config/cypress/cy/development/browsers
    Binary Caches: /home/alexey/.cache/Cypress
    
    Cypress Version: 9.5.4 (stable)
    System Platform: linux (Ubuntu - 20.04)
    System Memory: 6.23 GB free 5.7 GB
    Done in 0.23s.
    What could be the problem?
  • c

    curved-intern-4253

    04/20/2022, 3:44 PM
    Reading more, it failed to detect a browser, but
    --browser /usr/bin/google-chrome
    doesn't help.
  • c

    curved-intern-4253

    04/20/2022, 6:05 PM
    After finding
    DEBUG=cypress:*
    , it looked like the problem was incorrect
    $DISPLAY
    . But now I got other GUI apps to run in WSL, cypress still fails:
    Copy code
    alexey@DESKTOP-41AVESA:~/shaka/popmenu$ DEBUG=cypress:* npx cypress verify
      cypress:cli:cli cli starts with arguments ["/home/alexey/.nvm/versions/node/v14.19.1/bin/node","/home/alexey/shaka/popmenu/node_modules/.bin/cypress","verify"] +0ms
      cypress:cli NODE_OPTIONS is not set +0ms
      cypress:cli:cli program parsing arguments +1ms
      cypress:cli parsed cli options {} +1ms
      cypress:cli verifying Cypress app +0ms
      cypress:cli checking environment variables +0ms
      cypress:cli checking if executable exists /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress +2ms
      cypress:cli Binary is executable? : true +2ms
      cypress:cli binaryDir is  /home/alexey/.cache/Cypress/9.5.4/Cypress +1ms
      cypress:cli Reading binary package.json from: /home/alexey/.cache/Cypress/9.5.4/Cypress/resources/app/package.json +0ms
      cypress:cli Found binary version 9.5.4 installed in: /home/alexey/.cache/Cypress/9.5.4/Cypress +2ms
      cypress:cli could not read binary_state.json file at "/home/alexey/.cache/Cypress/9.5.4/binary_state.json" +3ms
      cypress:cli {} +0ms
      cypress:cli is Verified ? undefined +1ms
      cypress:cli force verify +0ms
      cypress:cli running binary verification check 9.5.4 +0ms
  • c

    curved-intern-4253

    04/20/2022, 6:05 PM
    Copy code
    cypress:cli clearing out the verified version +3ms
      cypress:cli DISPLAY environment variable is set to 172.17.176.1:0 on Linux
      cypress:cli Assuming this DISPLAY points at working X11 server,
      cypress:cli Cypress will not spawn own Xvfb
      cypress:cli
      cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
      cypress:cli   see https://github.com/cypress-io/cypress/issues/4034
      cypress:cli Solution: Unset the DISPLAY variable and try again:
      cypress:cli   DISPLAY= npx cypress run ... +0ms
      cypress:cli needs Xvfb? false +1ms
      cypress:cli spawning, should retry on display problem? true +0ms
      cypress:cli disabling Electron sandbox +0ms
      cypress:cli running smoke test +0ms
      cypress:cli using Cypress executable /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress +0ms
      cypress:cli smoke test command: /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217 +0ms
      cypress:cli smoke test timeout 30000 ms +0ms
      cypress:cli smoke test stdout "" +8ms
      cypress:cli Smoke test failed because could not find 217 in: {
      command: '/home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217',
      exitCode: 0,
      stdout: '',
      stderr: '',
      all: undefined,
      failed: false,
      timedOut: false,
      isCanceled: false,
      killed: false
    
    Cypress verification failed.
    
    This command failed with the following output:
    
    /home/alexey/.cache/Cypress/9.5.4/Cypress/Cypress --no-sandbox --smoke-test --ping=217
    
    ----------
    
    Platform: linux-x64 (Ubuntu - 20.04)
    Cypress Version: 9.5.4
  • u

    user

    04/22/2022, 7:49 AM
    I am trying to start yarn for the project https://www.cypress.io/blog/2022/03/28/real-world-testing-with-cypress/ Getting below error - can anyone help here yarn run v1.22.18 error Couldn't find a package.json file in "C:\\Users\\Akshay Kumar\\Desktop\\cypress-realworld-testing-todomvc-master" info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  • g

    gentle-oxygen-2271

    04/22/2022, 8:37 AM
    Hi! I'm using cypress-grep by @gray-kilobyte-89541 in github actions to run tests tagged as 'flaky' in a separate job, but I'm facing issues when there are no tests with the tag. It leaves all the tests untouched to skip on the go, but the runner exits with error code SIGILL. I'm wondering if there is a way to just get a list of the tests that have the tag and if that list is empty I could skip the whole job 🤔 Does anyone have experience with this?
  • g

    gray-kilobyte-89541

    04/22/2022, 11:34 AM
    Use https://github.com/bahmutov/find-cypress-specs#test-names-filtered-by-a-tag
  • g

    gentle-oxygen-2271

    04/22/2022, 11:40 AM
    Oh great, thank you! I will take a look into that 🙂
  • c

    colossal-car-14055

    04/22/2022, 7:10 PM
    Hey everyone! I am looking for any recommendations or examples for waiting on fonts to render before performing captures with Percy?
  • g

    gray-kilobyte-89541

    04/23/2022, 12:31 PM
    Ughh, that was tough, but I finally have figured it out. It requires CDP via cypress automation commands or https://github.com/bahmutov/cypress-cdp I will put my solution as a bonus lesson in https://cypress.tips/courses since it took some effort
1...565758...252Latest