- Clone the repo
- Install dependencies
npm install - In order to run the sample test on your local machine ensure that you have the supported browsers installed (Chrome, Firefox or Microsoft Edge).
- In order to run the sample test on BrowserStack you need to update the file browserstack.json with your username and access key.
Run Cypress sample test locally on your machine:
- Select Chrome, Firefox or Microsoft Edge browser
npm run cy:open- Use Electron browser (headless)
npm run cy:headlessRun Cypress sample test suite on BrowserStack
npm run cy:browserstackTest a sample local environment on BrowserStack
- Update file cypress.json to ignore the other sample test and only pull up the local.feature file
{
"ignoreTestFiles": ["**/samples/login.spec.js"],
"viewportWidth": 1920,
"viewportHeight": 1080
}- Update file browserstack.json to enable local testing on BrowserStack.
"connection_settings": {
"local": true,
"local_identifier": "cylocal"
},- Start BrowserStackLocal binary. You can download the file from here.
./BrowserStackLocal --key ACCESS_KEY --local-identifier cylocal- Start the HTTP Server
npm run httpServer- Run the local test on BrowserStack
npm run cy:browserstack- You can view your test run on the Automate Dashboard.
- If you wish to test a public URL you will have to undo the changes you made to the files cypress.json and browserstack.json while testing a local environment.
Here are a few important links to get you started and help you successfully integrate the CLI into your CI/CD pipelines.