Skip to content

Commit 6a88f22

Browse files
committed
fix: metadata save failure - check mutation
1 parent 401baa8 commit 6a88f22

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

playwright/tests/taxes.spec.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ test("TC: SALEOR_117 Add new country and tax rates to it #taxes #e2e", async ()
5454
await taxesPage.clickSaveButton();
5555
await taxesPage.expectSuccessBanner();
5656
});
57-
test("TC: SALEOR_118 Add new class with metadata and set tax rate for single country #taxes #e2e", async () => {
57+
test("TC: SALEOR_118 Add new class with metadata and set tax rate for single country #taxes #e2e", async ({
58+
page,
59+
}) => {
5860
await taxesPage.gotoChannelsTabUrl();
5961
await taxesPage.clickTaxClassTab();
6062
await taxesPage.clickCreateClassButton();
@@ -65,6 +67,20 @@ test("TC: SALEOR_118 Add new class with metadata and set tax rate for single cou
6567
await taxesPage.metadataSeoPage.publicMetaSection.waitFor({ state: "attached", timeout: 10000 });
6668
await taxesPage.metadataSeoPage.publicMetaSection.scrollIntoViewIfNeeded();
6769
await taxesPage.metadataSeoPage.expandAndAddAllMetadata();
70+
71+
// Ensure save button is enabled after metadata changes
72+
await expect(taxesPage.saveButton).toBeEnabled();
73+
74+
// Wait for the GraphQL mutation when save is clicked, then verify success
75+
const responsePromise = page.waitForResponse(
76+
resp =>
77+
resp.url().includes("/graphql/") &&
78+
resp.request().postDataJSON()?.operationName === "TaxClassCreate",
79+
{ timeout: 10000 },
80+
);
81+
6882
await taxesPage.clickSaveButton();
83+
await responsePromise;
84+
6985
await taxesPage.expectSuccessBanner();
7086
});

0 commit comments

Comments
 (0)