From c1d0fd100a82d6bbe63c21ce80d67f87c2bb76fc Mon Sep 17 00:00:00 2001 From: Robert Field Date: Fri, 17 Nov 2023 00:32:41 +0100 Subject: [PATCH] build: turbo made aware of the outputs of next apps (#128) * build: turbo made aware of the outputs of next apps * fix: no payment view for manual payment setup * chore: generated latest examples * feat: latest examples * feat: changelog --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- .changeset/config.json | 2 +- .changeset/pink-spoons-attend.md | 5 ++ examples/simple/e2e/checkout-flow.spec.ts | 11 ---- .../files/e2e/checkout-flow.spec.ts.template | 0 .../files/e2e/checkout-flow.spec.ts.template | 57 +++++++++++++++++++ turbo.json | 2 +- 6 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .changeset/pink-spoons-attend.md rename packages/d2c-schematics/{checkout => ep-payments-payment-gateway}/files/e2e/checkout-flow.spec.ts.template (100%) create mode 100644 packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template diff --git a/.changeset/config.json b/.changeset/config.json index 63d34d1c..13f5dc75 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -7,5 +7,5 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", - "ignore": ["algolia", "basic"] + "ignore": ["algolia", "simple", "payments"] } \ No newline at end of file diff --git a/.changeset/pink-spoons-attend.md b/.changeset/pink-spoons-attend.md new file mode 100644 index 00000000..5acdf28f --- /dev/null +++ b/.changeset/pink-spoons-attend.md @@ -0,0 +1,5 @@ +--- +"@elasticpath/d2c-schematics": patch +--- + +e2e test fixed for checkout manual flow diff --git a/examples/simple/e2e/checkout-flow.spec.ts b/examples/simple/e2e/checkout-flow.spec.ts index a50a4094..ac45dc36 100644 --- a/examples/simple/e2e/checkout-flow.spec.ts +++ b/examples/simple/e2e/checkout-flow.spec.ts @@ -48,18 +48,7 @@ test.describe("Checkout flow", async () => { }, }); - /* Move to payment */ await checkoutPage.checkout(); - - await checkoutPage.enterPaymentInformation({ - "Card number": { value: "4242424242424242", fieldType: "input" }, - Expiration: { value: "1272", fieldType: "input" }, - CVC: { value: "123", fieldType: "input" }, - Country: { value: "United Kingdom", fieldType: "select" }, - "Postal code": { value: "ABC 123", fieldType: "input" }, - }); - - await checkoutPage.submitPayment(); await checkoutPage.checkOrderComplete; /* Continue Shopping */ diff --git a/packages/d2c-schematics/checkout/files/e2e/checkout-flow.spec.ts.template b/packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template similarity index 100% rename from packages/d2c-schematics/checkout/files/e2e/checkout-flow.spec.ts.template rename to packages/d2c-schematics/ep-payments-payment-gateway/files/e2e/checkout-flow.spec.ts.template 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 new file mode 100644 index 00000000..ac45dc36 --- /dev/null +++ b/packages/d2c-schematics/manual-payment-gateway/files/e2e/checkout-flow.spec.ts.template @@ -0,0 +1,57 @@ +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"; +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); + const checkoutPage = createD2CCheckoutPage(page); + + /* Go to simple product page */ + await productDetailPage.gotoSimpleProduct(); + + /* Add the product to cart */ + await productDetailPage.addProductToCart(); + + /* Go to cart page and checkout */ + await cartPage.goto(); + await cartPage.checkoutCart(); + + /* Enter information */ + await checkoutPage.enterInformation({ + "Email Address": { 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" }, + "Extended Address": { value: "Extended Address", fieldType: "input" }, + City: { value: "Brownsville", fieldType: "input" }, + County: { value: "Brownsville County", fieldType: "input" }, + Region: { value: "Browns", fieldType: "input" }, + Postcode: { value: "ABC 123", fieldType: "input" }, + Country: { value: "Algeria", fieldType: "select" }, + "Phone Number": { value: "01234567891", fieldType: "input" }, + "Additional Instructions": { + value: "This is some extra instructions.", + fieldType: "input", + }, + }); + + await checkoutPage.checkout(); + await checkoutPage.checkOrderComplete; + + /* Continue Shopping */ + await checkoutPage.continueShopping(); + }); +}); diff --git a/turbo.json b/turbo.json index 7a13d2c4..a83c8400 100644 --- a/turbo.json +++ b/turbo.json @@ -3,7 +3,7 @@ "pipeline": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**"] + "outputs": ["dist/**", ".next/**", "!.next/cache/**"] }, "generate": { "outputs": []