Navigate to Your Project Directory: Open your command prompt or terminal and navigate to the root directory of your Cypress project.
2. Run the Command: Use the following command to execute Cypress tests:
npx cypress open
This command will open the Cypress Test Runner, allowing you to select and run your test files interactively.
If you want to run tests in headless mode (without the interactive Test Runner UI), you can use:
npx cypress run
3. Select the Test File: In the Test Runner, select the test file you want to run from the list of available test files.
4. Run Tests: Click on the test file name to run the tests within that file.
Remember, before using the command-line approach, ensure that you have Cypress installed in your project by running npm install cypress or yarn add cypress, depending on your package manager.