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

    user

    07/20/2021, 2:45 PM
    Hi everyone 🙂 I hope I am on the right channel 🙂 Cypress look very great! Thanks a lot for all you are doing! I still have a question actually for Cypress Studio tool. In fact, I saw it is an experimental mode and I was wondering is you think this experimental tool might be canceled or if there is great chance to have a stable version?
  • b

    bulky-sundown-74498

    07/20/2021, 5:27 PM
    Yes the team is actively working on it right now
  • b

    bulky-sundown-74498

    07/20/2021, 5:28 PM
    We have assertions coming in soon
  • u

    user

    07/22/2021, 10:23 AM
    hello is it possible to access the current test information inside of a command?
  • u

    user

    07/22/2021, 10:33 AM
    nvm I figured it out
    cy.state('runnable').ctx.test
  • a

    ancient-wire-34126

    07/22/2021, 2:18 PM
    Any clue how to solve this? File is there, no syntax errors, nothing changed either. Just started happening after a restart
  • a

    ancient-wire-34126

    07/22/2021, 2:24 PM
    MacOS updated to 11.5 though
  • a

    ancient-wire-34126

    07/22/2021, 2:30 PM
    It fails when I import a file...
  • a

    ancient-wire-34126

    07/22/2021, 2:32 PM
    Sigh, it needs "allowJs" in the TS config
  • a

    ancient-wire-34126

    07/22/2021, 2:58 PM
    What's the way to set up global intercepts? The
    before
    hook in the support file only runs for the first test for some reason
  • l

    late-sundown-90898

    07/22/2021, 3:20 PM
    beforeEach
    maybe? 🤷‍♂️
  • a

    ancient-wire-34126

    07/22/2021, 3:26 PM
    Man Cypress is weird... Some stuff is persistent, other things are not.
  • a

    ancient-wire-34126

    07/22/2021, 3:27 PM
    and you can't wait for some built-in commands to complete either. Like
    readFile
    , which I need to mock a graphSchema
  • a

    ancient-wire-34126

    07/22/2021, 3:45 PM
    Now it stopped intercepting all together
  • a

    ancient-wire-34126

    07/22/2021, 3:48 PM
    it cancels all requests for some reason, without any sort of error
  • a

    ancient-wire-34126

    07/22/2021, 3:53 PM
    This makes 0 sense...
  • a

    ancient-wire-34126

    07/22/2021, 3:55 PM
    It removes all my intercepts after 1 run
  • a

    ancient-wire-34126

    07/22/2021, 4:07 PM
    https://github.com/cypress-io/cypress/issues/17107
  • a

    ancient-wire-34126

    07/22/2021, 4:08 PM
    Well that's a huge problem
  • u

    user

    07/22/2021, 6:15 PM
    is there a way to execute a task conditionally when a request matches some criteria?
    Copy code
    cy.intercept('POST', '/endpoint', request => {
      if (request.body.foo === true) {
        request.continue(response => {
          cy.writeFile('cypress/foobar.json', response.body)
        })
      }
    })
  • u

    user

    07/22/2021, 6:16 PM
    I know that I can conditionally set the alias but I cannot
    wait
    conditionally
  • f

    faint-bear-92677

    07/22/2021, 11:16 PM
    Does anyone have a preferred way to stub cy.request in a cypress test? I'm trying to test a cypress common library, and hoping to verify without actually sending data to an endpoint.
  • b

    bumpy-yacht-37274

    07/23/2021, 9:52 AM
    Hi, cypress/browser is issuing multiple requests for assets when using
    cy.visit
    . Do you have a clue?
  • u

    user

    07/23/2021, 1:11 PM
    can anybody help with this?
  • a

    ancient-wire-34126

    07/23/2021, 2:26 PM
    I have the following global before/beforeEach hooks:
    Copy code
    ts
    before(() => {
      // Get all the created users.
      cy.getUsers() // Exposes @users
    })
    
    beforeEach(() => {
      // Get all the created users.
      cy.getUsers() // Exposes @users
    })
    This should mean that the alias
    @users
    is available everywhere at any point in time. However, this fails to resolve in a test that uses the
    before
    hook **twice**:
    Copy code
    ts
    describe('Profile', () => {
      describe('New User', () => {
      // Login through the Cognito mock and visit the profile page.
        before(() => {
          cy.get('@users').then(users => {})
        })
       })
    
      describe('Owner', () => {
      // Login through the Cognito mock and visit the profile page.
        before(() => {
          cy.get('@users').then(users => {}) // this fails
        })
       })
    })
    I see no reason why this would fail, as the alias should be exposed during every step. I've spent a week now on trying to get Cypress to work with seeded data in JS and I'm close to giving up, as it seems to just not want you to do that for some reason. Esp. when using graphql and there's no DB involved this is almost impossible to work with, as your data needs to be "local" but Cypress has the tendency to completely wipe out everything between tests. I thought aliases would save me here and they do when it comes to
    beforeEach
    , but I'm not going to continuously fetch data/login between
    it
    statements that are grouped in a describe. I should be able to perform a specific action before each
    it
    .
  • u

    user

    07/26/2021, 7:26 PM
    I am trying to assert that an element is on the page. The main issue is this element shows up on a new page inside an I frame. Iframe modal form > submit button > redirect to new form page inside iframe Any attempts to grab elements on the new page will return with a timeout "queried from ". I can somehow still grab elements from the old page which no longer displays
  • u

    user

    07/26/2021, 7:27 PM
    The code works in production but not in Cypress and I've not been able to find any resources on moving thru pages inside an iframe
  • u

    user

    07/27/2021, 2:52 AM
    In the end I redesigned the app to not use i frames since I couldn't resolve the issue
  • b

    bulky-sundown-74498

    07/27/2021, 2:35 PM
    Sorry about that cypress tends to dislike iframes
  • b

    bulky-sundown-74498

    07/27/2021, 2:36 PM
    https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/
1...282930...252Latest