-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCart.js
More file actions
26 lines (23 loc) · 1.01 KB
/
Cart.js
File metadata and controls
26 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class Cart {
addToCart() {
cy.visit('https://in.puma.com/in/en/womens');
// Wait until the product list is loaded
cy.get('#product-list-items').should('be.visible');
cy.contains('Blktop Rider Vibrant Women').click();
cy.wait(4000)
// Wait for the product page to load
cy.get('[aria-label="Select Size"]').scrollIntoView().click({ force: true });
// Select the specific size 'UK 4'
cy.contains('UK 4').click();
// Add the product to the cart
cy.get('[data-test-id="add-to-cart-button"]').should('be.visible').click();
}
removeProduct(){
cy.visit('https://in.puma.com/in/en/cart');
cy.wait(4000);
cy.get('[data-test-id="remove-product-button"]').scrollIntoView().click({ force: true });
cy.get('#confirm-button').click();
cy.get('[aria-labelledby="section-cart-title"]').should('contain','Your Shopping Cart is Empty');
}
}
export default Cart;