Skip to content
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

chore: playwright tests #1631

Merged
merged 28 commits into from
Dec 31, 2024
Merged

chore: playwright tests #1631

merged 28 commits into from
Dec 31, 2024

Conversation

pauldambra
Copy link
Member

@pauldambra pauldambra commented Dec 27, 2024

Cypress tests don't run in browserstack because they were so slow in browserstack/multiple browsers

Which means session replay tests (and most e2e tests) are only exercised in the electron browser. But we can have e.g. safari specific bugs and would never catch them.

Since we know Cypress was annoyingly slow here let's not use it.

This PR ports all session recording tests from Cypress to Playwright

Why Playwright?

  • mind share
  • parallel tests
  • faster than cypress (Cypress ~3m46s (1 browser), Playwright ~1m30s (3 browsers) (admittedly a different number of tests))
  • by default runs tests in Chrome, Firefox, and WebKit
  • we're already using it in visual regression tests

Copy link

vercel bot commented Dec 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Dec 29, 2024 3:00pm

Copy link

github-actions bot commented Dec 27, 2024

Size Change: +560 B (+0.02%)

Total Size: 3.22 MB

Filename Size Change
dist/array.full.es5.js 262 kB +56 B (+0.02%)
dist/array.full.js 365 kB +56 B (+0.02%)
dist/array.full.no-external.js 364 kB +56 B (+0.02%)
dist/array.js 179 kB +56 B (+0.03%)
dist/array.no-external.js 178 kB +56 B (+0.03%)
dist/main.js 180 kB +56 B (+0.03%)
dist/module.full.js 365 kB +56 B (+0.02%)
dist/module.full.no-external.js 364 kB +56 B (+0.02%)
dist/module.js 179 kB +56 B (+0.03%)
dist/module.no-external.js 178 kB +56 B (+0.03%)
ℹ️ View Unchanged
Filename Size
dist/all-external-dependencies.js 206 kB
dist/customizations.full.js 12.6 kB
dist/dead-clicks-autocapture.js 14.4 kB
dist/exception-autocapture.js 9.48 kB
dist/external-scripts-loader.js 2.64 kB
dist/recorder-v2.js 115 kB
dist/recorder.js 115 kB
dist/surveys-preview.js 57.6 kB
dist/surveys.js 63.3 kB
dist/tracing-headers.js 1.76 kB
dist/web-vitals.js 10.4 kB

compressed-size-action

@@ -1323,6 +1323,7 @@ export class SessionRecording {
* */
public overrideLinkedFlag() {
this._linkedFlagSeen = true
this._tryTakeFullSnapshot()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genuine bug for this luckily pretty rarely called method

@@ -1337,6 +1338,7 @@ export class SessionRecording {
// short-circuits the `makeSamplingDecision` function in the session recording module
[SESSION_RECORDING_IS_SAMPLED]: true,
})
this._tryTakeFullSnapshot()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genuine bug for this luckily pretty rarely called method

Copy link

@ioannisj ioannisj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume no issues with tests means we are 👍

@pauldambra pauldambra merged commit 912e97d into main Dec 31, 2024
29 checks passed
@pauldambra pauldambra deleted the chore/playwright-tests branch December 31, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants