-
Notifications
You must be signed in to change notification settings - Fork 892
chore: add e2e tests for basic template and workspace flow #5637
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
Conversation
Remove saved auth state because it wasn't working
Can't see if they work yet, waiting on a release
Socket Security Pull Request ReportDependency issues detected. If you merge this pull request, you will not be alerted to the instances of these issues again. 📜 Install scriptsInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts. Packages should not be running non-essential scripts during install and there are often solutions to problems people solve with install scripts that can be run at publish time instead.
😵💫 Bin script confusionThis package has multiple bin scripts with the same name. This can cause non-deterministic behavior when installing or could be a sign of a supply chain attack Consider removing one of the conflicting packages. Packages should only export bin scripts with their name
Pull request report summary
Bot CommandsTo ignore an alert, reply with a comment starting with
Powered by socket.dev |
value: string, | ||
): Promise<void> => { | ||
await page.fill(`text=${label}`, value) | ||
} |
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.
Is there a reason we made helpers for these? They seem to wrap fairly trivial built-in methods.
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.
To address this comment and the one about the constant: previously, we wrote Playwright tests with POMs, so for each page, you'd have a file with a class and methods. I started doing that here and it felt too heavy since the current plan isn't to write many e2e tests. (Although after seeing how pleasant they were to debug, I'm reconsidering that!) So instead, I just dumped everything I would normally have put in the class into these few helpers. But I agree that it's not that much easier to read and write than just inlining everything.
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.
As someone who isn't familiar with playwright, I appreciate them and makes test-authoring seem a bit easier. No strong opinions though!
@@ -0,0 +1,39 @@ | |||
import { test } from "@playwright/test" |
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.
Perhaps the file name basicFlow.spec.ts
could be more descriptive?
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.
Yeah, we discussed having one long test instead of several short ones since e2e tests tend to build on each other, and so I didn't have something really specific to name it. But again, now that I'm feeling more positive on e2e tests, we should probably talk as a team about whether we want to do more of them.
submitCreateWorkspace: "Create workspace", | ||
stopWorkspace: "Stop", | ||
startWorkspace: "Start", | ||
} |
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.
I'm not sure I would decouple this page-specific constant from the test for that page.
Super cool! I feel like I learned a bit about Playwright reading through this. Would be a great FE topic, i.e. should we be writing E2E tests for each feature? What does the organization of the E2E testing folder look like? |
Co-authored-by: Ben Potter <[email protected]>
Just noting for posterity about the Socket concerns: one is about the fact that playwright has an install script. It's had that before so I don't think it's an issue. The other is about the bin script. It says there are two scripts or two packages, but there's only one listed, so I'm not sure what's wrong. The bin script attack pattern is to name the bin script something other than the package name, but the bin script is correctly named playwright. The script itself just exports the cli module. The problem might be that it's defined in both playwright and playwright-core. |
Fixes #5238