Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ If you only need the Hyvä tests:

```
rm -rf cypress/{fixtures,page-objects,integration}/luma
rm -rf cypress/{integration}/luma-accessibility
```

If you only need the Luma tests;
Expand Down
14 changes: 14 additions & 0 deletions cypress/page-objects/luma/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,19 @@ export class Cart {
cy.get(cart.addCouponButton).click()
cy.wait(3000)
}

static emptyCart() {
cy.visit(cart.url.cartUrl)
cy.wait(3000)

cy.log('Check of the cart is already empty.')

cy.get('body').then((body) => {
if (body.find(cart.emptyCartTextField).length === 0) {
cy.get(cart.deleteProductButton).as('btn').should('be.visible')
cy.get('@btn').click({force: true, multiple: true})
}
});
}
}