late-planet-4481
06/28/2022, 3:21 PMmysterious-sandwich-43667
06/28/2022, 3:45 PMsalmon-river-93816
06/28/2022, 3:47 PMswift-controller-90067
06/28/2022, 4:06 PMelegant-cat-47750
06/28/2022, 4:07 PMswift-angle-95455
06/28/2022, 4:53 PM@hapi/iron
, it looks like Cypress' webpack can't compile "nullish coalescing" feature, what is the way to proceed?swift-angle-95455
06/28/2022, 5:13 PMhapiiron
purple-kilobyte-85592
06/28/2022, 5:45 PMdazzling-thailand-64429
06/28/2022, 7:43 PMdazzling-thailand-64429
06/28/2022, 7:45 PMlively-match-61863
06/29/2022, 6:34 AMClickableRow: '[aria-colindex="5"]'
gentle-accountant-4760
06/29/2022, 7:55 AMts
Suite('My First Test', () => {
before(() => {
prepare();
cy.visit('https://barrythrill.com');
cy.get('.start-from-zero').should('be.visible').click();
...
});
Scenario('My first test cases', () => {
Given('we are on the webpage');
When('we save the list', () => {
// no cy.visit
... // we save the list it will automatically login and it creates a cookie called BAR (has a dynamic cookie)
});
Then('we are able to open all-list and close it', () => {
... // no cy.visit
});
When('we remove the list through API', () => {
... // no cy.visit
});
Then('we should still be logged it', () => {
... // cy.visit(''https://barrythrill.com')
// We should still be logged in through ` When('we save the list', ()`
});
});
});
I was not able to figure out how I can use cy.session here or to create a correct tests for my test cases. I wonder if anyone here can help me on either how I can improve my code where I can still be logged in through whole test or how I can implement cy.session without needing to call cy.visit for each it
?powerful-apple-75460
06/29/2022, 8:27 AMnpm i @cypress/react
? please help.salmon-river-93816
06/29/2022, 9:05 AMswift-kitchen-62493
06/29/2022, 12:14 PMswift-kitchen-62493
06/29/2022, 12:14 PMswift-kitchen-62493
06/29/2022, 12:14 PMbumpy-library-92619
06/29/2022, 12:52 PMbumpy-library-92619
06/29/2022, 12:54 PMbumpy-library-92619
06/29/2022, 12:54 PMbumpy-library-92619
06/29/2022, 12:56 PMlate-twilight-22806
06/29/2022, 1:48 PMrough-area-43356
06/29/2022, 2:27 PMfresh-doctor-14925
06/29/2022, 2:47 PMwithin()
is a fairly self-explanatory API, so it shouldn't be too difficult to see what's up
2) If you're wanting to have selectable elements that are resilient to code changes, don't use class based selectors. Instead, encourage your devs to add test ids to the elements (or add them yourself). See https://docs.cypress.io/guides/references/best-practices#Selecting-Elementslate-planet-4481
06/29/2022, 3:28 PM.within()
solution would look like this:
cy.get('[data-test="articleList"]').within(() => {
cy.get('article').eq(0).click()
}
bumpy-library-92619
06/29/2022, 3:40 PMbumpy-library-92619
06/29/2022, 3:43 PMswift-controller-90067
06/29/2022, 3:46 PMgray-kilobyte-89541
06/29/2022, 4:21 PMswift-angle-95455
06/29/2022, 4:44 PM