Build a complete POM framework for the Shopping Portal. Follow these exercises in order — each one builds on the previous.
- Exercise 1 — Create BasePage with common methods: click(), type(), getText(), isDisplayed(), selectByVisibleText(), findElements().
- Exercise 2 — Create ShopHomePage with searchFor() returning CatalogPage, clickCategory(), and openCart() returning CartPage.
- Exercise 3 — Create CatalogPage with getProductCount(), getProductNames(), sortBy() returning this, addProductByName() returning this.
- Exercise 4 — Create CartPage with getItemCount(), getCartTotal(), proceedToCheckout() returning CheckoutPage.
- Exercise 5 — Create CheckoutPage with fillShipping(), placeOrder(), isOrderConfirmed(), getOrderNumber().
- Exercise 6 — Create HeaderComponent with clickLogout(), navigateTo(). Compose it into DashboardPage and ShopHomePage.
- Exercise 7 — Write a test that goes through the full flow: search → add to cart → checkout → verify confirmation. All assertions in the test class.
Start with BasePage and LoginPage. Get one test working, then add more pages. Do not try to build all page classes before writing your first test.