Hello everyone, in my previous blog we discussed how we can integrate our cypress tests with Jenkins. In this blog, we will discuss how we can parametrized build execution with Jenkins.

In Cypress, we can parameterize our tests, with the help of scripts.

For achieving parameterization in cypress we can add scripts in our package.json file with all the required commands.

We can use following script for reference

{
  "name": "CypressTestDemo",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "keywords": [],
  "scripts": {
    "test": "npx cypress run",
    "headedTest":"npm run test --headed",
    "chromeTest":"npm run test --browser chrome",
    "recordDashboardReport":"npm run test --record --key b01d0016-e848-4141-abb9-a8ae5e7be6af"
  },
    "author": "",
  "license": "ISC",
  "devDependencies": {
    "cypress": "^4.7.0",
    "mocha": "7.2.0",
    "mochawesome": "6.1.1",
    "mochawesome-merge": "4.1.0",
    "mochawesome-report-generator": "5.1.0"
  },
  "dependencies": {
    "mocha": "7.2.0"
  }
}

#jenkins #tech blogs #testing #cypress.io #jenkins ci/cd

Cypress: Parametrized build execution with Jenkins
11.50 GEEK