Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/green-peas-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Modify menu tests to ensure the first item in the list is visible before proceeding.
12 changes: 7 additions & 5 deletions playwright/pages/dialogs/addNavigationMenuItemDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export class AddNavigationMenuItemDialog extends BasePage {
}

async selectLinkTypeOption(linkType: string) {
await this.menuLinkType.click();
await this.waitForDOMToFullyLoad();
await expect(async () => {
await this.menuLinkType.click();
await this.menuLinkOptions.first().waitFor({ state: "visible" });
}).toPass();

// Ensure the link type option is visible and select it
const linkTypeOption = this.menuLinkOptions.filter({ hasText: linkType });
Expand All @@ -34,8 +36,9 @@ export class AddNavigationMenuItemDialog extends BasePage {
}

async selectLinkTypeValue(optionName: string) {
await this.menuLinkValue.click();
await this.waitForDOMToFullyLoad();
await expect(async () => {
await this.menuLinkValue.click();
}).toPass();

// Ensure the option is present and select it
const option = this.menuLinkOptions.filter({ hasText: optionName });
Expand All @@ -54,6 +57,5 @@ export class AddNavigationMenuItemDialog extends BasePage {

async clickSaveButton() {
await this.saveButton.click();
await this.waitForDOMToFullyLoad();
}
}
Loading