import { Locator, Page } from '@playwright/test'; /** * Order history, which is a page rather than a modal. * * That distinction is the point of the specs using this: /orders is * deliberately not in MODAL_ROUTES, so there is no dialog and the storefront is * not rendered behind it. Putting it back would quietly undo that, which is why * the absence of a dialog is asserted rather than assumed. */ export class OrdersPage { readonly heading: Locator; readonly noOrdersNotice: Locator; readonly continueShoppingButton: Locator; readonly backToShopButton: Locator; readonly anyDialog: Locator; constructor(private readonly page: Page) { this.heading = page.getByRole('heading', { name: 'Order History' }); this.noOrdersNotice = page.getByText('No orders yet'); this.continueShoppingButton = page.getByRole('button', { name: 'Continue Shopping' }); this.backToShopButton = page.getByRole('button', { name: 'Back to Shop' }); this.anyDialog = page.getByRole('dialog'); } async goto(): Promise { await this.page.goto('/orders'); } }