https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • m

    magnificent-finland-58048

    06/23/2022, 3:27 PM
    https://tenor.com/view/6m-rain-wallstreet-make-it-rain-gif-8203989
  • g

    gray-kilobyte-89541

    06/23/2022, 3:32 PM
    https://giphy.com/gifs/wearebottle-school-knowledge-scooping-S3Pe5NZqgmE8Tl3NI5
  • m

    magnificent-finland-58048

    06/23/2022, 3:34 PM
    he's got it figured out
  • m

    magnificent-finland-58048

    06/23/2022, 3:34 PM
    cypress-each
    would work too btw
  • g

    gray-kilobyte-89541

    06/23/2022, 3:39 PM
    ohhh, that's right, plus cypress-grep
  • m

    magnificent-finland-58048

    06/23/2022, 3:39 PM
    oh yes
  • g

    gray-kilobyte-89541

    06/23/2022, 3:39 PM
    ughh, this course is going to be 10 weeks
  • m

    magnificent-finland-58048

    06/23/2022, 3:40 PM
    that's great, we won't have to try to keep up do date with your blog šŸŽ‰
  • g

    gray-kilobyte-89541

    06/23/2022, 3:40 PM
    the course will not absolve you from the blog post and DEFINITELY still requires watching the youtube videos
  • d

    dazzling-salesclerk-15570

    06/23/2022, 5:09 PM
    @rapid-application-21794 another solution would be write the info u need to a file
  • b

    bored-baker-20372

    06/24/2022, 6:29 AM
    Another option to get around .then being a bit selfish with data. šŸ˜„
  • o

    orange-dog-93152

    06/24/2022, 7:12 AM
    Right. But as visual testing part hasn't been set up yet. We need to use attr. to verify. And hell yeah sometimes it becomes very hard to verify those attr.
  • a

    astonishing-electrician-44897

    06/24/2022, 7:32 AM
    Maybe also the @billions-barista-30103/skip-test
  • c

    chilly-noon-25793

    06/24/2022, 7:42 AM
    is there a workaround for this issue? https://github.com/cypress-io/cypress/issues/20476
  • a

    adorable-stone-42197

    06/24/2022, 9:48 AM
    Timed out after waiting 60000ms for your remote page to load. Your page did not fire its load event within 60000ms. You can try increasing the pageLoadTimeout value in cypress.json to wait longer. Browsers will not fire the load event until all stylesheets and scripts are done downloading. When this load event occurs, Cypress will continue running commands.
  • a

    adorable-stone-42197

    06/24/2022, 9:49 AM
    I have this error and sometimes i need to close my visual studio code and wait couple of minutes and it works. How i can solve this happening?
  • g

    gray-kilobyte-89541

    06/24/2022, 10:56 AM
    honestly I never use this plugin myself
  • a

    adorable-stone-42197

    06/24/2022, 11:02 AM
    I am trying to implement this code , but for some reason is not working every time. This is plugin dataSession
  • a

    adorable-stone-42197

    06/24/2022, 11:02 AM
    beforeEach(() => { cy.dataSession({ name: 'logged in', setup() { cy.login() cy.getCookie('access') }, validate(cookie) { // try making a request with the cookie value // to a protected route. If it is successful // we are good to go. If we get a redirect // to login instead, we know the cookie is invalid cy.request({ url: '/sqleditor', failOnStatusCode: false, followRedirect: false, headers: { cookie:
    access=${cookie.value}
    , }, }) .its('status') .then((status) => status === 200) }, recreate(cookie) { cy.setCookie('access', cookie.value) cy.visit('/sqleditor') }, dependsOn: ['user'], }) }); after(() => { cy.clearCookies() Cypress.session.clearAllSavedSessions(); });
  • g

    gray-kilobyte-89541

    06/24/2022, 11:17 AM
    it is hard to say why or what is going on. What do you mean it does not work every time? Does it fail? Where? What is the error? Have you inspected the calls to see where it fails?
  • a

    adorable-stone-42197

    06/24/2022, 11:22 AM
    error: error: cannot find data session "user" session "logged in" depends on cypress now i changed that name and depends on have exactly same name and test passing and sometimes fail
  • g

    gray-kilobyte-89541

    06/24/2022, 12:12 PM
    do you have a data session named
    user
    ?
  • a

    adorable-stone-42197

    06/24/2022, 12:52 PM
    beforeEach(() => { cy.dataSession({ name: 'user', setup() { cy.login() cy.getCookie('access') }, validate(cookie) { // try making a request with the cookie value // to a protected route. If it is successful // we are good to go. If we get a redirect // to login instead, we know the cookie is invalid cy.request({ url: '/sqleditor', failOnStatusCode: false, followRedirect: false, headers: { cookie:
    access=${cookie.value}
    , }, }) .its('status') .then((status) => status === 200) }, recreate(cookie) { cy.setCookie('access', cookie.value) cy.visit('/sqleditor') }, dependsOn: ['user'], }) }); after(() => { cy.clearCookies() Cypress.session.clearAllSavedSessions(); });
  • a

    adorable-stone-42197

    06/24/2022, 12:52 PM
    I put user cy.DataSession?
  • g

    gray-kilobyte-89541

    06/24/2022, 12:54 PM
    and the error says "user session not found"?
  • g

    gray-kilobyte-89541

    06/24/2022, 12:54 PM
    why do you clear all saved data sessions?
  • a

    adorable-stone-42197

    06/24/2022, 12:55 PM
    Yes, sometimes it pass and sometimes not
  • g

    gray-kilobyte-89541

    06/24/2022, 12:56 PM
    ok, it is hard to say why the session is not there, but clearing all of them maybe the problem. I would not clear the data sessions
  • a

    adorable-stone-42197

    06/24/2022, 12:57 PM
    I can send you private my code. And workaround for this is before(() => { cy.clearCookies(); }) beforeEach(() => { cy.session('login once', () => { cy.login(); }); }); after(() => { cy.clearCookies() cy.getCookies().should('be.empty') });
  • g

    gray-kilobyte-89541

    06/24/2022, 1:05 PM
    Please don't šŸ™‚ try to create a reproducible example or trace what the sessions are doing https://github.com/bahmutov/cypress-data-session#debugging and https://github.com/bahmutov/cypress-data-session#global-methods
1...585960...192Latest