This npm package includes functions and custom Cypress commands shared between different Rancher products.
Installation can be done with CLI:
npm install @rancher-ecp-qa/cypress-library
Or you can add the package to your package.json file:
"dependencies": {
"@rancher-ecp-qa/cypress-library": "1.0.0"
}
For Cypress configuration, I add this line to the e2e.ts
file:
require('@rancher-ecp-qa/cypress-library');
The tsconfig.json
file must be also updated with the new package:
"types": [
"@types/node",
"@nuxt/types",
"cypress",
"cy-verify-downloads",
"@rancher-ecp-qa/cypress-library",
"cypress-file-upload"
]
Finally, import the package in your Cypress spec file where you want to use it:
import * as cypressLib from '@rancher-ecp-qa/cypress-library';`