Overview
BasePage is the foundational class that all page object classes extend. It provides common properties and protected methods that are inherited by all page objects in the framework.
Location: cypress/support/pages/BasePage.ts
Class Definition
Constructor
The constructor initializes common selectors used across multiple pages.Properties
Selector for inventory items, used across HomePage and Checkout pages for product manipulation and verification.
Methods
goToUrl
Navigates to a specified URL using Cypress visit command.The URL to navigate to
Inheritance
The following page objects extend BasePage:- LoginPage - User authentication page
- HomePage - Product listing and filtering page
- Checkout - Shopping cart and checkout page
Design Pattern
BasePage implements the Page Object Model (POM) design pattern, which:- Encapsulates page-specific selectors and actions
- Provides reusability through inheritance
- Improves test maintainability
- Reduces code duplication
Related Pages
LoginPage
User authentication page object
HomePage
Product listing page object