Skip to content

Commit

Permalink
updated documentation
Browse files Browse the repository at this point in the history
fixed typos
  • Loading branch information
roicarrera committed Nov 15, 2024
1 parent 3e35b85 commit 3f51c8a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
21 changes: 16 additions & 5 deletions docs/modules/quickstarters/pages/e2e-cypress.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions e2e-cypress/Jenkinsfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion e2e-cypress/files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3f51c8a

Please sign in to comment.