Skip to content

Commit

Permalink
feat: NEXT-39291 - create order listing and order bulk edit
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavli committed Nov 15, 2024
1 parent 8acda73 commit d95fb89
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/page-objects/AdministrationPages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -29,6 +31,8 @@ export interface AdministrationPageTypes {
AdminCategories: Categories;
AdminLandingPageCreate: LandingPageCreate;
AdminLandingPageDetail: LandingPageDetail;
AdminOrderListing: OrderListing;
AdminOrderBulkEdit: OrderBulkEdit;
}

export const AdminPageObjects = {
Expand All @@ -45,6 +49,8 @@ export const AdminPageObjects = {
Categories,
LandingPageCreate,
LandingPageDetail,
OrderListing,
OrderBulkEdit,
}

export const test = base.extend<FixtureTypes>({
Expand Down Expand Up @@ -100,4 +106,12 @@ export const test = base.extend<FixtureTypes>({
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));
},
});
26 changes: 26 additions & 0 deletions src/page-objects/administration/OrderBulkEdit.ts
Original file line number Diff line number Diff line change
@@ -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/';
}
}
23 changes: 23 additions & 0 deletions src/page-objects/administration/OrderListing.ts
Original file line number Diff line number Diff line change
@@ -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/';
}
}

0 comments on commit d95fb89

Please sign in to comment.