eager-airplane-22433
11/07/2022, 2:14 PMfresh-doctor-14925
11/07/2022, 2:20 PMbeforeEach()
instead of a before()
? Using the before()
step means it's only done once before the spec file runs, rather than once for each it()
eager-airplane-22433
11/07/2022, 2:26 PMbeforeEach()
but that's intentional so that we can reset the state of the local chain between tests. The problem is that the module to loaded several times and that means all the hooks run several times as well, where instead I'd only expect them to run onceeager-airplane-22433
11/07/2022, 2:27 PMconsole.log("e2e", Math.random())
It should only get run once, but I can see it being run several times when reloading the page or when switching between specsfresh-doctor-14925
11/07/2022, 2:40 PMeager-airplane-22433
11/07/2022, 2:54 PMfresh-doctor-14925
11/07/2022, 4:55 PMbefore()
. Though I'd need to see some code before I can provide any more specific helpmysterious-belgium-25713
11/07/2022, 5:40 PMstale-optician-85950
11/07/2022, 8:42 PMuser
11/07/2022, 10:58 PMcalm-barista-24237
11/08/2022, 3:02 AMcy.doEmailLogin(Cypress.env('userNameEmail'), Cypress.env('passwordEmail'));
cy.wait(10000);
cy.get("#secondaryButton").then((el) => { #Failing at this step
el.trigger('click')
});
cy.get('[data-action=openMenu]').click({ force: true });
cy.get('[data-section=signed-in-user]').should('be.exist');
Please find attached page DOM screenshots:-bitter-fountain-36713
11/08/2022, 4:33 AMcrooked-article-40397
11/08/2022, 6:16 AMstale-wire-41120
11/08/2022, 6:20 AMgray-helmet-2693
11/08/2022, 7:13 AMhttps://**
which will match with everything, will it check the first request only or all of them ?fresh-doctor-14925
11/08/2022, 8:06 AMintercept
is told otherwise, it will intercept all requests and not just the firstgray-helmet-2693
11/08/2022, 11:30 AMcy.get('@req').its('response.body').should('not.eq', [])
shouldnt this be a fail ?fresh-doctor-14925
11/08/2022, 11:32 AMnot.deep.equal
gray-helmet-2693
11/08/2022, 11:36 AMbright-park-76512
11/08/2022, 2:40 PMgray-kilobyte-89541
11/08/2022, 2:56 PMcy.get(network request alias)
assumes the request has already happened. The difference from cy.wait
and cy.get
is one of the nice tiny bits of knowledge covered in my course https://cypress.tips/courses/network-testinglimited-barista-33480
11/08/2022, 4:30 PMnutritious-kilobyte-67622
11/09/2022, 12:34 AMbright-park-76512
11/09/2022, 4:34 AMbright-park-76512
11/09/2022, 7:51 AMfresh-doctor-14925
11/09/2022, 8:51 AMnutritious-analyst-96582
11/09/2022, 8:51 AMpurple-sandwich-78115
11/09/2022, 11:18 AMpurple-sandwich-78115
11/09/2022, 11:21 AMgray-kilobyte-89541
11/09/2022, 11:36 AM