Skip to content
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

SALEOR_128 - Set metadata expanded #5311

Merged
merged 2 commits into from
Dec 10, 2024
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/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
Loading