Skip to content

Commit

Permalink
re add cypress
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonLaster committed Jun 30, 2022
1 parent 4714163 commit bf0f492
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/' }}
14 changes: 14 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -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;
},
},
});
33 changes: 27 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bf0f492

Please sign in to comment.