diff --git a/docs/modules/quickstarters/pages/e2e-cypress.adoc b/docs/modules/quickstarters/pages/e2e-cypress.adoc index e2b8f65b..e44df68f 100644 --- a/docs/modules/quickstarters/pages/e2e-cypress.adoc +++ b/docs/modules/quickstarters/pages/e2e-cypress.adoc @@ -121,20 +121,31 @@ To use Cypress Cloud within the Cypress QuickStarter, follow these steps: 3. **Set the Cypress Record Key as an environment variable in Openshift.** To enable recording of your tests in Cypress Cloud, you will need to set the Cypress Record Key as an environment variable named CYPRESS_RECORD_KEY in Openshift. This key is provided by Cypress and is used to authenticate your tests and results. By setting it in Openshift, we ensure that the record functionality will only be used in official runs and not for local development. -4. **Modify the Jenkinsfile for using the record script.** In the Jenkinsfile, change the exeuction line: +4. **Modify the Jenkinsfile for using the record script.** In the Jenkinsfile, change the exeuction lines: [source,Jenkinsfile] ---- -def status = sh(script: 'npm run e2e', returnStatus: true) +status = sh(script: 'npm run e2e', returnStatus: true) ---- -for the following block of code, which will run the record script only when in master or in a release branch: +and +[source,Jenkinsfile] +---- +status = sh(script: 'npm run e2e:prod', returnStatus: true) +---- +for the following blocks of code, which will run the record script only when in master or in a release branch: [source,Jenkinsfile] ---- if (context.gitBranch == 'master' || context.gitBranch.startsWith('release/')) { - def status = sh(script: 'npm run e2e:jenkins:record', returnStatus: true) + status = sh(script: 'npm run e2e:jenkins:record', returnStatus: true) } else { - def status = sh(script: 'npm run e2e', returnStatus: true) + status = sh(script: 'npm run e2e', returnStatus: true) } ---- +and +[source,Jenkinsfile] +---- +status = sh(script: 'npm run e2e:jenkins:record', returnStatus: true) +---- +For the case of prod environment, the master or release check is not necessary, as the prod environment is only used in releases. **Only use this functionality in releases, not development.** It is important to note that Cypress Cloud is intended for use in releases, not development. This ensures that your tests are run against stable and reliable code, and that the Dashboard does not get overflooded with non-relevant tests. For the same reason, the Jenkinsfile is configured to only pass the record parameter when running in the master branch, or in a release. diff --git a/e2e-cypress/Jenkinsfile.template b/e2e-cypress/Jenkinsfile.template index 92f2db4c..cc973ddb 100644 --- a/e2e-cypress/Jenkinsfile.template +++ b/e2e-cypress/Jenkinsfile.template @@ -45,10 +45,10 @@ odsComponentPipeline( ] ) } - if (fileExists('cypress/screenshots.zip')) { + if (fileExists('cypress/videos.zip')) { odsComponentStageUploadToNexus(context, [ - distributionFile: 'cypress/screenshots.zip', + distributionFile: 'cypress/videos.zip', repository: 'leva-documentation', repositoryType: 'raw', targetDirectory: "${targetDirectory}" diff --git a/e2e-cypress/files/package.json b/e2e-cypress/files/package.json index 1e51b9da..9eca70a2 100644 --- a/e2e-cypress/files/package.json +++ b/e2e-cypress/files/package.json @@ -17,7 +17,7 @@ "e2e:prod": "npm-run-all delete-junit-results cypress:run-installation", "combine:reports": "npm-run-all junit-installation-report junit-integration-report junit-acceptance-report", "e2e:jenkins:record": "npm run delete-junit-results && npm run cypress:run-installation -- --record && npm run cypress:run-integration -- --record && npm run cypress:run-acceptance -- --record", - "e2e:jenkins:report:prod": "npm run delete-junit-results && npm run cypress:run-installation -- --record", + "e2e:jenkins:record:prod": "npm run delete-junit-results && npm run cypress:run-installation -- --record", "generate:pdf": "ts-node ./pdf-generator.ts" }, "private": true,