diff --git a/tests/cart.spec.js b/tests/cart.spec.js new file mode 100644 index 00000000..e356e66f --- /dev/null +++ b/tests/cart.spec.js @@ -0,0 +1,64 @@ +const { test, expect } = require('@playwright/test'); + + +test('Check header elements exist', async ({ page }) => { + await page.goto('http://localhost:8081/cart'); + + const header = page.locator('app-header#header'); + await expect(header).toBeVisible(); + + // Check if the logo exists + const logo = header.locator('.logo a[aria-label="SHOP Home"]'); + await expect(logo).toBeVisible(); + await expect(logo).toHaveText('SHOP'); + + // Check if the shopping cart button exists + const cartButton = header.locator('.cart-btn-container paper-icon-button[icon="shopping-cart"]'); + await expect(cartButton).toBeVisible(); + }); + + +test('Check if product details exist on the page', async ({ page }) => { + await page.goto('http://localhost:8081/detail/mens_outerwear/Tri-blend+Full-Zip+Hoodie'); + + // Check if the