Skip to content

Commit

Permalink
added wait for dom content loaded (#4531)
Browse files Browse the repository at this point in the history
  • Loading branch information
wojteknowacki committed Dec 14, 2023
1 parent 876d89b commit d02dcf9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quiet-houses-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Fix waiting for dom load state in playwright e2e tests
3 changes: 2 additions & 1 deletion playwright/pages/pageElements/rightSideDetailsSection.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Locator, Page } from "@playwright/test";
import { expect, Locator, Page } from "@playwright/test";

export class RightSideDetailsPage {
readonly page: Page;
Expand Down Expand Up @@ -87,6 +87,7 @@ export class RightSideDetailsPage {
await this.categorySelectOption.first().click();
}
async selectFirstTax() {
await expect(this.taxInput.locator("input")).not.toBeDisabled();
await this.taxInput.click();
await this.taxSelectOption.first().click();
}
Expand Down
2 changes: 2 additions & 0 deletions playwright/pages/productPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export class ProductPage {
await this.manageChannelsButton.click();
await this.channelSelectDialog.selectFirstChannel();
await this.channelSelectDialog.clickConfirmButton();
await this.page.waitForLoadState("domcontentloaded");
}

async clickCreateProductButton() {
Expand All @@ -205,5 +206,6 @@ export class ProductPage {
await this.clickUploadImagesButtonButton();
const fileChooser = await fileChooserPromise;
await fileChooser.setFiles(path.join("playwright/data/images/", fileName));
await this.page.waitForLoadState("domcontentloaded");
}
}

0 comments on commit d02dcf9

Please sign in to comment.