powerful-toothbrush-36495
04/29/2023, 11:17 AMpowerful-toothbrush-36495
04/29/2023, 11:17 AMpowerful-toothbrush-36495
04/29/2023, 11:17 AMpowerful-toothbrush-36495
04/29/2023, 11:18 AMpowerful-toothbrush-36495
04/29/2023, 11:52 AMmany-airline-45402
04/29/2023, 2:56 PMmany-airline-45402
04/29/2023, 3:15 PMpowerful-toothbrush-36495
04/29/2023, 3:34 PMpowerful-toothbrush-36495
04/29/2023, 3:34 PMpowerful-toothbrush-36495
04/29/2023, 8:58 PMenough-truck-68085
05/01/2023, 2:46 PM#email can't be found because the test isn't on the login page at all.
You need to add a cy.visit into your login command before you can type into any elements.
I would also look slow down a bit and read up on each line to make sure you understand what is happening as there are several issues, at an initial glance
- The cy.session command isn't wrapping the actual login commands
- The selectors are wrong, compared to what I found on the saucedemo site. For instance #email is actually #username .
- You don't need to .click on an input field. You can just .type, etc
I'd recommend taking a high-level course first or using a test repo which already has some working code to help you walkthrough what is happening at each step.
https://docs.cypress.io/examples/media/courses-media
https://github.com/cypress-io/cypress-realworld-app
https://cdn.discordapp.com/attachments/1101829596418154546/1102606877226979469/image.pngâ–¾