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

    melodic-hydrogen-41542

    06/16/2022, 3:53 PM
    In which case the warning message is probably unrelated to the fact that Cypress closes so quickly. Windows can be a fickle beast sometimes, you could try running the same command in PowerShell instead of the vanilla command prompt?
  • s

    swift-kitchen-62493

    06/16/2022, 3:56 PM
    oke, i find the solution fir this, i just had to open VS code as administrator xd
  • g

    great-engine-82623

    06/16/2022, 5:27 PM
    hey all i think i found a bug with the
    Cypress.env()
    function. i have a
    cypress.env.json
    inside the
    /cypress
    folder of my Next.js TypeScript project. In there I have a JSON that looks like this:
    Copy code
    json
    {
      "CORRECT_PASSWORD": "The password 123"
    }
    Inside a
    test.cy.ts
    file I'm trying to use the env variable like this:
    Copy code
    typescript
    const correctPassword = Cypress.env('CORRECT_PASSWORD')
    But when I run the tests (in the Dashboard as well as headless) it just throws me the error as shown on the screenshot. Did anyone have the same problem?
  • g

    great-engine-82623

    06/16/2022, 5:43 PM
    okay i basically needed to add the cypress.env.json to the root of the project, not inside the
    /cypress
    folder
  • n

    nutritious-honey-65632

    06/16/2022, 6:11 PM
    Copy code
    So Cypress skips the remaining tests in that block, because they would also fail due to the beforeEach hook failure.
  • n

    nutritious-honey-65632

    06/16/2022, 6:12 PM
    if you have an error in first
    beforeEach
    it will skip all contexts, if you have an error in single context in
    beforeEach
    it should run other contexts but skip rest of the tests in context with error.
  • p

    proud-breakfast-29892

    06/16/2022, 6:13 PM
    The error is inside the
    it
    block itself, not in
    beforeEach
  • p

    proud-breakfast-29892

    06/16/2022, 6:13 PM
    Actually let me double ceck
  • n

    nutritious-honey-65632

    06/16/2022, 6:15 PM
    sometimes it could look like the error is in the test but actually is in the before. Depending on the command. You can check on your example if you for example put
    cy.contains(false)
    in any
    before
    or inside
    it
  • p

    proud-breakfast-29892

    06/16/2022, 6:17 PM
    Ah, I see. It fails on a global
    afterEach
  • b

    bulky-twilight-81110

    06/16/2022, 6:26 PM
    Hi people, I try to install cypress version 10 but when I try to run cypress open, the electron browser is running and exit immediately. Does someone know what the problem is?
  • b

    bulky-twilight-81110

    06/16/2022, 6:27 PM
    When I downgrade the version to 9.7.0, it runs just fine
  • n

    nutritious-honey-65632

    06/16/2022, 6:30 PM
    did you follow up https://docs.cypress.io/guides/references/migration-guide
  • b

    bulky-twilight-81110

    06/16/2022, 6:31 PM
    oh I will try to look at it. Thank you 😄
  • b

    bulky-twilight-81110

    06/16/2022, 6:55 PM
    @nutritious-honey-65632 I'm new to cypress and a little bit confused with the migration part. Can you tell what should be there in the configuration in order to open cypress normally
  • b

    bulky-twilight-81110

    06/16/2022, 6:55 PM
    I see that we needed to pass --browser and --e2e flag to the command in order to run the browser right?
  • n

    nutritious-honey-65632

    06/16/2022, 7:23 PM
    you can skip these flags, they are just saving you few clicks. This migration guide shows how to switch to cypress 10. But if you don't have specific requirements you can stay on older version as well
  • b

    bulky-twilight-81110

    06/16/2022, 9:07 PM
    okay thanks for your advice then 🙂 still wonder why cannot work with version 10 tho
  • i

    important-fish-21193

    06/16/2022, 9:39 PM
    Does any have success implementing cy.session in testing oracle apex application ? Would love to know how you guys implemented it.
  • i

    important-fish-21193

    06/16/2022, 9:42 PM
    With apex applications, session id attached in the url and apex creates a new session if you do a cy.visit after cy.session, and it does not restore the session. If anyone have successfully implemented it please do let me know. Thanks
  • c

    chilly-market-86437

    06/17/2022, 6:26 AM
    Hi. Does anyone have an idea how to benchmark a functionality in cypress. For example: 1. Click a button 2. Start Timer 3. API request and animations. 4. Stop timer 5. Append test time to JSON file.
  • a

    acoustic-magazine-89269

    06/17/2022, 8:34 AM
    Does any one have any idea on if fixture factories work the same when moving from
    cy.route
    to
    cy.intercept
    since refactoring it does not seem to be working as intended!
  • f

    fresh-doctor-14925

    06/17/2022, 11:00 AM
    Not sure what you mean by 'fixture factories'?
  • m

    mammoth-napkin-19312

    06/17/2022, 11:12 AM
    Hi, does anybody know how to generate reports in cypress?
  • a

    acoustic-magazine-89269

    06/17/2022, 11:13 AM
    As opposed to having multiple feature files, instead we have stored them in to a factory where we can create multiple objects using predetermined object e.g.
    Copy code
    js
    
    const standardUser = organisationFactory("id123", {
    name:"bob"
    userType:"user"
    premium: false,
    });
    
    const premiumUser = organisationFactory("id123", {
    name:"Jim"
    userType:"user"
    premium: true,
    });
    
    export const user: someType = {
        standard: apiResponseFactory([
            standardUser,
            premiumUser,
        ])
    }
  • f

    fresh-doctor-14925

    06/17/2022, 11:16 AM
    Take a look at the
    fixture
    syntax within
    cy.intercept()
    . I've been able to use that with success https://docs.cypress.io/api/commands/intercept#Stubbing-a-response
  • k

    kind-pizza-45261

    06/17/2022, 11:30 AM
    Hi guys, Can someone please help me for this. I am calling the page urls and credentials from a .json file (For eg: test.json) and the command which I used to run is npx cypress open --config-file test.json Now I am trying to add an html report merge with the scripts which I added in package.json file. Looks like its not accepting the .json file options which I have give in the package.json file. See my package.json file reference. Help me to resolve this issue.
  • k

    kind-pizza-45261

    06/17/2022, 11:40 AM
    You can use mochawesome plugins t generate reports. Pls refer this link: https://docs.cypress.io/guides/tooling/reporters#Installed-locally
  • m

    mammoth-napkin-19312

    06/17/2022, 11:41 AM
    I am struggling to find the proper steps to follow
  • k

    kind-pizza-45261

    06/17/2022, 11:42 AM
    follow the steps one by one. At the end you will be able to figure out.
1...888990...252Latest