Skip to Content
Documentation
QA
CypressCypress Test Runner

πŸƒβ€β™‚οΈ Working with the Cypress Test Runner

The Cypress Test Runner is the interface where you execute and monitor test cases. Follow these steps to use it effectively:

🏠 Homepage

  • When you open Cypress, you will see a Welcome to Cypress screen cypress
  • You will find two options:
    • βœ… E2E Testing (this is what we will be using; click this)
    • ❌ Component Testing (ignore this)
  • ⏳ After clicking E2E Testing, Cypress will initialize the configuration. Let it finish loading

🌐 Choosing a Browser

  • πŸ” Cypress will detect all installed browsers on your system cypress
  • ⚑It is highly recommended to choose Electron because it is built into Cypress, optimized for speed and stability
  • βœ… After selecting a browser, click Start E2E Testing
🚫
Important

🚨 If Cypress crashes during execution, try switching to a different browser (e.g., Chrome, Edge, or Firefox) to resolve compatibility issues.

πŸ–₯️ Test Runner Interface

Once Cypress launches the Test Runner, you will see the following sections:

  1. πŸ“Œ Tabs on the Left Side
    • Specs (most important; this is where you will interact with test files).
    • Runs (used for monitoring past test executions, but not needed for our use case).
    • Debug (for advanced debugging tools).
    • Settings (configuration options for Cypress).
  2. ▢️ Running a Test Case
    • Under the Specs tab, you will see a list of test files.

cypress

cypress

β—‹ Click on any test file, and it will automatically start running.

  1. πŸ”„ Switching Test Cases β—‹ Option 1: If you are inside a running test file, look at the left side before the Command Log. You will see the Specs folder section

    cypress

    β—‹ If it does not appear, click β€œSpecs” (hovering over it should say β€œExpand Specs List”)

    cypress

    β—‹ Click on any test you wish to switch to

    β—‹ Option 2: Click the Specs icon on the left navigation tab to return to the Specs tab, where you can select another test

    cypress cypress

  2. πŸƒβ€β™‚οΈUnderstanding the Test Execution β—‹ Command Log (Left Side): Displays a step-by-step log of Cypress commands being executed. The contents of this log will be explained further in the Working with Test Cases section

    cypress

    β—‹ Test Status Menu (Above the Command Log):

    cypress

    • βœ… Shows a βœ” check mark (indicating successful test cases)
    • ❌ Shows a ❌ X mark (indicating failed test cases)
    • To the right of these, there is a ⏹ Stop Button to halt the test execution
    • If a test is stopped, a πŸ”„ Restart Button will appear to rerun the test
  3. πŸ–₯️ App Preview (Right Side) cypress

    β—‹ This section displays a live preview of the test execution

    β—‹ It simulates a real browser environment, allowing you to see interactions in real-time

    β—‹ Any UI changes, clicks, or navigation actions performed by the test script will be reflected here

  4. ❌ Closing the Test Runner β—‹ Once you are done running tests, you can close the Cypress Test Runner:

    β—‹ Use Ctrl + C in the terminal of Visual Studio Code, or simply close the Test Runner window by clicking the Close button in the top-right corner of the window

Last updated on