From 1012059e48affd4c87ca20f721628c55f3df90f6 Mon Sep 17 00:00:00 2001 From: Robert Field Date: Mon, 20 Nov 2023 15:12:03 +0000 Subject: [PATCH] feat: apply changes to schematics --- .../files/e2e/models/d2c-checkout-page.ts.template | 4 +++- .../files/e2e/checkout-flow.spec.ts.template | 2 -- .../home/files/e2e/home-page.spec.ts.template | 4 ---- .../files/e2e/checkout-flow.spec.ts.template | 8 +------- .../files/e2e/product-details-page.spec.ts.template | 4 ---- .../workspace/files/playwright.config.ts.template | 10 ---------- 6 files changed, 4 insertions(+), 28 deletions(-) diff --git a/packages/d2c-schematics/checkout/files/e2e/models/d2c-checkout-page.ts.template b/packages/d2c-schematics/checkout/files/e2e/models/d2c-checkout-page.ts.template index 2e5ac81a..74f1688f 100644 --- a/packages/d2c-schematics/checkout/files/e2e/models/d2c-checkout-page.ts.template +++ b/packages/d2c-schematics/checkout/files/e2e/models/d2c-checkout-page.ts.template @@ -47,7 +47,9 @@ export function createD2CCheckoutPage(page: Page): D2CCheckoutPage { }, async continueShopping() { await continueShoppingBtn.click(); - await expect(page).toHaveURL(`/`); + await expect( + page.getByRole("heading", { name: "Your Elastic Path storefront" }), + ).toBeVisible(); }, }; } diff --git a/packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template b/packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template index a50a4094..5a039f00 100644 --- a/packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template +++ b/packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template @@ -1,7 +1,6 @@ import { test } from "@playwright/test"; import { createD2CProductDetailPage } from "./models/d2c-product-detail-page"; import { client } from "./util/epcc-client"; -import { skipIfMissingCatalog } from "./util/missing-published-catalog"; import { createD2CCartPage } from "./models/d2c-cart-page"; import { createD2CCheckoutPage } from "./models/d2c-checkout-page"; import { gatewayIsEnabled } from "./util/gateway-is-enabled"; @@ -10,7 +9,6 @@ import { skipIfCIEnvironment } from "./util/skip-ci-env"; test.describe("Checkout flow", async () => { test.beforeEach(async () => { skipIfCIEnvironment(); - await skipIfMissingCatalog(); await gatewayIsEnabled(); }); diff --git a/packages/d2c-schematics/home/files/e2e/home-page.spec.ts.template b/packages/d2c-schematics/home/files/e2e/home-page.spec.ts.template index 07cbb0f7..de251ea1 100644 --- a/packages/d2c-schematics/home/files/e2e/home-page.spec.ts.template +++ b/packages/d2c-schematics/home/files/e2e/home-page.spec.ts.template @@ -3,10 +3,6 @@ import { createD2CHomePage } from "./models/d2c-home-page"; import { skipIfMissingCatalog } from "./util/missing-published-catalog"; test.describe("Home Page", async () => { - test.beforeEach(async () => { - await skipIfMissingCatalog(); - }); - test("should load home page", async ({ page }) => { const d2cHomePage = createD2CHomePage(page); await d2cHomePage.goto(); diff --git a/packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template b/packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template index ac45dc36..858fb014 100644 --- a/packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template +++ b/packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template @@ -8,12 +8,6 @@ import { gatewayIsEnabled } from "./util/gateway-is-enabled"; import { skipIfCIEnvironment } from "./util/skip-ci-env"; test.describe("Checkout flow", async () => { - test.beforeEach(async () => { - skipIfCIEnvironment(); - await skipIfMissingCatalog(); - await gatewayIsEnabled(); - }); - test("should perform product checkout", async ({ page }) => { const productDetailPage = createD2CProductDetailPage(page, client); const cartPage = createD2CCartPage(page); @@ -31,7 +25,7 @@ test.describe("Checkout flow", async () => { /* Enter information */ await checkoutPage.enterInformation({ - "Email Address": { value: "test@tester.com", fieldType: "input" }, + Email: { value: "test@tester.com", fieldType: "input" }, "First Name": { value: "Jim", fieldType: "input" }, "Last Name": { value: "Brown", fieldType: "input" }, "Street Address": { value: "Main Street", fieldType: "input" }, diff --git a/packages/d2c-schematics/product-details-page/files/e2e/product-details-page.spec.ts.template b/packages/d2c-schematics/product-details-page/files/e2e/product-details-page.spec.ts.template index fd8823c8..b65cad74 100644 --- a/packages/d2c-schematics/product-details-page/files/e2e/product-details-page.spec.ts.template +++ b/packages/d2c-schematics/product-details-page/files/e2e/product-details-page.spec.ts.template @@ -4,10 +4,6 @@ import { client } from "./util/epcc-client"; import { skipIfMissingCatalog } from "./util/missing-published-catalog"; test.describe("Product Details Page", async () => { - test.beforeEach(async () => { - await skipIfMissingCatalog(); - }); - test("should add a simple product to cart", async ({ page }) => { const productDetailPage = createD2CProductDetailPage(page, client); diff --git a/packages/d2c-schematics/workspace/files/playwright.config.ts.template b/packages/d2c-schematics/workspace/files/playwright.config.ts.template index 756322da..86a23119 100644 --- a/packages/d2c-schematics/workspace/files/playwright.config.ts.template +++ b/packages/d2c-schematics/workspace/files/playwright.config.ts.template @@ -60,12 +60,6 @@ const config: PlaywrightTestConfig = { ...devices["Desktop Firefox"], }, }, - { - name: "Desktop Safari", - use: { - ...devices["Desktop Safari"], - }, - }, // Test against mobile viewports. { name: "Mobile Chrome", @@ -73,10 +67,6 @@ const config: PlaywrightTestConfig = { ...devices["Pixel 5"], }, }, - { - name: "Mobile Safari", - use: devices["iPhone 12"], - }, ], }; export default config;