/
Cypress Basic Commands

Cypress Basic Commands

Here are a few commands we are using in all our tests, hopefully, you find them useful when starting with test automation. Note the naming convention for tests is testname.spec.js, please use it when you are creating your tests.

 

describe() - key word for test set, can contain more than one test

it() - key word for test - this is the part where you put your code for your test case

beforeEach() - function which will be run before each test in the describe structure

cy.get() - selecting an element on the page according to an element you choose

cy.url() - defines url for web page we will open for the test

cy.visit() - open a web page for testing, usually in Chrome browser

cy.waitForSpinner() - added pfx command, wait till the window is loaded

cy.contains() - selecting an element according to a specific value

 

Related content