Cypress

Cypress CLI Commands

Cypress CLI Commands

In this post, I will show you how to use Cypress CLI commands in different way.  In order to run test on CI servers like Jenkins, Teamcity, Bamboo etc. you need to learn and understand Cypress CLI commands.

You can also use them when you run your cypress test from Github actions, Github, Azure DevOps etc.

I have a dedicated video on this on my Youtube Channel so please refer below video for the same.

Cypress CLI Commands

 

 

 

Make sure you have cypress installed correctly in your system before running CLI commands.

Get Cypress Info
npx cypress info

Verify Cypress
npx cypress verify

Cypress Version
npx cypress version

 

Run all spec files
npx cypress run

Run specific test from cmd
npx cypress run –spec “cypress\integration\testscripts\Login.spec.js”

Run multiple spec file from cmd
npx cypress run –spec “cypress\integration\testscripts\Login.spec.js,cypress\integration\testscripts\FirstCypress.spec.js”

Run using wildcard *
npx cypress run –spec “cypress\integration\**\regression*”

Run with headed mode and noexit flag
npx cypress run –headed –no-exit –spec “cypress\integration\testscripts\Login.spec.js”

Run on chrome browser
npx cypress run –browser chrome –spec “cypress\integration\testscripts\Login.spec.js”

Run on edge with headed mode on
npx cypress run –browser edge –headed –spec “cypress\integration\testscripts\Login.spec.js”

Run on firefox with headed mode on
npx cypress run –browser firefox –headed –spec “cypress\integration\testscripts\Login.spec.js”

To update browser list
npx browserslist@latest –update-db

If you face any issue while executing above commands then feel free to comment below.

 

author-avatar

About Mukesh Otwani

I am Mukesh Otwani working professional in a beautiful city Bangalore India. I completed by BE from RGPV university Bhopal. I have passion towards automation testing since couple of years I started with Selenium then I got chance to work with other tools like Maven, Ant, Git, GitHub, Jenkins, Sikuli, Selenium Builder etc.

2 thoughts on “Cypress CLI Commands

  1. Yashprabha says:

    Do you run any cypress course please?

    1. I had one course last year in June but after that no new batches after that.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.