Skip to content
Closed
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/fast-cycles-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Removed unnecessary await from expect statements and split select link option into two methods to reduce flakiness.
2 changes: 1 addition & 1 deletion playwright/tests/attributes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ for (const attr of attributeClasses) {
await attributesPage.addValueDialog.typeAndSaveAttributeValue();
await attributesPage.clickSaveButton();
await attributesPage.expectSuccessBanner();
await expect(await attributesPage.attributesRows.count()).toEqual(1);
expect(await attributesPage.attributesRows.count()).toEqual(1);
await attributesPage.valueRequiredCheckbox.waitFor({
state: "visible",
timeout: 10000,
Expand Down
6 changes: 2 additions & 4 deletions playwright/tests/taxes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ test("TC: SALEOR_117 Add new country and tax rates to it @taxes @e2e", async ()
await taxesPage.addCountriesDialog.checkAndSaveSingleCountry(
COUNTRIES.countryToBeAddedInTaxes.name,
);
expect(await taxesPage.countriesListRow.first()).toHaveText(
COUNTRIES.countryToBeAddedInTaxes.name,
);
expect(taxesPage.countriesListRow.first()).toHaveText(COUNTRIES.countryToBeAddedInTaxes.name);
await taxesPage.typeAllTaxRatesForCountry("23", "0", "16", "7", "21", "19");
await taxesPage.clickSaveButton();
await taxesPage.expectSuccessBanner();
Expand All @@ -57,7 +55,7 @@ test("TC: SALEOR_118 Add new class with metadata and set tax rate for single cou
await taxesPage.gotoChannelsTabUrl();
await taxesPage.clickTaxClassTab();
await taxesPage.clickCreateClassButton();
expect(await taxesPage.taxClassNameInput).toHaveValue("New tax class");
expect(taxesPage.taxClassNameInput).toHaveValue("New tax class");
await taxesPage.typeTaxClassName("Automation test tax class");
await taxesPage.typeSearchedTaxCountryName("United States of America");
await taxesPage.typeTaxRateInSearchedCountryRow("United States of America", "20");
Expand Down
22 changes: 9 additions & 13 deletions playwright/tests/vouchers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("TC: SALEOR_40 Create voucher with auto-generated codes and fixed amount di

const generatedCodesRows = await vouchersPage.getNumberOfGridRowsWithText(codesPrefix);

await expect(
expect(
generatedCodesRows,
`Auto-generated number of codes: ${codesQuantity} should be visible on grid`,
).toEqual(codesQuantity);
Expand All @@ -38,7 +38,7 @@ test("TC: SALEOR_40 Create voucher with auto-generated codes and fixed amount di

const activeCodesRows = await vouchersPage.getNumberOfGridRowsWithText("Active");

await expect(
expect(
activeCodesRows,
`Given codes quantity: ${codesQuantity} should have status Active displayed on grid`,
).toEqual(codesQuantity);
Expand All @@ -56,9 +56,7 @@ test("TC: SALEOR_85 Create voucher with manual code and percentage discount @vou

const manualCodesRows = await vouchersPage.getNumberOfGridRowsWithText(code);

await expect(manualCodesRows, `Manually added code: ${code} should be visible on grid`).toEqual(
1,
);
expect(manualCodesRows, `Manually added code: ${code} should be visible on grid`).toEqual(1);
await vouchersPage.clickPercentDiscountTypeButton();
await vouchersPage.rightSideDetailsPage.selectOneChannelAsAvailableWhenMoreSelected(
"Channel-PLN",
Expand All @@ -70,7 +68,7 @@ test("TC: SALEOR_85 Create voucher with manual code and percentage discount @vou

const manualActiveCodesRows = await vouchersPage.getNumberOfGridRowsWithText("Active");

await expect(
expect(
manualActiveCodesRows,
`Given codes: ${code} should have status Active displayed on grid`,
).toEqual(1);
Expand All @@ -94,7 +92,7 @@ test("TC: SALEOR_86 Edit voucher to have free shipping discount @vouchers @e2e",

const codesRowsAfterSave = await vouchersPage.getNumberOfGridRows();

await expect(
expect(
codesRows,
`Same amount of codes should have status Active displayed on grid after switching to free shipping`,
).toEqual(codesRowsAfterSave);
Expand Down Expand Up @@ -128,9 +126,7 @@ test("TC: SALEOR_89 Create voucher with minimum value of order @vouchers @e2e",

const manualCodesRows = await vouchersPage.getNumberOfGridRowsWithText(code);

await expect(manualCodesRows, `Manually added code: ${code} should be visible on grid`).toEqual(
1,
);
expect(manualCodesRows, `Manually added code: ${code} should be visible on grid`).toEqual(1);
await vouchersPage.clickMinimalOrderValueButton();
await vouchersPage.typeMinimumOrderValue("Channel-PLN", "50");
await vouchersPage.clickSaveButton();
Expand All @@ -139,7 +135,7 @@ test("TC: SALEOR_89 Create voucher with minimum value of order @vouchers @e2e",

const manualActiveCodesRows = await vouchersPage.getNumberOfGridRowsWithText("Active");

await expect(
expect(
manualActiveCodesRows,
`Given codes: ${code} should have status Active displayed on grid`,
).toEqual(1);
Expand All @@ -159,7 +155,7 @@ test("TC: SALEOR_92 Delete voucher @vouchers @e2e", async () => {
await vouchersPage.expectSuccessBanner();
await vouchersPage.createVoucherButton.waitFor({ state: "visible" });
await vouchersPage.waitForGrid();
await expect(
expect(
await vouchersPage.findRowIndexBasedOnText([VOUCHERS.vouchers.voucherToBeDeleted.name]),
`Given vouchers: ${VOUCHERS.vouchers.voucherToBeBulkDeleted.names} should be deleted from the list`,
).toEqual([]);
Expand All @@ -173,7 +169,7 @@ test("TC: SALEOR_93 Bulk delete voucher @vouchers @e2e", async () => {
await vouchersPage.deleteVoucherDialog.clickDeleteButton();
await vouchersPage.expectSuccessBanner();
await vouchersPage.gotoVouchersListPage();
await expect(
expect(
await vouchersPage.findRowIndexBasedOnText(VOUCHERS.vouchers.voucherToBeBulkDeleted.names),
`Given vouchers: ${VOUCHERS.vouchers.voucherToBeBulkDeleted.names} should be deleted from the list`,
).toEqual([]);
Expand Down
Loading