-
Notifications
You must be signed in to change notification settings - Fork 164
chore(tests): move from testcafe to playwright #2088
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f7dc98d
move testcafe tests to playwright
hpouillot 633ec94
add env variables
hpouillot 3539d4e
remove unused workflow
hpouillot 6484238
fix script path
hpouillot 51745c2
fix script
hpouillot 7a28d7c
fix event count
hpouillot a448c32
fix artifact name
hpouillot 529bf3f
add playwright fixtures
hpouillot 42610ee
convert tests using fixtures
hpouillot 4dabf14
add mock-server
hpouillot a3f429b
udpate surveys
hpouillot dff181a
update session recording
hpouillot 6e336d1
add integration config
hpouillot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Playwright Tests | ||
|
||
on: [pull_request] | ||
|
||
env: | ||
POSTHOG_PROJECT_KEY: "${{ secrets.POSTHOG_PROJECT_KEY }}" | ||
POSTHOG_API_KEY: "${{ secrets.POSTHOG_API_KEY }}" | ||
|
||
jobs: | ||
integration: | ||
name: Playwright - ${{ matrix.project }} | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
project: | ||
- "chromium" | ||
- "firefox" | ||
- "webkit" | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: ./.github/actions/setup | ||
- run: pnpm build | ||
working-directory: packages/browser | ||
- name: Install Playwright Browsers | ||
run: pnpm exec playwright install ${{ matrix.project }} --with-deps | ||
working-directory: packages/browser | ||
- name: Run Playwright tests | ||
run: pnpm exec playwright test --project ${{ matrix.project }} | ||
working-directory: packages/browser | ||
timeout-minutes: 10 | ||
env: | ||
WITH_INGESTION_CHECKS: true | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
RUN_ID: ${{ github.run_id }} | ||
BROWSER: ${{ matrix.project }} | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report-${{ matrix.project }} | ||
path: packages/browser/playwright-report/ | ||
retention-days: 30 |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ cypress/downloads/downloads.html | |
/blob-report/ | ||
/playwright/.cache/ | ||
/stats | ||
/playwright/ingestion/*.results.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,13 +28,13 @@ | |
"test:typecheck": "cd src/__tests__ && tsc --noEmit --project tsconfig.json", | ||
"typecheck": "tsc --noEmit --project tsconfig.json", | ||
"playwright": "pnpm exec playwright test --project webkit --project firefox --project chromium", | ||
"playwright:integration": "pnpm exec playwright test --config=playwright.config.integration.ts --project webkit --project firefox --project chromium", | ||
"playwright-ui": "pnpm exec playwright test --ui --project webkit --project firefox --project chromium", | ||
"playwright-webserver": "npx http-server ./ -p 8082", | ||
"playwright:surveys": "pnpm exec playwright test playwright/surveys/* --project webkit --project firefox --project chromium", | ||
"playwright:surveys:ui": "pnpm exec playwright test playwright/surveys/* --ui --project webkit --project firefox --project chromium", | ||
"prepare": "[ -z \"$VERCEL\" ] && husky install || echo \"Skipping husky install on vercel build\"", | ||
"deprecate-old-versions": "node scripts/deprecate-old-versions.mjs", | ||
"check-testcafe-results": "ts-node testcafe/check-testcafe-results.js", | ||
"check-api-results": "ts-node playwright/ingestion/check-api-results.ts", | ||
"run-testcafe-localhost": "node scripts/run-testcafe-localhost.mjs", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. logic: This script still references TestCafe and should be removed or updated for Playwright |
||
"write-mangled-property-names": "WRITE_MANGLED_PROPERTIES=1 pnpm build-rollup", | ||
"gen-specs": "pnpm exec tsc && pnpm exec api-extractor run --config ./api-extractor.json --local", | ||
|
@@ -84,6 +84,7 @@ | |
"@testing-library/dom": "^9.3.0", | ||
"@testing-library/jest-dom": "^6.5.0", | ||
"@testing-library/preact": "^3.2.4", | ||
"@types/express": "^5.0.3", | ||
"@types/jest": "^27.5.2", | ||
"@types/node": "^22.5.0", | ||
"@types/react-dom": "^18.0.10", | ||
|
@@ -94,15 +95,17 @@ | |
"compare-versions": "^6.1.0", | ||
"cssnano": "^7.0.7", | ||
"date-fns": "^3.6.0", | ||
"dotenv": "^17.2.0", | ||
"expect": "^29.7.0", | ||
"express": "^5.1.0", | ||
"fast-check": "^2.17.0", | ||
"http-server": "14.1.1", | ||
"husky": "^8.0.1", | ||
"identity-obj-proxy": "^3.0.0", | ||
"jest": "^27.5.1", | ||
"jest-environment-jsdom": "^27.5.1", | ||
"jsdom": "16.5.0", | ||
"jsdom-global": "3.0.2", | ||
"jest-environment-jsdom": "^27.5.1", | ||
"localStorage": "1.0.4", | ||
"msw": "^1.3.3", | ||
"node-fetch": "^2.6.11", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import baseConfig from './playwright.config' | ||
|
||
/** | ||
* Read environment variables from file. | ||
* https://github.com/motdotla/dotenv | ||
*/ | ||
import dotenv from 'dotenv' | ||
import path from 'path' | ||
import fs from 'fs' | ||
|
||
if (fs.existsSync(path.resolve(__dirname, '.env'))) { | ||
dotenv.config({ path: path.resolve(__dirname, '.env') }) | ||
} | ||
|
||
export default { | ||
...baseConfig, | ||
testDir: './playwright/integration', | ||
testIgnore: undefined, | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two significant changes here
i think we should still run them, just to catch the very rare risk of things being valid in the PR but not once merged
it'd be good and my instinct is faster to run them as two suites. the replay ones don't hit posthog cloud iirc and would be good to keep them clearly separate