-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from shopcanal/dgattey/fixes
feat: rewrite all tests to work without flakiness + add sharding
- Loading branch information
Showing
27 changed files
with
2,630 additions
and
2,353 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
#!/bin/sh -l | ||
|
||
BROWSER="$1" | ||
SHARD="$2" | ||
|
||
echo "Installing packages..." | ||
yarn | ||
|
||
echo "Running tests on $BROWSER..." | ||
HOME=/root yarn test --browser=$BROWSER | ||
echo "Running tests on $BROWSER (shard $SHARD)..." | ||
HOME=/root DEBUG=pw:api,pw:browser yarn test --project=$BROWSER --shard=$SHARD | ||
|
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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
import type { Page } from '@playwright/test'; | ||
|
||
/** | ||
* Intercepts requests on the page to disable requesting fonts, or any third | ||
* party resource. We do this to better control the flakiness of the tests and | ||
* avoid some third party request from affecting things. EVERY test should call | ||
* this function via a before each. | ||
*/ | ||
export const intercept = async (page: Page): Promise<void> => { | ||
await page.route( | ||
/.*(?:clarity.ms)|(?:crisp.chat)|(?:cdn.shopify)|(?:shopify.com)|(?:heapanalytics)|(?:facebook)|(?:googletagmanager)|(?:google-analytics)|(?:bing.com)|(?:stripe)|(?:sentry).*/, | ||
// eslint-disable-next-line @typescript-eslint/no-misused-promises | ||
(route) => route.abort(), | ||
); | ||
await page.route( | ||
'**.{woff2}', | ||
// eslint-disable-next-line @typescript-eslint/no-misused-promises | ||
(route) => route.abort(), | ||
); | ||
}; |
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
Oops, something went wrong.