Initial commit

This commit is contained in:
2023-12-04 14:33:09 +07:00
commit cd4d75d0c4
274 changed files with 39819 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
describe("Product page", () => {
it("fetches product with handle [t-shirt]", () => {
cy.visit("/products/t-shirt")
cy.get("h1").contains("Medusa T-Shirt")
})
it("adds a product to the cart", () => {
cy.visit("/products/t-shirt")
cy.get("button").click()
cy.get("[data-cy=cart_quantity]").contains("1")
})
it("adds a product twice to the cart", () => {
cy.visit("/products/t-shirt")
cy.get("button").click()
cy.get("button").click()
cy.get("[data-cy=cart_quantity]").contains("2")
})
it("changes the current image by clicking a thumbnail", () => {
cy.visit("/products/t-shirt")
cy.get("[data-cy=current_image]")
.should("have.attr", "src")
.and("match", /.+(tee\-black\-front).+/)
cy.get("[data-cy=product_image_2]").click()
cy.get("[data-cy=current_image]")
.should("have.attr", "src")
.and("match", /.+(tee\-black\-back).+/)
})
})