Objective: Create a new spec in Cypress using JavaScript.
Steps:
Assuming you've successfully installed Cypress and opened Cypress now it's time to add your first test. We're going to do this with the Create new empty spec button.
Open Cypress for the first time to create the default folder structure:
npx cypress open
Create a New Spec File
cypress/e2e
folder .For Example:
File_name.cy.js
Even though we haven't written any code yet - that's okay - let's click on your new spec and watch Cypress launch it. Cypress will visit https://example.cypress.io
and the test passes.
Objective: Testing the Quotation List on Demo Lens with Login
1.Log In to Demo Lens:
2.Select a Quotation:
3.Verify Quotation Details:
4.Exit Quotation Details:
Hints :
Element Selectors:
data-testid
for selectors..find()
, .first()
, etc.Assertions:
.should('be.visible')
to verify element presence.