diff --git a/src/page-objects/AdministrationPages.ts b/src/page-objects/AdministrationPages.ts index 4905b4d..23821e2 100644 --- a/src/page-objects/AdministrationPages.ts +++ b/src/page-objects/AdministrationPages.ts @@ -14,6 +14,8 @@ import { ShippingListing } from './administration/ShippingListing'; import { LandingPageCreate } from './administration/LandingPageCreate'; import { LandingPageDetail } from './administration/LandingPageDetail'; import { Categories } from './administration/Categories'; +import { OrderListing } from './administration/OrderListing'; +import { OrderBulkEdit } from './administration/OrderBulkEdit'; export interface AdministrationPageTypes { AdminProductDetail: ProductDetail; @@ -29,6 +31,8 @@ export interface AdministrationPageTypes { AdminCategories: Categories; AdminLandingPageCreate: LandingPageCreate; AdminLandingPageDetail: LandingPageDetail; + AdminOrderListing: OrderListing; + AdminOrderBulkEdit: OrderBulkEdit; } export const AdminPageObjects = { @@ -45,6 +49,8 @@ export const AdminPageObjects = { Categories, LandingPageCreate, LandingPageDetail, + OrderListing, + OrderBulkEdit, } export const test = base.extend({ @@ -100,4 +106,12 @@ export const test = base.extend({ AdminLandingPageCreate: async ({ AdminPage }, use) => { await use(new LandingPageCreate(AdminPage)); }, + + AdminOrderListing: async ({ AdminPage }, use) => { + await use(new OrderListing(AdminPage)); + }, + + AdminOrderBulkEdit: async ({ AdminPage }, use) => { + await use(new OrderBulkEdit(AdminPage)); + }, }); \ No newline at end of file diff --git a/src/page-objects/administration/OrderBulkEdit.ts b/src/page-objects/administration/OrderBulkEdit.ts new file mode 100644 index 0000000..90d82e2 --- /dev/null +++ b/src/page-objects/administration/OrderBulkEdit.ts @@ -0,0 +1,26 @@ +import type { Page, Locator } from '@playwright/test'; +import type { PageObject } from '../../types/PageObject'; + +export class OrderBulkEdit implements PageObject { + public readonly header: Locator; + public readonly statusCard: Locator; + public readonly changePaymentStatus: Locator; + + + + constructor(public readonly page: Page) { + this.header = page.locator('.smart-bar__header'); + + //Status Card + this.statusCard = page.locator('.sw-bulk-edit-order-base__status'); + this.changePaymentStatus = page.getByText('Change: Payment status'); + + + + + } + + url() { + return '#/sw/order/index/'; + } +} \ No newline at end of file diff --git a/src/page-objects/administration/OrderListing.ts b/src/page-objects/administration/OrderListing.ts new file mode 100644 index 0000000..940b687 --- /dev/null +++ b/src/page-objects/administration/OrderListing.ts @@ -0,0 +1,23 @@ +import type { Page, Locator } from '@playwright/test'; +import type { PageObject } from '../../types/PageObject'; + +export class OrderListing implements PageObject { + public readonly header: Locator; + public readonly addOrderButton: Locator; + public readonly contextMenu: Locator; + public readonly selectAllCheckbox: Locator; + + + constructor(public readonly page: Page) { + this.header = page.locator('.smart-bar__header'); + this.addOrderButton = page.getByText('Add order', { exact: true }); + this.contextMenu = page.locator('.sw-data-grid-settings__trigger'); + this.selectAllCheckbox = page.locator('.sw-field--checkbox').first(); + + + } + + url() { + return '#/sw/order/index/'; + } +} \ No newline at end of file