Skip to content

Commit

Permalink
set metadata expanded (#5311)
Browse files Browse the repository at this point in the history
  • Loading branch information
michalina-graczyk authored Dec 10, 2024
1 parent 7b3a301 commit f24e2d2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-lemons-remember.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Removed waitFor and set expanded metadata section to avoid flakyness
17 changes: 10 additions & 7 deletions playwright/tests/attributes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit f24e2d2

Please sign in to comment.