-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Playwright basic utils #7930
Playwright basic utils #7930
Conversation
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.
PR Summary
This pull request introduces utility functions for Playwright E2E testing, focusing on environment variables management and keyboard shortcuts handling.
packages/twenty-e2e-testing/drivers/env_variables.ts
: ImplementsenvVariables
function, but lacks error handling and may expose sensitive datapackages/twenty-e2e-testing/lib/utils/keyboardShortcuts.ts
: Adds cross-platform keyboard shortcut utilities, could benefit from more flexible shortcut definitionspackages/twenty-e2e-testing/lib/utils/pasteCodeToCodeEditor.ts
: ImplementspasteCodeToCodeEditor
, but may need error handling for locator failurespackages/twenty-e2e-testing/lib/utils/uploadFile.ts
: AddsfileUploader
function, could be improved with timeout handling and file existence checks
4 file(s) reviewed, 10 comment(s)
Edit PR Review Bot Settings | Greptile
await locator.click(); | ||
await selectAllByKeyboard(page); | ||
await page.keyboard.type(code); |
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.
style: consider adding a small delay between actions to mimic human behavior more closely
) => { | ||
await locator.click(); | ||
await selectAllByKeyboard(page); | ||
await page.keyboard.type(code); |
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.
style: use page.keyboard.insertText() instead of type() for better performance with large code strings
await trigger(); | ||
const fileChooser = await fileChooserPromise; | ||
await fileChooser.setFiles( | ||
path.join(__dirname, '..', 'test_files', filename), |
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.
style: The hardcoded path to 'test_files' might not be flexible for all test setups. Consider making this configurable
const fileChooserPromise = page.waitForEvent('filechooser'); | ||
await trigger(); | ||
const fileChooser = await fileChooserPromise; |
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.
logic: Ensure the trigger is called before waiting for the file chooser event to prevent potential race conditions
/award 500 |
Awarding BOHEUS: 500 points 🕹️ Well done! Check out your new contribution on oss.gg/BOHEUS |
Related to #6641