Skip to content

Latest commit

 

History

History
67 lines (39 loc) · 1.4 KB

03-executing-tests.md

File metadata and controls

67 lines (39 loc) · 1.4 KB

🖥️ Commands for Cypress Execution

Use the following commands to run your Cypress tests based on your needs:


1. Run All Spec Files (Headless - Default Electron)

npx cypress run

Execution-1.1

Execution-1.2

Note: Runs all tests in headless mode using the Electron browser.


2. Run a Specific Spec File (Headless)

npx cypress run --spec cypress\e2e\demo_file.cy.js

Execution-2.1

Execution-2.2

Note: Replace the path with your spec file’s relative path.


3. Run a Specific Spec File in a Specific Browser (Headless)

npx cypress run --spec cypress\e2e\demo_file.cy.js --browser electron

Execution-3.1

Execution-3.2

Note: Available browsers: chrome, electron, firefox, edge


4. Run All Spec Files With Browser UI (Default Electron)

npx cypress run --headed

Execution-4

Note: --headed opens the browser instead of running in the terminal.


5. Run a Specific Spec File With Browser UI (Headed)

npx cypress run --headed --spec cypress\e2e\demo_file.cy.js --browser edge

Execution-5