Skip to content

Commit f66f863

Browse files
committed
feat(e2e): add orders page fixture
1 parent a74289c commit f66f863

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

e2e/fixtures/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { CategoryPage } from "./category-page"
55
import { CheckoutPage } from "./checkout-page"
66
import { OrderPage } from "./order-page"
77
import { ProductPage } from "./product-page"
8+
import { StorePage } from "./store-page"
89

910
export const fixtures = base.extend<{
1011
resetDatabaseFixture: void
@@ -13,6 +14,7 @@ export const fixtures = base.extend<{
1314
checkoutPage: CheckoutPage
1415
orderPage: OrderPage
1516
productPage: ProductPage
17+
storePage: StorePage
1618
}>({
1719
page: async ({ page }, use) => {
1820
await page.goto("/")
@@ -45,4 +47,8 @@ export const fixtures = base.extend<{
4547
const productPage = new ProductPage(page)
4648
await use(productPage)
4749
},
50+
storePage: async ({ page }, use) => {
51+
const storePage = new StorePage(page)
52+
await use(storePage)
53+
},
4854
})

e2e/fixtures/store-page.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Locator, Page } from "@playwright/test"
2+
import { CategoryPage } from "./category-page"
3+
4+
export class StorePage extends CategoryPage {
5+
pageTitle: Locator
6+
7+
constructor(page: Page) {
8+
super(page)
9+
this.pageTitle = page.getByTestId("store-page-title")
10+
}
11+
12+
async goto() {
13+
await this.navMenu.open()
14+
await this.navMenu.storeLink.click()
15+
await this.pageTitle.waitFor({ state: "visible" })
16+
await this.productsListLoader.waitFor({ state: "hidden" })
17+
}
18+
}

0 commit comments

Comments
 (0)