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.
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.
Yashprabha says
Do you run any cypress course please?
Mukesh Otwani says
I had one course last year in June but after that no new batches after that.