diff --git a/.changeset/chilly-hotels-melt.md b/.changeset/chilly-hotels-melt.md new file mode 100644 index 00000000000..7677d8fa412 --- /dev/null +++ b/.changeset/chilly-hotels-melt.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Optimize test by reusing an existing order instead of creating a new one diff --git a/playwright/data/e2eTestData.ts b/playwright/data/e2eTestData.ts index 4ac031967bc..147be7b566b 100644 --- a/playwright/data/e2eTestData.ts +++ b/playwright/data/e2eTestData.ts @@ -515,6 +515,9 @@ export const ORDERS = { }, ], }, + orderWithoutAddedCustomer: { + id: "T3JkZXI6MDM4MjM4NDMtYjg3My00ZTQ2LWE1NTItNjc0ZGIwZjE2ZGZh", + }, }; export const SHIPPING_METHODS = { diff --git a/playwright/tests/orders.spec.ts b/playwright/tests/orders.spec.ts index d65e1a0463b..62ebb82e36b 100644 --- a/playwright/tests/orders.spec.ts +++ b/playwright/tests/orders.spec.ts @@ -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); diff --git a/playwright/tests/singlePermissions/readonlyAppAccess.spec.ts b/playwright/tests/singlePermissions/readonlyAppAccess.spec.ts index f95680a5e83..252af5e9081 100644 --- a/playwright/tests/singlePermissions/readonlyAppAccess.spec.ts +++ b/playwright/tests/singlePermissions/readonlyAppAccess.spec.ts @@ -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();