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

    mammoth-australia-81192

    08/01/2022, 4:17 PM
    Cypress Component Testing Freezing with Vite
  • w

    wooden-monitor-57304

    08/01/2022, 4:32 PM
    Hi everyone. Is there a way to trigger a hook after the execution of a specific it block in cypress?
  • n

    nice-megabyte-63134

    08/01/2022, 5:55 PM
    Hi everyone. I have just raised a PR in
    cypress-io/cypress
    but the Circle CI is stuck at
    build
    job with
    UNAUTHORIZED
    warning. Do you know how to pass this?
  • g

    gray-kilobyte-89541

    08/01/2022, 7:44 PM
    const expectedLabel = cy.get('@tabs').eq(index).invoke('attr', 'id')
    Nope. Not going to work, always pass it forward. I have a similar example where I show that we are getting the same DOM element references using two selectors https://glebbahmutov.com/cypress-examples/9.7.0/commands/querying.html#jquery-selectors
  • a

    able-monkey-72947

    08/01/2022, 8:00 PM
    I ended up doing this and it worked for what I was trying to test.
    Copy code
    cy.get('@tabs').eq(index).invoke('attr', 'id').then(tabId => {
      expect(label).to.equal(tabId)
    })
    > always pass it forward You mean
    .then(...)
    it or something else?
  • s

    silly-oil-35249

    08/01/2022, 8:34 PM
    Is anyone experiencing
    afterEach
    code getting run in the
    beforeEach
    of a
    describe/it
    ? I can't reproduce it locally, it is only happening on CircleCI and only for one of our test files (we use the same pattern to delete database objects created in the
    afterEach
    in all our test files). TL;DR: our clean up code runs before the objects are created and fails when the objects can't be deleted. If we re-run the spec file one or more times after failing it will succeed.
  • g

    gray-kilobyte-89541

    08/01/2022, 9:16 PM
    use
    .then(value => ...)
  • g

    gray-kilobyte-89541

    08/02/2022, 2:49 AM
    See Network Testing Bonus lesson 32, if I have time I will record a video
  • m

    melodic-dawn-73228

    08/02/2022, 5:56 AM
    Anything about this one?
  • a

    adorable-stone-42197

    08/02/2022, 6:41 AM
    I waiting some table to get all the date examples values, i am clicking on one button and i have like 9 ( example, sometimes i have more depends on how many values tables have) api and they are loading… i have allias, and i use like cy,wait for 9 times , beacuse for this table i know that i have 9 api calls… but sometimes if u use different, i will not known…
  • a

    adorable-stone-42197

    08/02/2022, 6:41 AM
    Will check this
  • a

    adorable-stone-42197

    08/02/2022, 6:47 AM
    And all api give different values… just in case
  • w

    witty-magazine-45881

    08/02/2022, 9:09 AM
    He everyone! is the any way to pass some additional html layout when im mounting my Vue component ? For example, i would like to wrap up my component with extra "div" container. When i pass it like this:
    Copy code
    cy.mount(
          <div>
            <MyComponent />
          </div>
        )
    im getting error: "Cannot read properties of undefined (reading 'devtoolsRawSetupState')"
  • l

    limited-continent-86055

    08/02/2022, 11:20 AM
    Hi, I'm having a difficulty migrating to cypress 10
  • l

    limited-continent-86055

    08/02/2022, 11:20 AM
    In particular there seems to be issues with the setupNodeVents function and my database seeding/teardown tasks
  • l

    limited-continent-86055

    08/02/2022, 11:20 AM
    I don't know if they get recognised and I'm pretty sure it doesn't see those tasks
  • l

    limited-continent-86055

    08/02/2022, 11:21 AM
    This is how the function currently looks
    Copy code
    js
    setupNodeEvents(on, config = {}) {
          const env = process.env.NODE_ENV;
    
          const envConfig = getConfig(env);
    
          config.env['MAILOSAUR_API_KEY'] = envConfig.mailosaur.apiKey;
          config['baseUrl'] = envConfig.baseUrl;
    
          on('task', {
            'db:seed': async () => {
              await seedData();
            },
    
            'db:teardown': async () => {
              await teardownData();
            },
          });
    
          return config;
        },
  • l

    limited-continent-86055

    08/02/2022, 11:22 AM
    I'm positive the teardown and seeding functions work properly since they did in the previous version and they shouldn't have been changed by the update
  • l

    limited-continent-86055

    08/02/2022, 11:23 AM
    Also, the setupNodeEvents function is greyed out and I see "Unused function setupNodeEvents"
  • p

    polite-alarm-78904

    08/02/2022, 2:25 PM
    how can I check if an element is scrolled into view?
  • l

    late-planet-4481

    08/02/2022, 2:32 PM
    ~~You can assert it a couple of ways.
    cy.('[data-test="myElement"]').should('be.visible')
    or you can even make visibility part of the selector... `cy.('[data-test="myElement"]:visible').should('exist')`~~ I'm not sure the answer above helps your situation actually. I doubt "visible" means unobscured. Rather than checking, why not just scroll it into view regardless? Someone else here recently was trying to click an obscured element, and they had luck setting the
    scrollBehavior
    option when calling
    .click()
    to bring the element into view first. I believe they used
    scrollBehavior: false
    .
  • p

    polite-alarm-78904

    08/02/2022, 2:41 PM
    I want to click a an item in a menu -> scroll to the correct part of the page -> make an assertion to check that the page scrolls to the correct element. I tried to do this first, but it fails because the element doesn't have display none, so it will always be found on the page.
    Copy code
    cy.get("element").should("not.be.visible")
    cy.get("listItem").click()
    cy.get("element").should("be.visible")
  • a

    acceptable-hamburger-48790

    08/02/2022, 2:42 PM
    Click will by default scroll to that element
  • i

    important-rocket-19427

    08/02/2022, 3:10 PM
    Would love some help with setting cypress-code-coverage with vite I am using vite-istanbul and I can see the coverage object on my local server but when I run Cypress I get an error Could not find any coverage information in your application - nyc-output is created and not empty - coverage folder is created and it shows all the components but all of them show at 0% - Also I am able to instrument the code only when nyc instrument --compact=false src instrumented I would expect that I did not need to run this command if I am using vite-istanbul
  • l

    late-planet-4481

    08/02/2022, 3:11 PM
    Are you saying that the app will do the scrolling, or are you wanting Cypress to do the scrolling? If the app will do the scrolling and you want to assert the final position then good question; I'm not sure of the answer (but I'm sure there's a way, somehow). But if Cypress will be doing the scrolling then there's no reason to assert... just rely on
    .click()
    to autoscroll, as gurudatt26 said. Or use
    scrollIntoView()
    .
  • a

    acceptable-hamburger-48790

    08/02/2022, 5:49 PM
    Recently bumped into a scenario where i need to scroll and then react app loads more data, i have written this post based on my use case, https://medium.com/@gurudatt.sa26/cypress-asserting-the-text-when-there-is-infinite-scroll-a3a30b33e04a hope this helps further
  • b

    brainy-librarian-80110

    08/03/2022, 4:03 AM
    Hello everyone I need your help...I am facing one issue in cypress I am trying to login into the SAP Fiori launchpad-based library but cypress is giving an error and not allowing me to redirect to the application home page
  • b

    brainy-librarian-80110

    08/03/2022, 4:03 AM
    I have attached screenshot of the issue so can anyone please help me out with this?
  • l

    limited-continent-86055

    08/03/2022, 7:05 AM
    How can I debug cypress automations in my webstorm?
  • l

    limited-continent-86055

    08/03/2022, 7:05 AM
    I read the article about it but didn't really find the info I needed
1...118119120...252Latest