Test Overview
This test checks if Node.js is installed and accessible by running a simple command in the terminal. It verifies that the Node.js version is displayed, confirming the prerequisite is met for running Cypress tests.
This test checks if Node.js is installed and accessible by running a simple command in the terminal. It verifies that the Node.js version is displayed, confirming the prerequisite is met for running Cypress tests.
describe('Node.js Prerequisite Check', () => { it('should confirm Node.js is installed by checking version output', () => { cy.exec('node -v').then((result) => { expect(result.code).to.equal(0); expect(result.stdout).to.match(/^v\d+\.\d+\.\d+/); }); }); });
| Step | Action | System State | Assertion | Result |
|---|---|---|---|---|
| 1 | Test starts | Cypress test runner is ready | - | PASS |
| 2 | Runs command 'node -v' using cy.exec | Terminal executes Node.js version command | Check that command exit code is 0 (success) | PASS |
| 3 | Receives output from 'node -v' command | Output contains Node.js version string like 'v18.15.0' | Verify output matches version pattern /^v\d+\.\d+\.\d+/ | PASS |
| 4 | Test ends with all assertions passed | Node.js version confirmed, prerequisite met | - | PASS |