-
Notifications
You must be signed in to change notification settings - Fork 1
tests: Both Guidepup tests work! #39
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
Changes from all commits
a9998ed
e4443d0
23b76be
dca1e14
8609eb1
cc120c6
4691aa5
3545321
1aa8481
8eb38c2
1ab78ba
12e6d6c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,7 @@ const test = baseTest.extend({ | |||||||||||
| route.fulfill({ | ||||||||||||
| path: path.join( | ||||||||||||
| import.meta.dirname, | ||||||||||||
| "..", | ||||||||||||
| "../..", | ||||||||||||
| new URL(request.url()).pathname | ||||||||||||
| ), | ||||||||||||
| }) | ||||||||||||
|
|
@@ -44,10 +44,6 @@ if (process.platform === "darwin") { | |||||||||||
| await page.locator("body").waitFor(); | ||||||||||||
| await page.locator("body").focus(); | ||||||||||||
|
|
||||||||||||
| // Navigate to the beginning of the web content. | ||||||||||||
| await voiceOver.interact(); | ||||||||||||
| await voiceOver.perform(voiceOver.keyboardCommands.jumpToLeftEdge); | ||||||||||||
|
|
||||||||||||
| // Clear out logs. | ||||||||||||
| await voiceOver.clearItemTextLog(); | ||||||||||||
| await voiceOver.clearSpokenPhraseLog(); | ||||||||||||
|
|
@@ -59,6 +55,13 @@ if (process.platform === "darwin") { | |||||||||||
| }); | ||||||||||||
|
|
||||||||||||
| test("SuggestedText", async ({ page }) => { | ||||||||||||
| // Wait for page to load | ||||||||||||
| await page.waitForTimeout(500); | ||||||||||||
|
|
||||||||||||
| // Focus the textarea and wait for VoiceOver cursor to move there | ||||||||||||
| await page.getByRole("textbox", { name: "Add a comment" }).click(); | ||||||||||||
| await page.waitForTimeout(500); | ||||||||||||
|
Comment on lines
+62
to
+63
|
||||||||||||
| await page.getByRole("textbox", { name: "Add a comment" }).click(); | |
| await page.waitForTimeout(500); | |
| const commentTextbox = page.getByRole("textbox", { name: "Add a comment" }); | |
| await commentTextbox.click(); | |
| await expect(commentTextbox).toBeFocused(); |
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.
Using hard-coded timeouts with waitForTimeout is an anti-pattern that can lead to flaky tests. Consider using more reliable waiting strategies such as waiting for specific elements, network requests, or state changes. For example, you could wait for the textarea to be ready using waitFor with a specific state or condition.