From 201de3a03a5bfa5df59e4c22edbec649295362f1 Mon Sep 17 00:00:00 2001 From: nisrineMach <52917035+nisrineMach@users.noreply.github.com> Date: Thu, 17 Mar 2022 16:10:26 +0100 Subject: [PATCH] [INFRA] #24 add missing test --- cypress/integration/hyva/cart/cart.spec.js | 7 ++++++- cypress/integration/hyva/cart/minicart.spec.js | 17 +++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/cypress/integration/hyva/cart/cart.spec.js b/cypress/integration/hyva/cart/cart.spec.js index 6746192..b3b56ef 100644 --- a/cypress/integration/hyva/cart/cart.spec.js +++ b/cypress/integration/hyva/cart/cart.spec.js @@ -125,6 +125,11 @@ describe("Cart tests", () => { }); it("merges an already existing cart when a customer logs in", () => { - //test goes here + cy.get(cart.productNameInCart).invoke('text').then(productName => { + Account.login(account.customerLogin.username, account.customerLogin.password); + cy.visit(cart.url.cartUrl); + cy.get(cart.productNameInCart).should('have.text', productName) + }) + Account.logout(); }); }); diff --git a/cypress/integration/hyva/cart/minicart.spec.js b/cypress/integration/hyva/cart/minicart.spec.js index 9c7d282..84ceea9 100644 --- a/cypress/integration/hyva/cart/minicart.spec.js +++ b/cypress/integration/hyva/cart/minicart.spec.js @@ -34,6 +34,23 @@ describe('Mini cart tests', () => { cy.get(selectors.miniCartCheckoutButton).click() cy.get(selectors.pageTitle).should('contains.text', 'Checkout').should('be.visible') }) + + it('can open minicart slider', () => { + cy.get(selectors.miniCartSlider).should('be.visible') + }) + + it('can change amount in the minicart', () => { + cy.get(selectors.miniCartSlider).within(() => { + cy.get(selectors.miniCartEditProductButton).click() + }) + cy.get(selectors.qtyInputField) + .type("{backspace}2{enter}") + .should("have.value", "2"); + cy.get(selectors.addToCartButton).click() + cy.get(selectors.miniCartButton).click() + cy.get(selectors.productQty) + .should('have.text', '2') + }) }) describe('Test without added product',() => {