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

    victorious-telephone-50839

    02/06/2022, 10:38 AM
    Hello Everyone 🙂 Please, I need your help in cypress runner > with navigator chrome > when I click on a button, the list of choices doesn't display correctly ... But in my web app the list is displayed correctly I don't know why in cypress navigator I have this prob :/ Thanks
  • g

    glamorous-coat-65256

    02/07/2022, 9:14 AM
    Hi I have a question that might expand too much. I am working in a web app project that uses auth0 to validate the users. The application makes a redirection to auth0 site and uses a cookie to validate the user and grant the user access. Now, i have followed the auth0 docs and cypress docs and I made a request to auth0 using the api of my auth0 domain successfully. Since the application uses the cookie to grant the user access to the rest of the application, I am now thinking to re-create this cookie on the cypress test so i can access the application. Is this the right approach of doing this? I am thinking of that because when I validate my user using the auth0 API i am still unable to reach the inner application. Any feedback is highly appreciated!
  • p

    powerful-orange-86819

    02/07/2022, 11:09 AM
    not a good approach imo, rather just have the "authenticate" command in beforeEach so you can reauthetnticate through all the tests. Makes tests more clean imo
  • b

    billowy-spoon-30011

    02/07/2022, 11:15 AM
    Hi, have you tried waiting after the click ? I also see that you have a French app. If you want to discuss in French, maybe we can discuss through mp ?
  • c

    creamy-train-56346

    02/07/2022, 1:43 PM
    Hey y'all! Is there a way to store field value as a variable? Ideally I want console.log() from 71st line to print out input's value.
  • a

    able-microphone-67346

    02/07/2022, 3:13 PM
    Hi, I am using Cypress with Vite for component testing and can not find a way to start testing environment (cypress browser) with specific website url instead of
    localhost:3000
    I tried using
    baseUrl:"my-website.com"
    and I see that
    baseUrl
    is setting up correctly in config, but the cypress browser is still opening
    localhost:3000
    any advice is appreciated 🙏
  • f

    flat-pizza-70339

    02/07/2022, 6:12 PM
    Hi, I'm using Cypress for E2E tests for https://mermaid.live. But with the latest update for monaco editor,
    cy.tick()
    breaks the test. https://dashboard.cypress.io/projects/2ckppp/runs/373/test-results/0ae7e4fd-88a4-445f-89f4-bcdeab828eb3?utm_source=github&statuses=%5B%7B%22value%22%3A%22FAILED%22%2C%22label%22%3A%22FAILED%22%7D%5D Is there any workaround for this issue? Thanks!
  • a

    adventurous-dream-20049

    02/07/2022, 7:03 PM
    @User While using a
    beforeEach
    hook is a good approach, another option is to use the experimental sessions API. This saves times by not needing to request the auth application prior to every test. Here are some docs: https://docs.cypress.io/api/commands/session#Syntax
  • a

    adventurous-dream-20049

    02/07/2022, 8:38 PM
    A few questions to kind of dot my i's and cross my t's: 1. Can you confirm the correct URL is being used with
    cy.visit()
    ? If you changed your base URL, you would only need to use
    "/"
    2. Are you visiting your URL in a custom command or `before`/`beforeEach` where the visit command may have not been updated? 3. Have you tried manually saving and restarting your tests in your IDE? I often rely on the auto-save, but found when I make changes to my config, I need to restart the Cypress app and manually save in VS Code before my changes take effect.
  • a

    able-microphone-67346

    02/08/2022, 8:11 AM
    Thank you for the answer. I was talking about component testing. Documentation says that you need to
    mount
    component before testing, not
    cy.visit()
    or
    before/beforeEach
    . Attaching image for more info
  • a

    adamant-magazine-53646

    02/08/2022, 8:19 AM
    Hi Team, I am unable to access chrome://downloads/ page in cypress
  • a

    adamant-magazine-53646

    02/08/2022, 8:19 AM
    can any1 pls help
  • a

    adamant-magazine-53646

    02/08/2022, 8:20 AM
    i am getting about://blocked whenever trying to access it
  • c

    cool-laptop-34247

    02/08/2022, 1:29 PM
    Hello everyone, I made an attempt on making a cypress test which needs to log in, to test content behind closed doors. I start on point A, my base url. When i click on my login button, i get redirected to another domain regarding the login authorisation. I need to login to test the content that is behind the authentication, but my test keeps dying when i navigate to the authorisationpage/site. Let me explain it with an example: Code: import {Given, And, Then, When} from 'cypress-cucumber-preprocessor/steps'; const url = Cypress.env('testVMNUrl'); console.log(url); Given(
    I am at the {string} website
    , (webSite) => { cy.visit('https://'+webSite+url); cy.url().should('include', webSite); }); When(
    I am on the homepage
    , () => { cy.url().should('include', '.test.xxxxx.com/'); }); Then(
    I click on "inloggen"
    , () => { cy.get('.register-link.underline').should('be.visible').click(); }); After this click my test dies, no matter what. When i put a cy.log behind it, to test if it gets to that command, it does not. As you can see in the screenshot, it tries to redirect to another website for authorisation. I'm actually clueless right now. What can i do to make this work? If i need to provide other information, please let me know. I hope that someone can help me out. Versions: Cypress 9.4.1 Gherkin 9.0.0 Cucumber 7.3.2
  • m

    mysterious-area-98742

    02/08/2022, 1:42 PM
    Hello everyone, I would like to use Cypress to test my applications, using POM (I have read https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/, but I was not moved) I would like to pre-define selectors (like
    this.user = 'input[type="email"]'
    ), but I also have
    contains
    selectors. It is weird (but possible?) to create
    this.forgot = ['a', 'Forgot password']
    kind of selectors (and then maybe
    cy.contains(*this.forgot)
    ); but I'd like to declare them at construction time. (Inspiration: https://playwright.dev/docs/test-pom) However, at construction time,
    cy
    is not callable. I was wondering if there is something like
    Cypress.Commands.add('login', (...) => { ... })
    that would, however, allow me to assign it to a variable instead (i.e. it would return the function, instead of polluting the
    cy
    namespace).
  • b

    brainy-photographer-13281

    02/08/2022, 2:09 PM
    Hi wat is the command to upgrade the existing cypress version to latest version
  • v

    victorious-telephone-50839

    02/08/2022, 4:15 PM
    Thank you 🙂 ok
  • a

    adventurous-dream-20049

    02/08/2022, 7:28 PM
    I'm honestly not as familiar with the component side, so I'll need to do a little more investigating. Maybe @User will have some insight?
  • l

    limited-keyboard-75773

    02/08/2022, 10:02 PM
    Hello gang, I need help with low-level implementation with Cypress. I wonder if there's a way to run only the
    it()
    block that failed in a given test file in the
    afterEach
    hook. For instance:
    Copy code
    let failureItBlocks = []
    
    beforeEach(() => {
        Cypress.on('fail', function () {
            failureItBlocks.push(this.currentTest)
        })
    })
    
    // bunch of it() blocks & assertions
    
    after(() => {
        // run all test in the failureItBlocks here again
        cypress.run(failureItBlocks)
    })
  • l

    limited-keyboard-75773

    02/08/2022, 10:02 PM
    Is this even possible?
  • b

    bulky-sundown-74498

    02/08/2022, 10:16 PM
    It looks like what you want is a retry, right?
  • b

    bulky-sundown-74498

    02/08/2022, 10:16 PM
    You want to re-run the test that failed
  • b

    bulky-sundown-74498

    02/08/2022, 10:17 PM
    https://docs.cypress.io/guides/guides/test-retries#Global-Configuration
  • l

    limited-keyboard-75773

    02/08/2022, 10:39 PM
    Unfortunately, I cannot use the
    { retries: 3 }
    object in the
    it
    block. This is promising though https://docs.cypress.io/guides/guides/test-retries#Only-upload-videos-for-specs-with-failing-or-retried-tests is the
    results.tests
    an
    it
    block or the entire test file?
  • b

    bulky-sundown-74498

    02/08/2022, 10:41 PM
    Given that videos are taken by file I would say that is the scale where these videos are deleted
  • l

    limited-keyboard-75773

    02/08/2022, 11:14 PM
    Is there another way to handle what I'm looking for as low level implementation?
  • m

    mysterious-area-98742

    02/08/2022, 11:31 PM
    Apologies, bump
  • a

    adventurous-dream-20049

    02/09/2022, 1:24 AM
    Try
    yarn add cypress@latest
    or
    npm install cypress@latest
  • w

    wonderful-match-15836

    02/09/2022, 1:59 AM
    Hey, I don’t have a straight answer (I’m not sure I understand what you are looking for well enough) but I have become interested in Page Objects recently and wouldn’t mind talking to somebody who likes them! Happy to have a call with you and see if we can figure out what you are hoping for, and maybe I’ll learn more about POM in general.
  • m

    mysterious-area-98742

    02/09/2022, 6:15 AM
    Sure! What timezone are you on?
1...484950...252Latest