diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78b5301..3b928f4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,6 +3,12 @@ name: Tests on: # Triggers the workflow manually from the GitHub Actions tab workflow_dispatch: + inputs: + sorry_cypress: + description: 'Choose whether to send results to Sorry-Cypress' + required: true + default: 'false' + # Runs the workflow on every push to the repository push: # Runs the workflow on every push to the repository @@ -16,6 +22,7 @@ on: env: NODE_VERSION: 20.10.0 + SORRY_CYPRESS_DIRECTOR_URL: ${{ secrets.SORRY_CYPRESS_DIRECTOR_URL}} # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: @@ -66,14 +73,18 @@ jobs: npx cypress cache list npx cypress cache path - - uses: cypress-io/github-action@v6 + continue-on-error: true with: install: false build: npm run cy:info wait-on-timeout: 180 browser: ${{ matrix.browser }} config-file: cypress.config.js + spec: cypress/e2e/1-getting-started/todo.cy.js + command: | + npx cypress-cloud run --browser ${{ matrix.browser }} --parallel --record --key ${{ secrets.SORRY_CYPRESS_RECORD_KEY }} --ci-build-id ${{ github.run_id }} + env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} DEBUG: 'cypress:server:args' diff --git a/.gitignore b/.gitignore index 2a44aeb..865b4e6 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,7 @@ dist runner-results cypress/screenshots cypress/videos -cypress/reports \ No newline at end of file +cypress/reports +data +docker-compose.minio.yml +.$sorry-cypress-arch.drawio.bkp \ No newline at end of file diff --git a/README.md b/README.md index 023856a..d10e81a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ This project integrates Cypress with Sorry-Cypress an open-source, on-premise, s $ npm install ``` -## Running Tests +## Running Cypress Tests ```bash # Run Tests with Cypress Runner @@ -20,6 +20,13 @@ $ npm run cypress:open $ npm run cypress:run ``` +## Cypress Test Report + +- [Cypress Report Home Page](https://hamza-lem.github.io/cy-sorry-cypress-dashboard/) +- [Cypress Chrome Report](https://hamza-lem.github.io/cy-sorry-cypress-dashboard/chrome/chrome-report/html/index.html) +- [Cypress Electron Report](https://hamza-lem.github.io/cy-sorry-cypress-dashboard/electron/electron-report/html/index.html) +- [Cypress Edge Report](https://hamza-lem.github.io/cy-sorry-cypress-dashboard/edge/edge-report/html/index.html) + ## Documentation - [Cypress docs](https://docs.cypress.io/guides/overview) diff --git a/currents.config.js b/currents.config.js index 45bdbdc..e9c247a 100644 --- a/currents.config.js +++ b/currents.config.js @@ -1,6 +1,9 @@ // currents.config.js module.exports = { - projectId: 'yyy', // the projectId, can be any values for sorry-cypress users - recordKey: 'xxx', // the record key, can be any value for sorry-cypress users - cloudServiceUrl: 'http://localhost:1234', // Sorry Cypress users - set the director service URL + // projectId should match the projectId value used in Sorry-Cypress. + projectId: 'cy-sorry-cypress-dashboard', + // Record key, can be any value. + recordKey: 'cy-key', + // Director service URL + cloudServiceUrl: process.env.SORRY_CYPRESS_DIRECTOR_URL, }; diff --git a/cypress.config.js b/cypress.config.js index 3470c56..978b46d 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,8 +1,9 @@ -const { defineConfig } = require("cypress"); -const { cloudPlugin } = require("cypress-cloud/plugin"); +const { defineConfig } = require('cypress'); +const { cloudPlugin } = require('cypress-cloud/plugin'); -module.exports = defineConfig ({ +module.exports = defineConfig({ video: true, + videoUploadOnPasses: false, retries: 1, reporter: 'cypress-mochawesome-reporter', reporterOptions: { diff --git a/cypress/e2e/1-getting-started/todo.cy.js b/cypress/e2e/1-getting-started/todo.cy.js index c7e75a1..d409c78 100644 --- a/cypress/e2e/1-getting-started/todo.cy.js +++ b/cypress/e2e/1-getting-started/todo.cy.js @@ -137,7 +137,10 @@ describe(`example to-do app - ${Cypress.browser.name}`, () => { .should('not.have.text', 'Pay electric bill'); // Finally, make sure that the clear button no longer exists. - cy.contains('Clear completed').should('not.exist'); + let result = ['not.exist', 'exist']; + cy.contains('Clear completed').should( + result[Math.floor(Math.random() * 2)], + ); }); }); }); diff --git a/cypress/fixtures/profile.json b/cypress/fixtures/profile.json index b6c355c..a95e88f 100644 --- a/cypress/fixtures/profile.json +++ b/cypress/fixtures/profile.json @@ -2,4 +2,4 @@ "id": 8739, "name": "Jane", "email": "jane@example.com" -} \ No newline at end of file +} diff --git a/cypress/fixtures/users.json b/cypress/fixtures/users.json index 79b699a..82a0056 100644 --- a/cypress/fixtures/users.json +++ b/cypress/fixtures/users.json @@ -229,4 +229,4 @@ "bs": "target end-to-end models" } } -] \ No newline at end of file +] diff --git a/package.json b/package.json index 6db2eb2..6b468ee 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,10 @@ "cy:run:chrome": "cypress run --browser chrome", "cy:run:edge": "cypress run --browser edge", "cy:run:electron": "cypress run --browser electron", + "cy:run:sorry-cypress": "cypress-cloud run --parallel --key cy-key --ci-build-id Run#01", + "cy:run:sorry-cypress:chrome": "cypress-cloud run --browser chrome --parallel", + "cy:run:sorry-cypress:edge": "cypress-cloud run --browser edge --parallel", + "cy:run:sorry-cypress:electron": "cypress-cloud run --browser electron --parallel", "cy:run:parallel": "cypress-parallel -s cypress run -t 2 -d 'cypress/e2e/**/*.cy.js' -o 'cypressParallel=true'", "cy:open-report": "open cypress/reports/html/index.html" }, diff --git a/sorry-cypress-arch.drawio b/sorry-cypress-arch.drawio new file mode 100644 index 0000000..2f3bd28 --- /dev/null +++ b/sorry-cypress-arch.drawio @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sorry-cypress-arch.jpg b/sorry-cypress-arch.jpg new file mode 100644 index 0000000..47f4b74 Binary files /dev/null and b/sorry-cypress-arch.jpg differ