-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve flakey E2E tests (#2351)
* fix: Improve flakey E2E tests * fix: PR comments * fix: Linting
- Loading branch information
1 parent
7d49452
commit 3474a45
Showing
14 changed files
with
68 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,37 @@ | ||
import { Browser, Page, Request } from "@playwright/test"; | ||
import { createAuthenticatedSession } from "../globalHelpers"; | ||
|
||
export const isGetUserRequest = (req: Request) => { | ||
const isHasuraRequest = req.url().includes("/graphql"); | ||
const isGetUserOperation = req.postData()?.toString().includes("GetUserById"); | ||
return Boolean(isHasuraRequest && isGetUserOperation); | ||
}; | ||
|
||
export async function getAdminPage({ | ||
browser, | ||
userId, | ||
}: { | ||
browser: Browser; | ||
userId: number; | ||
}): Promise<Page> { | ||
const page = await createAuthenticatedSession({ browser, userId }); | ||
await page.goto("/"); | ||
await page.waitForResponse((response) => { | ||
return response.url().includes("/graphql"); | ||
}); | ||
return page; | ||
} | ||
|
||
export async function getTeamPage({ | ||
browser, | ||
userId, | ||
teamName, | ||
}: { | ||
browser: Browser; | ||
userId: number; | ||
teamName: string; | ||
}): Promise<Page> { | ||
const page = await getAdminPage({ browser, userId }); | ||
await page.locator("h2", { hasText: teamName }).click(); | ||
return page; | ||
} |
This file contains 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 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 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 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 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 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 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 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 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