From b23cf3830c57c85aca4fcb5749fa3ddf817239d3 Mon Sep 17 00:00:00 2001 From: akrajna <57936972+akrajna@users.noreply.github.com> Date: Wed, 29 Jul 2020 14:42:05 +0200 Subject: [PATCH] fix(cli): problems with init on windows (#921) --- cypress.json | 2 +- packages/cli/package.json | 4 +- packages/cli/scripts/clean-build.js | 6 ++ packages/cli/scripts/copy-templates.js | 9 +++ packages/cli/src/commands/init.ts | 14 ++--- packages/cli/src/extensions/nuxt-extension.ts | 18 +++--- packages/cli/src/stages.ts | 5 ++ ...op.spec.js => add_to_cart_desktop.spec.js} | 0 .../checkout_guest_desktop.spec.js | 16 ++++++ .../integration/checkout_payment_step.js | 55 ++++++++++++++++++ .../checkout_personal_detail_step.js | 56 +++++++++++++++++++ .../integration/checkout_shipping_step.js | 55 ++++++++++++++++++ .../__e2e__/integration/checkout_summary.js | 50 +++++++++++++++++ .../default-theme/__e2e__/support/commands.js | 56 +++++++++++++++++++ packages/default-theme/components/SwCart.vue | 1 + .../checkout/sidebar/SidebarOrderReview.vue | 3 + .../components/checkout/steps/PaymentStep.vue | 1 + .../checkout/steps/ShippingStep.vue | 1 + .../steps/guest/BillingAddressGuestForm.vue | 12 +++- .../steps/guest/PersonalDetailsGuestForm.vue | 5 ++ .../steps/guest/ShippingAddressGuestForm.vue | 11 +++- .../components/checkout/summary/OrderItem.vue | 5 +- .../checkout/summary/TotalsSummary.vue | 2 + packages/nuxt-module/src/packages.ts | 4 +- 24 files changed, 367 insertions(+), 24 deletions(-) create mode 100644 packages/cli/scripts/clean-build.js create mode 100644 packages/cli/scripts/copy-templates.js create mode 100644 packages/cli/src/stages.ts rename packages/default-theme/__e2e__/integration/{checkout_desktop.spec.js => add_to_cart_desktop.spec.js} (100%) create mode 100644 packages/default-theme/__e2e__/integration/checkout_guest_desktop.spec.js create mode 100644 packages/default-theme/__e2e__/integration/checkout_payment_step.js create mode 100644 packages/default-theme/__e2e__/integration/checkout_personal_detail_step.js create mode 100644 packages/default-theme/__e2e__/integration/checkout_shipping_step.js create mode 100644 packages/default-theme/__e2e__/integration/checkout_summary.js diff --git a/cypress.json b/cypress.json index 170f44d75..fbb1f5ba8 100644 --- a/cypress.json +++ b/cypress.json @@ -1,5 +1,5 @@ { - "baseUrl": "https://shopware-pwa.storefrontcloud.io/", + "baseUrl": "http://localhost:3000/", "integrationFolder":"packages\\default-theme\\__e2e__\\integration", "fixturesFolder":"packages\\default-theme\\__e2e__\\fixtures", "pluginsFile":"packages\\default-theme\\__e2e__\\plugins", diff --git a/packages/cli/package.json b/packages/cli/package.json index 46f295929..eb845255b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -9,9 +9,9 @@ "scripts": { "format": "prettier --write **/*.{js,ts,json}", "lint": "tslint --config tslint.json -p . --fix", - "clean-build": "rm -rf ./build", + "clean-build": "node ./scripts/clean-build.js", "compile": "tsc -p .", - "copy-templates": "cp -a ./src/templates ./build/", + "copy-templates": "node ./scripts/copy-templates.js", "build": "yarn format && yarn lint && yarn clean-build && yarn compile && yarn copy-templates", "test": "jest", "watch": "jest --watch", diff --git a/packages/cli/scripts/clean-build.js b/packages/cli/scripts/clean-build.js new file mode 100644 index 000000000..335b73c28 --- /dev/null +++ b/packages/cli/scripts/clean-build.js @@ -0,0 +1,6 @@ +const jetpack = require("fs-jetpack"); + +function run() { + jetpack.remove("./build"); +} +run(); diff --git a/packages/cli/scripts/copy-templates.js b/packages/cli/scripts/copy-templates.js new file mode 100644 index 000000000..271c81f50 --- /dev/null +++ b/packages/cli/scripts/copy-templates.js @@ -0,0 +1,9 @@ +const jetpack = require("fs-jetpack"); +const path = require("path"); + +function run() { + const sourceDir = path.join("src", "templates"); + const destinationDir = path.join("build", "templates"); + jetpack.copy(sourceDir, destinationDir); +} +run(); diff --git a/packages/cli/src/commands/init.ts b/packages/cli/src/commands/init.ts index 15f3e3feb..f3ab67468 100644 --- a/packages/cli/src/commands/init.ts +++ b/packages/cli/src/commands/init.ts @@ -1,4 +1,5 @@ import { GluegunToolbox } from "gluegun"; +import { STAGES } from "../stages"; module.exports = { name: "init", @@ -18,12 +19,6 @@ module.exports = { print: { info, warning, success, spin }, } = toolbox; - const STAGES = { - STABLE: "latest stable (recommended)", - CANARY: "canary (current master branch)", - LOCAL: "local contibution (to contribute locally in shopware-pwa)", - }; - const inputParameters = toolbox.inputParameters; // when --ci parameter is provided, then we skip questions for default values const isCIrun = inputParameters.ci; @@ -97,6 +92,11 @@ module.exports = { ); break; case STAGES.LOCAL: + await run( + `yarn add -D ${coreDevPackages + .map((dep) => `${dep}@canary`) + .join(" ")}` + ); await run(`npx yalc add -D ${coreDevPackages.join(" ")}`); await run(`yarn link ${coreDevPackages.join(" ")}`); break; @@ -110,7 +110,7 @@ module.exports = { break; } - await toolbox.updateNuxtPackageJson(stage === STAGES.CANARY); + await toolbox.updateNuxtPackageJson(stage); await toolbox.updateNuxtConfigFile(); updateConfigSpinner.succeed(); diff --git a/packages/cli/src/extensions/nuxt-extension.ts b/packages/cli/src/extensions/nuxt-extension.ts index 305a20150..23275bd20 100644 --- a/packages/cli/src/extensions/nuxt-extension.ts +++ b/packages/cli/src/extensions/nuxt-extension.ts @@ -1,4 +1,6 @@ import { GluegunToolbox } from "gluegun"; +import { STAGES } from "../stages"; +const path = require("path"); module.exports = (toolbox: GluegunToolbox) => { const { @@ -50,9 +52,9 @@ module.exports = (toolbox: GluegunToolbox) => { * TODO: check generated files and add here ones which are not necessary */ toolbox.removeDefaultNuxtFiles = async () => { - toolbox.filesystem.remove("pages/index.vue"); - toolbox.filesystem.remove("components/Logo.vue"); - toolbox.filesystem.remove("layouts/default.vue"); + toolbox.filesystem.remove(path.join("pages", "index.vue")); + toolbox.filesystem.remove(path.join("components", "Logo.vue")); + toolbox.filesystem.remove(path.join("layouts", "default.vue")); }; /** @@ -61,9 +63,9 @@ module.exports = (toolbox: GluegunToolbox) => { * - uncomment packages which are already published * - dynamically get new versions from template */ - toolbox.updateNuxtPackageJson = async (canary = false) => { + toolbox.updateNuxtPackageJson = async (stage) => { const nuxtThemePackage = toolbox.filesystem.read( - `${toolbox.defaultThemeLocation}/package.json`, + path.join(toolbox.defaultThemeLocation, "package.json"), "json" ); @@ -75,7 +77,7 @@ module.exports = (toolbox: GluegunToolbox) => { config.scripts.build = "shopware-pwa build"; // update versions to canary - if (canary) { + if (stage === STAGES.CANARY) { Object.keys(config.dependencies).forEach((dependencyName) => { if (dependencyName.includes("@shopware-pwa")) { config.dependencies[dependencyName] = "canary"; @@ -220,7 +222,7 @@ module.exports = (toolbox: GluegunToolbox) => { toolbox.copyThemeFolder = async (folderName, destination) => { const dest = destination ? destination : folderName; await toolbox.filesystem.copyAsync( - `${toolbox.defaultThemeLocation}/${folderName}`, + path.join(toolbox.defaultThemeLocation, folderName), dest, { overwrite: true } ); @@ -229,7 +231,7 @@ module.exports = (toolbox: GluegunToolbox) => { toolbox.watchThemeFolder = (folderName) => { const fs = require("fs"); fs.watch( - `${toolbox.defaultThemeLocation}/${folderName}`, + path.join(toolbox.defaultThemeLocation, folderName), { recursive: true }, async () => { toolbox.print.info(`Reloading [${folderName}] files...`); diff --git a/packages/cli/src/stages.ts b/packages/cli/src/stages.ts new file mode 100644 index 000000000..1790ea7f9 --- /dev/null +++ b/packages/cli/src/stages.ts @@ -0,0 +1,5 @@ +export const STAGES = { + STABLE: "latest stable (recommended)", + CANARY: "canary (current master branch)", + LOCAL: "local contibution (to contribute locally in shopware-pwa)", +}; diff --git a/packages/default-theme/__e2e__/integration/checkout_desktop.spec.js b/packages/default-theme/__e2e__/integration/add_to_cart_desktop.spec.js similarity index 100% rename from packages/default-theme/__e2e__/integration/checkout_desktop.spec.js rename to packages/default-theme/__e2e__/integration/add_to_cart_desktop.spec.js diff --git a/packages/default-theme/__e2e__/integration/checkout_guest_desktop.spec.js b/packages/default-theme/__e2e__/integration/checkout_guest_desktop.spec.js new file mode 100644 index 000000000..ccfcb2241 --- /dev/null +++ b/packages/default-theme/__e2e__/integration/checkout_guest_desktop.spec.js @@ -0,0 +1,16 @@ +describe("Test Checkout for guest, different billing address, paid in advance, desktop", () => { + beforeEach(() => { + cy.viewport(1280, 800) + }) + it("checks if place my order button works", () => { + cy.addtocart() + cy.wait(1000) + cy.personal_detail_step() + cy.shipping_step() + cy.payment_step() + cy.rewiev_guest_pay_inadvance() + cy.get("[data-cy=place-my-order]").click({ force: true }) + cy.wait(2000) + cy.url().should("contain", Cypress.config().baseUrl + "order?orderId=") + }) +}) diff --git a/packages/default-theme/__e2e__/integration/checkout_payment_step.js b/packages/default-theme/__e2e__/integration/checkout_payment_step.js new file mode 100644 index 000000000..87b916452 --- /dev/null +++ b/packages/default-theme/__e2e__/integration/checkout_payment_step.js @@ -0,0 +1,55 @@ +describe("Payment step with different address for billing and pay in advance method", () => { + beforeEach(() => { + cy.viewport(1280, 800) + cy.addtocart() + cy.wait(1000) + cy.personal_detail_step() + cy.shipping_step() + cy.payment_step() + }) + it("check if there are radio buttons for payment methods", () => { + cy.get('[type="radio"]').should("exist") + cy.get(".sf-radio__label").should("not.be.empty") + }) + it("check if go back to shipping button exist", () => { + cy.get("button").contains("Go back", { matchCase: false }) + }) + it("check if go back to shipping button work", () => { + cy.get("button") + .contains("Go back", { matchCase: false }) + .click({ force: true }) + cy.url().should("eq", Cypress.config().baseUrl + "checkout?step=SHIPPING") + cy.get("[data-cy=continue-to-payment]").click({ force: true }) + }) + it("check if there is checkobox for use different address for billing", () => { + cy.get('[type="checkbox"]').should("exist") + cy.get(".sf-checkbox__label").should("not.be.empty") + }) + + it("requires filling in all the fields", () => { + cy.get('[type="checkbox"]').check({ force: true }) + cy.get("[data-cy=review-order]").click({ force: true }) + + cy.get("[data-cy=form] > [error-message]") + .should("have.length", 8) + .each(($el, index, $list) => { + expect($el).to.contain("This field is required") + }) + }) + it.only("contiunue to rewiev order after filling in address for billing", () => { + cy.get('[type="checkbox"]').check({ force: true }) + cy.get("[data-cy=first-name]").last().clear().type("Bill") + cy.get("[data-cy=last-name]").last().clear().type("Bing") + cy.get("[data-cy=street-name]").last().clear().type("Billable") + cy.get("[data-cy=apartment]").last().clear().type("12") + cy.get("[data-cy=city]").last().clear().type("BillCity") + cy.get("[data-cy=state]").last().clear().type("BillState") + cy.get("[data-cy=zipcode]").last().clear().type("1112SC") + cy.get("[data-cy=phone]").last().clear().type("987654321") + cy.get("[data-cy=country]").click() + cy.get("li").contains("Poland").click({ force: true }) + cy.get('[type="radio"]').eq(2).check({ force: true }) + cy.get("[data-cy=review-order]").click({ force: true }) + cy.url().should("eq", Cypress.config().baseUrl + "checkout?step=REVIEW") + }) +}) diff --git a/packages/default-theme/__e2e__/integration/checkout_personal_detail_step.js b/packages/default-theme/__e2e__/integration/checkout_personal_detail_step.js new file mode 100644 index 000000000..7a50efc0e --- /dev/null +++ b/packages/default-theme/__e2e__/integration/checkout_personal_detail_step.js @@ -0,0 +1,56 @@ +describe("Test Personal detail step", () => { + beforeEach(() => { + cy.viewport(1280, 800) + cy.addtocart() + cy.wait(1000) + cy.personal_detail_step() + }) + it("check if go back to shop button exist", () => { + cy.wait(2000) + cy.get("button").contains("Go Back to shop", { matchCase: false }) + }) + it("check if go back to shop button work", () => { + cy.wait(2000) + cy.get("[data-cy=go-back-to-shop-button").click({ force: true }) + cy.url().should("eq", Cypress.config().baseUrl) + }) + it("requires first name, last name and email", () => { + cy.get("[data-cy=cart-icon] > .sf-icon-path").click({ force: true }) + cy.get("[data-cy=goToCheckout-button").click({ force: true }) + cy.wait(2000) + cy.get("button").contains("Continue to shipping").click({ force: true }) + cy.get('[label="First name"] > .sf-input__error-message > div').should( + "contain", + "First name is required" + ) + cy.get("[data-cy=first-name]").should("contain", "First name is required") + cy.get("[data-cy=last-name").should("contain", "last name is required") + cy.get("[data-cy=proper-email").should( + "contain", + "Proper email is required" + ) + }) + it("requires vailid email", () => { + cy.get(".sf-input__wrapper > [data-cy=first-name]").type("Joe") + cy.get(".sf-input__wrapper > [data-cy=last-name]").type("Example") + cy.get(".sf-input__wrapper > [data-cy=proper-email]").type("invalid") + cy.get("[data-cy=continue-to-shipping-button]").click({ force: true }) + cy.get("[data-cy=proper-email").should( + "contain", + "Proper email is required" + ) + }) + it("continue to shipping after giving vaild first name, last name and email", () => { + cy.get(".sf-input__wrapper > [data-cy=first-name]").type("Joe") + cy.get(".sf-input__wrapper > [data-cy=last-name]").type("Example") + cy.get(".sf-input__wrapper > [data-cy=proper-email]") + .clear() + .type("joe@example.com") + cy.get("[data-cy=proper-email]").should( + "not.contain", + "Proper email is required" + ) + cy.get("[data-cy=continue-to-shipping-button]").click({ force: true }) + cy.url().should("contain", "step=SHIPPING") + }) +}) diff --git a/packages/default-theme/__e2e__/integration/checkout_shipping_step.js b/packages/default-theme/__e2e__/integration/checkout_shipping_step.js new file mode 100644 index 000000000..6fdac9423 --- /dev/null +++ b/packages/default-theme/__e2e__/integration/checkout_shipping_step.js @@ -0,0 +1,55 @@ +describe("shipping step", () => { + beforeEach(() => { + cy.viewport(1280, 800) + cy.addtocart() + cy.wait(1000) + cy.personal_detail_step() + cy.shipping_step() + }) + it("requires filling in all the fields", () => { + cy.get("[data-cy=continue-to-payment]").click({ force: true }) + + cy.get("[data-cy=form] > [error-message]") + .should("have.length", 8) + .each(($el, index, $list) => { + expect($el).to.contain("This field is required", { matchCase: false }) + }) + + cy.get("[data-cy=country]").should("contain", "This field is required") + }) + it("check if go back to personal details button exist", () => { + cy.get("button").contains("Go Back", { matchCase: false }).should("exist") + }) + it("check if go back to personal details button work", () => { + cy.get("button") + .contains("Go Back", { matchCase: false }) + .click({ force: true }) + cy.url().should( + "eq", + Cypress.config().baseUrl + "checkout?step=PERSONAL_DETAILS" + ) + cy.get("[data-cy=continue-to-shipping-button]").click({ force: true }) + }) + it("shows message: Shipping methods", () => { + cy.contains("Shipping methods", { matchCase: false }) + }) + it("check if there are radio buttons for shipping methods", () => { + cy.get('[type="radio"]').should("exist") + cy.get(".sf-radio__label").should("not.be.empty") + }) + it("continue to payment after filing in shipping details", () => { + cy.get("[data-cy=first-name]").last().clear().type("Joe") + cy.get("[data-cy=last-name]").last().clear().type("Example") + cy.get("[data-cy=street-name]").last().clear().type("TestStreet") + cy.get("[data-cy=apartment]").last().clear().type("1") + cy.get("[data-cy=city]").last().clear().type("TestCity") + cy.get("[data-cy=state]").last().clear().type("TestState") + cy.get("[data-cy=zipcode]").last().clear().type("11-11a") + cy.get("[data-cy=phone]").last().clear().type("123456789") + cy.get('[type="radio"]').last().check({ force: true }) + cy.get("[data-cy=country]").click() + cy.get("li").contains("Poland").click({ force: true }) + cy.get("[data-cy=continue-to-payment]").click({ force: true }) + cy.url().should("eq", Cypress.config().baseUrl + "checkout?step=PAYMENT") + }) +}) diff --git a/packages/default-theme/__e2e__/integration/checkout_summary.js b/packages/default-theme/__e2e__/integration/checkout_summary.js new file mode 100644 index 000000000..ab926bb1b --- /dev/null +++ b/packages/default-theme/__e2e__/integration/checkout_summary.js @@ -0,0 +1,50 @@ +const { isTaggedTemplateExpression } = require("typescript") + +describe("Test Checkout functionality for guest user Desktop view", () => { + beforeEach(() => { + cy.viewport(1280, 800) + cy.addtocart() + cy.wait(1000) + cy.personal_detail_step() + cy.shipping_step() + cy.payment_step() + cy.rewiev_guest_pay_inadvance() + }) + it("check if go back to payment button exist", () => { + cy.get("button") + .contains("Go back to Payment", { matchCase: false }) + .should("exist") + }) + it("check if go back to payment button works", () => { + cy.get("[data-cy=go-back-to-payment]").click({ force: true }) + cy.url().should("eq", Cypress.config().baseUrl + "checkout?step=PAYMENT") + }) + it("check if product image is visible", () => { + cy.get("[data-cy=product-image]").should("be.visible") + }) + it.skip("check quantity and amount", () => { + cy.get("[data-cy=quantity]").should("contain", 1) + }) + it("check if personal details are correct", () => { + cy.get("[data-cy=name]") + .should("contain", "Joe Example", { matchCase: false }) + .and("contain", "joe@example.com", { matchCase: false }) + }) + it("check if shipping details are correct", () => { + cy.get("[data-cy=shipping]") + .should("contain", "TestStreet 1, 11-11a", { matchCase: false }) + .and("contain", "TestCity", { matchCase: false }) + .and("contain", "123456789", { matchCase: false }) + }) + it("check if billing address is correct", () => { + cy.get("[data-cy=billing]") + .should("contain", "Billable 12, 1112SC", { matchCase: false }) + .and("contain", "BillCity", { matchCase: false }) + .and("contain", "987654321", { matchCase: false }) + }) + it.only("check if place my order button exist", () => { + cy.get("button") + .contains("Place my order", { matchCase: false }) + .should("exist") + }) +}) diff --git a/packages/default-theme/__e2e__/support/commands.js b/packages/default-theme/__e2e__/support/commands.js index ca4d256f3..61b2be32e 100644 --- a/packages/default-theme/__e2e__/support/commands.js +++ b/packages/default-theme/__e2e__/support/commands.js @@ -22,4 +22,60 @@ // // // -- This will overwrite an existing command -- + +const { createPartiallyEmittedExpression } = require("typescript") + // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) +Cypress.Commands.add("addtocart", () => { + cy.visit("") + cy.wait(5000) + cy.get(".sf-header__link").eq(0).dblclick() + cy.wait(2500) + cy.get(".sf-product-card__title").first().click({ force: true }) + cy.wait(1500) + cy.get(".sf-add-to-cart__button").click({ force: true }) +}) +Cypress.Commands.add("personal_detail_step", () => { + cy.get("[data-cy=cart-icon] > .sf-icon-path").click({ force: true }) + cy.wait(1000) + cy.get("[data-cy=goToCheckout-button").click({ force: true }) +}) +Cypress.Commands.add("shipping_step", () => { + cy.wait(4000) + cy.get(".sf-input__wrapper > [data-cy=first-name]").type("Joe") + cy.get(".sf-input__wrapper > [data-cy=last-name]").type("Example") + cy.get(".sf-input__wrapper > [data-cy=proper-email]") + .clear() + .type("joe@example.com") + cy.get("[data-cy=continue-to-shipping-button]").click({ force: true }) + cy.url().should("contain", "step=SHIPPING") +}) +Cypress.Commands.add("payment_step", () => { + cy.get("[data-cy=first-name]").last().clear().type("Joe") + cy.get("[data-cy=last-name]").last().clear().type("Example") + cy.get("[data-cy=street-name]").last().clear().type("TestStreet") + cy.get("[data-cy=apartment]").last().clear().type("1") + cy.get("[data-cy=city]").last().clear().type("TestCity") + cy.get("[data-cy=state]").last().clear().type("TestState") + cy.get("[data-cy=zipcode]").last().clear().type("11-11a") + cy.get("[data-cy=phone]").last().clear().type("123456789") + cy.get('[type="radio"]').last().check({ force: true }) + cy.get("[data-cy=country]").click() + cy.get("li").contains("Poland").click({ force: true }) + cy.get("[data-cy=continue-to-payment]").click({ force: true }) +}) +Cypress.Commands.add("rewiev_guest_pay_inadvance", () => { + cy.get('[type="checkbox"]').check({ force: true }) + cy.get("[data-cy=first-name]").last().clear().type("Bill") + cy.get("[data-cy=last-name]").last().clear().type("Bing") + cy.get("[data-cy=street-name]").last().clear().type("Billable") + cy.get("[data-cy=apartment]").last().clear().type("12") + cy.get("[data-cy=city]").last().clear().type("BillCity") + cy.get("[data-cy=state]").last().clear().type("BillState") + cy.get("[data-cy=zipcode]").last().clear().type("1112SC") + cy.get("[data-cy=phone]").last().clear().type("987654321") + cy.get("[data-cy=country]").click() + cy.get("li").contains("Poland").click({ force: true }) + cy.get('[type="radio"]').eq(2).check({ force: true }) + cy.get("[data-cy=review-order]").click({ force: true }) +}) diff --git a/packages/default-theme/components/SwCart.vue b/packages/default-theme/components/SwCart.vue index cff31b1b4..125e91fea 100644 --- a/packages/default-theme/components/SwCart.vue +++ b/packages/default-theme/components/SwCart.vue @@ -58,6 +58,7 @@ {{ $t("Go to checkout") }} diff --git a/packages/default-theme/components/checkout/sidebar/SidebarOrderReview.vue b/packages/default-theme/components/checkout/sidebar/SidebarOrderReview.vue index 8a619d7d8..7055cd7c0 100644 --- a/packages/default-theme/components/checkout/sidebar/SidebarOrderReview.vue +++ b/packages/default-theme/components/checkout/sidebar/SidebarOrderReview.vue @@ -7,14 +7,17 @@ /> Review order diff --git a/packages/default-theme/components/checkout/steps/ShippingStep.vue b/packages/default-theme/components/checkout/steps/ShippingStep.vue index cc8e375ed..b3f22e022 100644 --- a/packages/default-theme/components/checkout/steps/ShippingStep.vue +++ b/packages/default-theme/components/checkout/steps/ShippingStep.vue @@ -58,6 +58,7 @@ > Continue to payment diff --git a/packages/default-theme/components/checkout/steps/guest/BillingAddressGuestForm.vue b/packages/default-theme/components/checkout/steps/guest/BillingAddressGuestForm.vue index 38045be4c..370d78aed 100644 --- a/packages/default-theme/components/checkout/steps/guest/BillingAddressGuestForm.vue +++ b/packages/default-theme/components/checkout/steps/guest/BillingAddressGuestForm.vue @@ -5,13 +5,15 @@ label="Use different address for billing" name="copyShippingAddress" class="form__element" + data-cy="different-address-for-billing" /> -
+
@@ -92,6 +101,7 @@ :valid="!validations.phoneNumber.$error" error-message="This field is required" label="Phone number" + data-cy="phone" name="phone" class="form__element" required diff --git a/packages/default-theme/components/checkout/steps/guest/PersonalDetailsGuestForm.vue b/packages/default-theme/components/checkout/steps/guest/PersonalDetailsGuestForm.vue index db036e03b..3daf41c06 100644 --- a/packages/default-theme/components/checkout/steps/guest/PersonalDetailsGuestForm.vue +++ b/packages/default-theme/components/checkout/steps/guest/PersonalDetailsGuestForm.vue @@ -47,6 +47,7 @@ error-message="First name is required" name="firstName" class="form__element form__element--half" + data-cy="first-name" required />

@@ -104,10 +107,12 @@

Go Back to shop Continue to shipping diff --git a/packages/default-theme/components/checkout/steps/guest/ShippingAddressGuestForm.vue b/packages/default-theme/components/checkout/steps/guest/ShippingAddressGuestForm.vue index d349cffbe..4b9f51569 100644 --- a/packages/default-theme/components/checkout/steps/guest/ShippingAddressGuestForm.vue +++ b/packages/default-theme/components/checkout/steps/guest/ShippingAddressGuestForm.vue @@ -1,6 +1,7 @@