Skip to content

Commit

Permalink
[INFRA] #24 add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
nisrineMach committed Mar 17, 2022
1 parent a41b795 commit 201de3a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cypress/integration/hyva/cart/cart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
17 changes: 17 additions & 0 deletions cypress/integration/hyva/cart/minicart.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',() => {
Expand Down

0 comments on commit 201de3a

Please sign in to comment.