Skip to content

Commit

Permalink
🎀 Reuse existing order to reduce test execution time 🎀 (#5241)
Browse files Browse the repository at this point in the history
* reuse existing order to reduce test execution time

* remove unnecessary change

* Fix for Saleor_131, remove unnecessery line
  • Loading branch information
michalina-graczyk committed Nov 14, 2024
1 parent 3db9f24 commit 9436450
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-hotels-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Optimize test by reusing an existing order instead of creating a new one
3 changes: 3 additions & 0 deletions playwright/data/e2eTestData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ export const ORDERS = {
},
],
},
orderWithoutAddedCustomer: {
id: "T3JkZXI6MDM4MjM4NDMtYjg3My00ZTQ2LWE1NTItNjc0ZGIwZjE2ZGZh",
},
};

export const SHIPPING_METHODS = {
Expand Down
7 changes: 1 addition & 6 deletions playwright/tests/orders.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,7 @@ test("TC: SALEOR_217 Complete basic order for non existing customer @e2e @order"
const nonExistingEmail = `customer-${faker.datatype.number()}@example.com`;
const newAddress = ADDRESS.addressPL;

await ordersPage.goToOrdersListView();
await ordersPage.clickCreateOrderButton();
await ordersPage.orderCreateDialog.completeOrderCreateDialogWithFirstChannel();
await ordersPage.clickAddProductsButton();
await draftOrdersPage.addProductsDialog.selectVariantBySKU(variantSKU);
await draftOrdersPage.addProductsDialog.clickConfirmButton();
await ordersPage.goToExistingOrderPage(ORDERS.orderWithoutAddedCustomer.id);
await ordersPage.rightSideDetailsPage.clickEditCustomerButton();
await ordersPage.rightSideDetailsPage.clickSearchCustomerInput();
await ordersPage.rightSideDetailsPage.typeAndSelectCustomerEmail(nonExistingEmail);
Expand Down
6 changes: 1 addition & 5 deletions playwright/tests/singlePermissions/readonlyAppAccess.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ for (const permission of permissionList) {

await expect(appsPage.installExternalAppButton).not.toBeVisible();

const appLists = [
appsPage.installedAppsList,
appsPage.availableAppsList,
appsPage.upcomingAppsList,
];
const appLists = [appsPage.installedAppsList, appsPage.availableAppsList];

for (const appList of appLists) {
await expect(appList).toBeVisible();
Expand Down

0 comments on commit 9436450

Please sign in to comment.