diff --git a/.changeset/smooth-lemons-remember.md b/.changeset/smooth-lemons-remember.md new file mode 100644 index 00000000000..1d1488cd2ab --- /dev/null +++ b/.changeset/smooth-lemons-remember.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Removed waitFor and set expanded metadata section to avoid flakyness diff --git a/playwright/tests/attributes.spec.ts b/playwright/tests/attributes.spec.ts index facf20bdf70..ee622e36e20 100644 --- a/playwright/tests/attributes.spec.ts +++ b/playwright/tests/attributes.spec.ts @@ -162,20 +162,23 @@ for (const attribute of attributesWithValuesToBeUpdated) { for (const attr of ATTRIBUTES.attributesToBeUpdated) { test(`TC: SALEOR_128 User should be able to edit existing ${attr.name} attribute @e2e @attributes`, async () => { await attributesPage.gotoExistingAttributePage(attr.id, attr.name); - await attributesPage.attributeDefaultLabelInput.waitFor({ state: "visible" }); - await attributesPage.attributeDefaultLabelInput.clear(); - await attributesPage.typeAttributeDefaultLabel(`updated ${attr.name}`); + + await attributesPage.attributeDefaultLabelInput.fill(`updated ${attr.name}`); + await attributesPage.expandMetadataSection(); await attributesPage.metadataAddFieldButton.click(); - await attributesPage.metadataKeyInput.waitFor({ state: "visible" }); - await attributesPage.metadataValueInput.waitFor({ state: "visible" }); + await attributesPage.fillMetadataFields("new key", "new value"); - await attributesPage.metadataValueInput.blur(); + await attributesPage.clickSaveButton(); await attributesPage.expectSuccessBanner(); await attributesPage.expectElementIsHidden(attributesPage.successBanner); - await attributesPage.attributeSelect.waitFor({ state: "visible" }); + + await attributesPage.expandMetadataSection(); + + await expect(attributesPage.attributeSelect).toBeVisible(); await expect(attributesPage.attributeSelect).toHaveAttribute("aria-disabled", "true"); + await expect(attributesPage.metadataKeyInput).toBeVisible(); await expect(attributesPage.metadataKeyInput).toHaveValue("new key"); await expect(attributesPage.metadataValueInput).toHaveValue("new value"); await expect(attributesPage.attributeDefaultLabelInput).toHaveValue(`updated ${attr.name}`);