diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index c5b3690..2d66dbb 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -40,8 +40,8 @@ jobs: - name: Install dependencies run: npm ci - - name: Run Tests - uses: replayio/action-cypress@v0.1.0 + - name: Run Cypress Tests + uses: replayio/action-cypress@v0.1.1 with: browser: ${{ github.event.inputs.browser || 'Replay Firefox' }} issue-number: ${{ steps.pr-number.outputs.result }} diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index 36f61be..d26c48a 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -32,28 +32,28 @@ jobs: console.error(e); } - - name: Checkout - uses: actions/checkout@v3 + # - name: Checkout + # uses: actions/checkout@v3 - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 16 + # - name: Setup node + # uses: actions/setup-node@v3 + # with: + # node-version: 16 - - name: Install dependencies - run: npm ci + # - name: Install dependencies + # run: npm ci - # https://playwright.dev/docs/ci#github-actions - # TODO: only install Playwright browsers if project requires - - name: Install Playwright browsers - run: npx playwright install --with-deps + # # https://playwright.dev/docs/ci#github-actions + # # TODO: only install Playwright browsers if project requires + # - name: Install Playwright browsers + # run: npx playwright install --with-deps - - name: Run Tests - uses: replayio/action-playwright@v0.4.13 - with: - project: ${{ github.event.inputs.project || 'replay-firefox' }} - issue-number: ${{ steps.pr-number.outputs.result }} - apiKey: ${{ secrets.REPLAYWORKSPACEAPIKEY }} - env: - RECORD_REPLAY_DONT_RECORD: ${{ github.event.inputs.doNotRecord && '1'}} - PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url || 'https://www.replayable.dev/' }} + # - name: Run Tests + # uses: replayio/action-playwright@v0.4.13 + # with: + # project: ${{ github.event.inputs.project || 'replay-firefox' }} + # issue-number: ${{ steps.pr-number.outputs.result }} + # apiKey: ${{ secrets.REPLAYWORKSPACEAPIKEY }} + # env: + # RECORD_REPLAY_DONT_RECORD: ${{ github.event.inputs.doNotRecord && '1'}} + # PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.target_url || 'https://www.replayable.dev/' }} diff --git a/cypress.config.js b/cypress.config.js new file mode 100644 index 0000000..5603b69 --- /dev/null +++ b/cypress.config.js @@ -0,0 +1,14 @@ +const { defineConfig } = require("cypress"); +const cypressReplay = require("@replayio/cypress"); + +module.exports = defineConfig({ + e2e: { + baseUrl: "http://localhost:3000", + screenshotOnRunFailure: false, + video: false, + setupNodeEvents(on, config) { + cypressReplay.default(on, config); + return config; + }, + }, +}); diff --git a/package-lock.json b/package-lock.json index 1144f18..1cd8629 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "name": "gotbugs", "dependencies": { "@playwright/test": "1.19", + "@replayio/cypress": "^0.2.1", "@replayio/playwright": "^0.2.11", "dotenv": "^16.0.1", "next": "12.0.3", @@ -1751,6 +1752,18 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" }, + "node_modules/@replayio/cypress": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@replayio/cypress/-/cypress-0.2.2.tgz", + "integrity": "sha512-4puJRKqJWn5+XBvetNDuCdpPFUFD4ZI5itdR9/nOwBy4PtMItPPH4S80yxvJev3JROX5pbm1LJzceqSHG0lk7Q==", + "hasInstallScript": true, + "dependencies": { + "@replayio/replay": "^0.4.4" + }, + "bin": { + "replayio-cypress": "bin/replayio-cypress.js" + } + }, "node_modules/@replayio/playwright": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/@replayio/playwright/-/playwright-0.2.11.tgz", @@ -1768,9 +1781,9 @@ } }, "node_modules/@replayio/replay": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@replayio/replay/-/replay-0.4.3.tgz", - "integrity": "sha512-BfXLUYPCL6XCxOHy3zJ0U4HxfO25yYhbCuMq1T5wrlqGwdiPJeg2s5bH8oN+m/4hPXoh+bPMKR+KYnj2XVaQFw==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@replayio/replay/-/replay-0.4.4.tgz", + "integrity": "sha512-9/JqnwcAqHU1HbVyUXYuf0ZmsxFRQX2THfhbsK2C65LpSUJoII8cKJmLnmazxHf06DzK4aLtWGQAUGB9DqOmIg==", "dependencies": { "@replayio/sourcemap-upload": "^1.0.1", "commander": "^7.2.0", @@ -8498,6 +8511,14 @@ } } }, + "@replayio/cypress": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@replayio/cypress/-/cypress-0.2.2.tgz", + "integrity": "sha512-4puJRKqJWn5+XBvetNDuCdpPFUFD4ZI5itdR9/nOwBy4PtMItPPH4S80yxvJev3JROX5pbm1LJzceqSHG0lk7Q==", + "requires": { + "@replayio/replay": "^0.4.4" + } + }, "@replayio/playwright": { "version": "0.2.11", "resolved": "https://registry.npmjs.org/@replayio/playwright/-/playwright-0.2.11.tgz", @@ -8508,9 +8529,9 @@ } }, "@replayio/replay": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@replayio/replay/-/replay-0.4.3.tgz", - "integrity": "sha512-BfXLUYPCL6XCxOHy3zJ0U4HxfO25yYhbCuMq1T5wrlqGwdiPJeg2s5bH8oN+m/4hPXoh+bPMKR+KYnj2XVaQFw==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@replayio/replay/-/replay-0.4.4.tgz", + "integrity": "sha512-9/JqnwcAqHU1HbVyUXYuf0ZmsxFRQX2THfhbsK2C65LpSUJoII8cKJmLnmazxHf06DzK4aLtWGQAUGB9DqOmIg==", "requires": { "@replayio/sourcemap-upload": "^1.0.1", "commander": "^7.2.0", diff --git a/package.json b/package.json index bafc9fd..1b39567 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "@playwright/test": "1.19", + "@replayio/cypress": "^0.2.1", "@replayio/playwright": "^0.2.11", "dotenv": "^16.0.1", "next": "12.0.3",