https://cypress.io logo
Join Discord
Powered by
# general-chat
  • a

    adventurous-dream-20049

    04/19/2022, 5:12 PM
    Can you provide step-by-step you installation process including the exact commands used for installation and open?
  • n

    nice-machine-16386

    04/19/2022, 6:17 PM
    OK I've read https://docs.cypress.io/guides/core-concepts/retry-ability#What-you-ll-learn many times and I'm still trying to understand. Is there any functional difference between these 3 lines? Won't they all poll until the statement is true or defaultTimeout is reached? 1.
    cy.get('#element').contains('my text')
    2.
    cy.contains('#element', 'my text')
    3.
    cy.get('#element').should('contain.text', 'my text')
  • n

    nice-machine-16386

    04/19/2022, 6:21 PM
    How are you trying to run cypress? Just
    cypress open
    ? I'm on mac but run it like this
    ./node_modules/cypress/bin/cypress open
    .
  • q

    quick-pizza-16489

    04/19/2022, 7:17 PM
    Ah, I see. Thanks!
  • h

    hallowed-doctor-10352

    04/20/2022, 12:08 PM
    The CTO has decided to move our web app to React. So the devs are rewriting everything. We are a small startup and do manual tests for everything. I have been given the task to sit with the devs and soon as they complete any module/page of the app I start writing an automation test script. I assume I have been asked to make the test framework. My Manager cant help with it, has only done manual testing, and the devs have been told to help me. I have previously automated some sections using cypress & JS on my own that's my only experience in automation I want to know if I am in trouble.?? I cant write automation for everything someone here said last time too you don't go 100% automation. Please can someone help me? How should I start with this? Am I supposed to automate everything? What are the key aspects of making a framework? ( any resource will also help) What question do I need to ask my CTO before starting working on this, again would I be even able to do it?
  • g

    gray-kilobyte-89541

    04/20/2022, 12:58 PM
    Here is what I recommend you do: https://slides.com/bahmutov/testing-large-org (the devs write the tests for new features, you automate the existing tests, plus you set up the CI)
  • m

    mammoth-fall-22117

    04/20/2022, 1:31 PM
    Hello, I am using my Cypress tests both locally and in the CI. I have moved some environment-related variables to the Cypress.env.json file so that they can be adjusted depending on the environment ( https://docs.cypress.io/guides/guides/environment-variables#Option-2-cypress-env-json ). However, I have problem with "defaultCommandTimeout" parameter. I would like to move it to Cypress.env.json and remove it from Cypress.json so that I can adjust timeout - different on local machine and different in the CI. When I ran locally "npx cypress open" I don't see this parameter imported properly but rather default value of 4000ms is used. Any ideas? :/
  • g

    gray-kilobyte-89541

    04/20/2022, 1:36 PM
    defaultCommandTimeout
    is a config value, not a user environment variable, so it is not read from the env file. You can vary it instead using CLI arguments or via
    CYPRESS_...
    environment variable. You can even set it inside your plugins file after looking at the environment
  • m

    mammoth-fall-22117

    04/20/2022, 1:39 PM
    Thanks!
  • m

    mammoth-fall-22117

    04/20/2022, 1:52 PM
    I executed npx cypress run --config defaultCommandTimeout=500 but I don't see the expected result.
  • m

    mammoth-fall-22117

    04/20/2022, 1:58 PM
    Ok I was missing one sign. It's done now. Thanks once again @gray-kilobyte-89541 🙂
  • b

    bland-oil-91894

    04/20/2022, 2:09 PM
    Hi! I recently started having trouble with test runs hanging on the visit command. It will hang anywhere from 5-20 minutes! Tests are being ran in parallel on AWS and we utilize the cypress dashboard. Sometimes up to 3 of the slaves will hang causing what is normally a 5 minute run into 2 hours!! Anyone ever experience this type of issue before? The variable pageLoadTimeout is set to 45s and I am not sure why visit isn't failing after the timeout is reached.
  • f

    fresh-doctor-14925

    04/20/2022, 2:32 PM
    Hi! I had similar problems with hanging tests when running tests in parallel on AWS. Are you running containers? One thing that helped me is to specify a set number of CPUs in each
    docker run
    command
  • b

    bland-oil-91894

    04/21/2022, 12:45 PM
    Yes we are using one of the Cypress provided ECR images. Through adding additional logging most of the hanging is happening as the window:load event is not happening be it quick enough, when it should, or if at all. Using some google-fu I came across some threads mentioning blocking tracking requests. So I blocked any tracking which included google, intercom, segment and pendo. Unfortunately it is still happening.
  • f

    fresh-doctor-14925

    04/21/2022, 1:26 PM
    Ok, how many machines are you running in parallel, and what size EC2 node are you running them on?
    b
    • 2
    • 6
  • b

    bland-oil-91894

    04/22/2022, 6:28 AM
    Ok how many machines are you running in
  • p

    powerful-gigabyte-69168

    04/22/2022, 7:06 PM
    Does anyone here use cypress for stuff other than testing? I obviously use it first and foremost for my e2e suite, but recently have also started using it to load my app into specific states to record my screen and create marketing materials like this .gif I cranked through making a whole bunch of these using the dangling state after test cases end, and some REPL-like functionality using
    cy.now()
    to enable me to make moves on behalf of my opponent. Just wondering if anyone else has found creative uses for cypress outside of pure testing EDIT: looks like discord won't let me post a gif, so here's a link to the file instead:

    https://github.com/cuttle-cards/cuttle-assets/blob/main/assets/six.gifâ–ľ

  • p

    powerful-gigabyte-69168

    04/22/2022, 7:09 PM
    This helped me create a rules page for my game with interactive gifs to showcase all the moves you can make using edge cases that would have been arduous to set up without cypress
  • g

    gray-kilobyte-89541

    04/22/2022, 7:55 PM
    - record demos https://github.com/bahmutov/cypress-movie - play Wordle and send me a hint https://github.com/bahmutov/cypress-wordle - incremental blog scraping https://glebbahmutov.com/blog/incremental-post-scraping/
  • p

    powerful-gigabyte-69168

    04/22/2022, 7:55 PM
    Cool! These are awesome
  • p

    powerful-gigabyte-69168

    04/22/2022, 7:56 PM
    I'm still hoping for full-blown REPL some day because presently I still need to hack my way around things like getting ID's that are stored in application state accessible to my commands run with
    cy.now()
    for video making
  • p

    powerful-gigabyte-69168

    04/22/2022, 7:57 PM
    Haha the world one is gold
  • g

    gray-kilobyte-89541

    04/23/2022, 10:21 AM
    getting the id from the application state would be as simple as
    cy.window().its('app.state.elementId').then(id => cy.get('#' + id))
  • p

    powerful-gigabyte-69168

    04/23/2022, 10:37 AM
    During the test you mean? I’ve been doing these recordings in a REPL style in order to control the timing fluidly by clicking etc as opposed to during testing. So I’m using
    cy.now()
    to run commands on behalf of the other user, and those commands can’t execute nested chains like the above
  • p

    powerful-gigabyte-69168

    04/23/2022, 10:38 AM
    So my hideous workaround is to make the test use
    cy.window().its()
    like you have above in order to manually enter those ids into my
    cy.now()
    executed commands
  • g

    gray-kilobyte-89541

    04/23/2022, 11:54 AM
    if the app state is on the window, from the DevTools you can switch the execution context to the app and then use
    window.app.state ...
    directly and still access the
    cy.now
    via
    Cypress.cy.now
  • p

    powerful-gigabyte-69168

    04/23/2022, 12:58 PM
    That’s slick, thank you. A remaining disadvantage (though one I don’t think can currently be avoided) is that is required creating extra cypress commands that are parameterized by these id’s, whereas the ones I use for testing can grab the identifiers off the state in the command logic without requiring arguments
  • g

    gentle-alarm-63723

    04/25/2022, 9:40 AM
    I am getting the below error. When, I use cy.visit in the local machine. Version of Cypress is 9.5.4 and the code I am executing is actions.specs.js
  • g

    gentle-alarm-63723

    04/25/2022, 9:41 AM
    Can some one help me in this? what would the issue?
  • g

    gentle-alarm-63723

    04/25/2022, 9:44 AM
    Sure. step 1: Install Node.js in PC step 2: Install Visual Studio code step 3. Open Visual Studio code and terminal in visual studio code step 4: npm init step 5: npm install cypress --save -dev step 6: .\node_modules\.bin\cypress open (This is not actually opening up the cypress latest version) so, i have located the binary version of cypress in different location and installed. Now, i could able to launch cypress. However, I am getting the below âš  Warning: Binary version 9.5.3 does not match the expected package version 9.5.4 These versions may not work properly together.
1...373839...127Latest