Member-only story
How to write your first test in Cypress
We will use the Mocha framework to write our first test in cypress.
Mocha Framework
The Mocha framework is a JavaScript Test framework.
Head over to the Cypress documentation site and copy the Mocha framework structure code.

Structure of the Mocha Framework
There are two important keywords used in the Mocha framework; ‘describe’ and ‘it’.
- The describe’ function holds a suite of automated tests.
- The ‘it’ function holds the individual test cases.

In the example above my test suite (describe function) is named ‘My First Test’ and the single test case (it function) is called ‘Does not do much!’.
The ‘describe’ function can hold multiple test cases as per the example screenshot below of two empty test cases (no code).