https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • r

    rich-mechanic-52238

    01/10/2023, 8:30 PM
    but it will make pass all the testcase even if they are not giving status as 200, right?
  • m

    modern-dawn-86006

    01/10/2023, 8:31 PM
    don't use assertion on the url, use it on some element from the new page
  • r

    rich-mechanic-52238

    01/10/2023, 8:34 PM
    for that I will have to visit that page first, then I will have to use cy.origin(url). third ss is for the error this cy.origin is giving and also I have tried whatever it is saying but it didn't worked
  • m

    modern-dawn-86006

    01/10/2023, 8:37 PM
    did u put this in e2e of cypress config?
  • m

    modern-dawn-86006

    01/10/2023, 8:52 PM
    i think the best option for u is to login (using auth), make a test account
  • r

    rhythmic-lizard-86607

    01/11/2023, 12:09 AM
    Hey! Hay anyone seen check.state is missing error on running Login with Auth0-nextjs library?
  • b

    bland-machine-99046

    01/11/2023, 7:50 AM
    Thanks, resolved!
  • b

    bland-machine-99046

    01/11/2023, 8:22 AM
    Hi guys, anyone knows what's wrong with this compilation error?
  • b

    bland-machine-99046

    01/11/2023, 8:23 AM
    It keeps displaying module not found but I've checked the file path from the test case, it's correct.
  • b

    bland-machine-99046

    01/11/2023, 8:24 AM
    Any particular reason why it shows 3 'cypress' wording from the URL when I only specified two?
  • i

    important-room-45301

    01/11/2023, 10:02 AM
    By any chance in the path have you appended cypress again after giving the path ?
  • l

    lemon-oxygen-25956

    01/11/2023, 10:47 AM
    We are not using cucumber and the "window:before:load" does not work for this. Thx.
  • d

    dry-portugal-25841

    01/11/2023, 11:42 AM
    by default cypress looks for fixtures in
    cypress/fixtures/
    , you probably should refactor your project structure, check the docs or examples on github
  • h

    happy-baker-38999

    01/11/2023, 1:59 PM
    I was able to get coverage working alongside npm run dev with "vite-plugin-istanbul": "^4.0.0". I put the plugins instabul({}) in vite.config.js not nuxt.config.ts in case that helps.
  • g

    green-controller-97889

    01/11/2023, 2:33 PM
    I have written a command to select a menu:
    Copy code
    js
    Cypress.Commands.add("checkMenu", (currentPageTitle) => {
      cy.get("[data-cy='_select']").should("exist");
      cy.get("[data-cy='_select']").then((menu) => {
        console.log(menu);
        cy.log("Check if menu renders with the proper active page title");
        menu.should("exist");
        menu.contains(currentPageTitle);
        menu.children().should("have.length", 2);
    
        cy.log("Check if dropdown is visible after click");
        menu.trigger("click");
        menu.find("_dropdown").should("be.visible");
        debugger;
      });
    });
    but it doesn't work saying that
    menu.should("exist");
    is not a function. So
    cy.get("[data-cy='_select']").should("exist");
    works. But when inside
    cy.get("[data-cy='_select']").then((menu) => {}
    the
    menu.should("exist");
    returns the error mentioned above. How come ? It is a basic and fairly simple test.
  • s

    stale-optician-85950

    01/11/2023, 3:07 PM
    Use
    cy.wrap(menu).should("exist");
    https://docs.cypress.io/api/commands/wrap
  • g

    gray-kilobyte-89541

    01/11/2023, 3:17 PM
    review assertions examples https://glebbahmutov.com/cypress-examples/commands/assertions.html
  • g

    green-controller-97889

    01/11/2023, 3:31 PM
    I simply used
    cy.get("[data-cy='_select']").should("exist");
    . Maybe I didn't have to use `.then()`; @stale-optician-85950 @gray-kilobyte-89541 I still don't understand why it didn't work though. There is no explanation. Why does
    wrap()
    exist if we have
    get()
    ? Why doesn't
    cy.get("[data-cy='_select']").then((menu) => {
    give me the
    menu
    as it should ?
  • g

    gray-kilobyte-89541

    01/11/2023, 4:15 PM
    Please read https://docs.cypress.io/guides/references/assertions#Should-callback You are getting a jQuery object inside
    should
    and the same for
    .then
    So there is no "should" method on jQuery object. You can use built-in Chai-jQuery assertion
    then(menu => expect (menu).to.exist)
    BUT the existence assertion is already built into
    cy.get
    command, so that is unnecessary. Your code snippet would be something like
    Copy code
    js
    cy.get('...menu selector')
      .within(() => {
         cy.get('children selector').should('have.length', 2)
         cy.contains(title)
         cy.log('opening ...')
       })
       .click()
    cy.get('opened element selector').should('be.visible')
    Note I did not attach
    cy.get
    at the end after the ".click" to avoid DOM detached error, since the menu might re-render completely
  • r

    ripe-pilot-34121

    01/11/2023, 4:56 PM
    I am getting the following error after using the email address for authentication. can anyone please guide how can i handle this workspace authentication
  • s

    some-keyboard-52751

    01/11/2023, 5:20 PM
    hi
  • m

    modern-dawn-86006

    01/11/2023, 6:17 PM
    Open your inspect and then open console, check if there are errors in it.
  • m

    modern-dawn-86006

    01/11/2023, 6:19 PM
    @lemon-oxygen-25956 this is your solution
  • r

    ripe-pilot-34121

    01/11/2023, 6:20 PM
    Yes, there are some errors existed
  • r

    ripe-pilot-34121

    01/11/2023, 6:21 PM
    Hello
  • m

    modern-dawn-86006

    01/11/2023, 6:30 PM
    That's why you are getting this in cypress. You can ignore these errors by using https://discord.com/channels/755913899261296641/755913900024791046/1062102218540593264 Read this workaround. It is not a solution, just a workaround. This is not considered a good practice either.
  • a

    agreeable-refrigerator-17485

    01/11/2023, 7:52 PM
    Hello. I'm trying to create a react app that uses google maps, and we're using Cypress for E2E testing. I have buttons that toggle the map layers on and off, and I don't know what's ANY way that I would catch map changes due to how Google maps serves their maps. There doesn't seem to be a way to specifically target the added layer. Anyone has experience with that? I was thinking of maybe snapshotting part of the page then check for difference between before and after the add layer button click, but I'm not sure if this is the right approach.
  • m

    magnificent-finland-58048

    01/11/2023, 8:04 PM
    had a similar situation at the end I decided, as long as some map renders, it's fine. I think in the bottom right there is a copyright you can check beyond that, what is the purpose of (re)testing google maps? All we have to do is ensure something renders, we don't need to check something else renders when the address is different visual diffing is a nightmare with that, at some point you would thumbs up so much that any diff is accepted
  • a

    agreeable-refrigerator-17485

    01/11/2023, 8:07 PM
    much appreciated mate, thank you very much!
  • m

    mysterious-psychiatrist-29678

    01/11/2023, 9:09 PM
    hope you can help this time. I want to click a dropdown after all data have populated then select an item. but in 30-40% it fails to click in the right moment, I believe it tried a tiny bit earlier at the moment when no data in it. you can see in the picture that "resource group" I want to click still loading but the code already clicked it. how would you cope with it? here is the code:
    Copy code
    cy.get('.fxc-dropdown-input')
        .should(($dropdown) => {
          expect($dropdown).not.have.text('Loading...') 
      cy.contains('.fxc-dropdown-filter', 'Resource group')
        .find('.fxc-dropdown-input')
        .click()
        .then(() => {
          cy.contains('[role="treeitem"]', groupToSelect, {timeout: 10000})
            .should('be.visible')
            .click()
        })
    thanks so much.
1...184185186...192Latest