-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[E2E] [QA] Optimizing playwright setup and playwright.config.ts files #4741
Changes from all commits
017434a
493d736
8a1577f
a1d6ffc
d744f0c
6a6a3cf
d58e44a
3f05336
cc411af
be9bbe2
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
# Optimizing playwright setup and playwright.config.ts files | ||
|
||
-Adding a conditioning to auth.setup.ts file to use existing auth json file if it's applicable | ||
-Added some optimizations to playwright config file | ||
-Cleaned up gh action for playwright tests (removed Cypress references) | ||
-Updating gh workflow for PR automation with extra test sharding | ||
-General cleanup of redundant code |
yellowee marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -118,13 +118,14 @@ jobs: | |||||
deployment_id: ${{ steps.deployment.outputs.deployment_id }} | ||||||
env: ${{ needs.initialize-cloud.outputs.POOL_NAME }} | ||||||
|
||||||
|
||||||
run-tests: | ||||||
runs-on: ubuntu-22.04 | ||||||
needs: [initialize-cloud, deploy-dashboard] | ||||||
strategy: | ||||||
fail-fast: false | ||||||
matrix: | ||||||
shard: [1/2, 2/2] | ||||||
shard: [1/4, 2/4, 3/4, 4/4] | ||||||
steps: | ||||||
- uses: actions/checkout@v4 | ||||||
|
||||||
|
@@ -134,10 +135,12 @@ jobs: | |||||
SHARD: ${{ matrix.shard }} | ||||||
BASE_URL: ${{ needs.initialize-cloud.outputs.BASE_URL }} | ||||||
API_URL: ${{ needs.initialize-cloud.outputs.API_URL }} | ||||||
E2E_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} | ||||||
E2E_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} | ||||||
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} | ||||||
MAILPITURL: ${{ secrets.CYPRESS_MAILPITURL }} | ||||||
E2E_USER_NAME: ${{ secrets.E2E_USER_NAME }} | ||||||
E2E_USER_PASSWORD: ${{ secrets.E2E_USER_PASSWORD }} | ||||||
E2E_PERMISSIONS_USERS_PASSWORD: ${{ secrets.E2E_PERMISSIONS_USERS_PASSWORD }} | ||||||
MAILPITURL: ${{ secrets.MAILPITURL }} | ||||||
szczecha marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
PW_WORKERS: ${{ vars.PW_WORKERS }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe we can avoid hardcoding There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @andrzejewsky can you take a look? You suggested using PW_WORKERS ;)
yellowee marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
PW_RETRIES: ${{ vars.PW_RETRIES }} | ||||||
|
||||||
merge-reports: | ||||||
if: "!cancelled()" | ||||||
|
@@ -147,4 +150,4 @@ jobs: | |||||
- uses: actions/checkout@v4 | ||||||
|
||||||
- name: Merge playwright reports | ||||||
uses: ./.github/actions/merge-pw-reports | ||||||
uses: ./.github/actions/merge-pw-reports |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,11 @@ | |
"No error banner should be visible", | ||
).not.toBeVisible(); | ||
} | ||
async waitForNetworkIdle(action: () => Promise<void>) { | ||
const responsePromise = this.page.waitForResponse('**/graphql/'); | ||
await action(); | ||
await responsePromise; | ||
} | ||
async resizeWindow(w: number, h: number) { | ||
await this.page.setViewportSize({width: w, height: h,}); | ||
} | ||
|
@@ -254,7 +259,7 @@ | |
.locator("tr") | ||
.filter({ hasText: expectedText }) | ||
.first() | ||
.waitFor({ state: "attached" }); | ||
.waitFor({ state: "attached", timeout: 10000 }); | ||
Check failure on line 262 in playwright/pages/basePage.ts GitHub Actions / run-tests (2/4)[chromium] › giftCards.spec.ts:49:5 › TC: SALEOR_106 Issue gift card with specific customer and expiry date @e2e @gift
Check failure on line 262 in playwright/pages/basePage.ts GitHub Actions / run-tests (2/4)[chromium] › giftCards.spec.ts:117:5 › TC: SALEOR_111 Bulk delete gift cards @e2e @gift
|
||
const gridRowsWithText = await this.gridCanvas | ||
.locator("tr") | ||
.filter({ hasText: expectedText }) | ||
|
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.
If this is required, other jobs, which are using this action can fail: run-test-cron and run-test-manual.
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.
@karola312 fixed