Skip to content

Commit

Permalink
Migrate @pages/BO/orders/add from Core
Browse files Browse the repository at this point in the history
  • Loading branch information
Progi1984 committed Jan 16, 2025
1 parent 7641795 commit e0b37f8
Show file tree
Hide file tree
Showing 4 changed files with 1,386 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ export {default as boModuleSelectionPage} from '@pages/BO/modules/modulesAndServ
export {default as boMyProfilePage} from '@pages/BO/advancedParameters/team/myProfile';
export {default as boNewExperimentalFeaturesPage} from '@pages/BO/advancedParameters/newExperimentalFeatures';
export {default as boOrdersPage} from '@pages/BO/orders';
export {default as boOrdersCreatePage} from '@pages/BO/orders/create';
export {default as boOrdersViewBasePage} from '@pages/BO/orders/view/viewOrderBasePage';
export {default as boOrdersViewBlockProductsPage} from '@pages/BO/orders/view/blockProducts';
export {default as boOrdersViewBlockTabListPage} from '@pages/BO/orders/view/blockTabList';
Expand Down
104 changes: 104 additions & 0 deletions src/interfaces/BO/orders/create.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import type FakerCustomer from '@data/faker/customer';
import type FakerOrder from '@data/faker/order';
import type FakerOrderStatus from '@data/faker/orderStatus';
import type FakerProduct from '@data/faker/product';
import {BOBasePagePageInterface} from '@interfaces/BO';
import {type Frame, type Page} from '@playwright/test';

export interface BOOrdersCreatePageInterface extends BOBasePagePageInterface {
readonly cartRuleAlreadyExistErrorText: string;
readonly emailSendSuccessMessage: string;
readonly noCustomerFoundText: string;
readonly noProductFoundText: string;
readonly noVoucherFoudErrorMessage: string;
readonly pageTitle: string;
readonly voucherDisabledErrorMessage: string;

addNewCustomer(page: Page, customerData: FakerCustomer): Promise<string>;
addProductQuantity(page: Page, quantity: number, row: number): Promise<void>;
addProductToCartAndGetAlert(
page: Page,
productToSearch: string,
productToSelect: string,
quantity?: number,
): Promise<string>
addProductToCart(
page: Page,
productToSearch: FakerProduct,
productToSelect: string,
quantity?: number,
customizedValue?: string,
): Promise<void>;
chooseCustomer(page: Page, cardPosition?: number): Promise<boolean>;
chooseDeliveryAddress(page: Page, deliveryAddress: string): Promise<string>;
chooseInvoiceAddress(page: Page, invoiceAddress: string): Promise<string>;
clickOnAddNewAddressButton(page: Page): Promise<boolean>;
clickOnAddVoucherButton(page: Page): Promise<boolean>;
clickOnCartDetailsButton(page: Page, row?: number): Promise<boolean>;
clickOnCartUseButton(page: Page, row?: number): Promise<boolean>;
clickOnCreateOrderButton(page: Page, waitForNavigation?: boolean): Promise<boolean>;
clickOnDetailsButton(page: Page): Promise<boolean>;
clickOnEditDeliveryAddressButton(page: Page): Promise<boolean>;
clickOnEditInvoiceAddressButton(page: Page): Promise<boolean>;
clickOnOrderDetailsButton(page: Page, row?: number): Promise<boolean>;
clickOnOrdersTab(page: Page): Promise<boolean>;
clickOnOrderUseButton(page: Page, row?: number): Promise<boolean>;
closeIframe(page: Page): Promise<boolean>;
createOrder(page: Page, orderToMake: FakerOrder, isNewCustomer?: boolean): Promise<void>;
getAddAddressIframe(page: Page): Frame | null;
getCartRuleErrorText(page: Page): Promise<string>;
getCreateVoucherIframe(page: Page): Frame | null;
getCustomerCardBody(page: Page, cardPosition?: number): Promise<string>;
getCustomerIframe(page: Page, customerID: number): Frame | null;
getCustomerNameFromResult(page: Page, cardPosition?: number): Promise<string>;
getCustomersSearchNumber(page: Page): Promise<number>;
getDeliveryAddressDetails(page: Page): Promise<string>;
getDeliveryAddressList(page: Page): Promise<string>;
getDeliveryOption(page: Page): Promise<string>;
getEditAddressIframe(page: Page): Frame | null;
getInvoiceAddressDetails(page: Page): Promise<string>;
getNoCustomerFoundError(page: Page): Promise<string>;
getOrderIframe(page: Page, orderID: number): Frame | null;
getOrdersNumber(page: Page): Promise<number>;
getProductDetailsFromTable(page: Page, row?: number): Promise<{reference: string, image: string, quantityMax: number, price: number, description: string, quantityMin: number}>;

Check failure on line 63 in src/interfaces/BO/orders/create.ts

View workflow job for this annotation

GitHub Actions / ESLint

This line has a length of 178. Maximum allowed is 130
getProductGiftDetailsFromTable(page: Page, row?: number): Promise<{reference: string, image: string, quantity: number, price: string, description: string, basePrice: string}>

Check failure on line 64 in src/interfaces/BO/orders/create.ts

View workflow job for this annotation

GitHub Actions / ESLint

This line has a length of 176. Maximum allowed is 130
getShippingCost(page: Page): Promise<string>;
getShoppingCartIframe(page: Page, cartId: number): Frame | null;
getSummaryDetails(page: Page): Promise<{
totalTaxIncluded: string,
totalVouchers: string,
totalTaxes: string,
totalProducts: string,
totalTaxExcluded: string,
totalShipping: string,
}>;
getTextColumnFromCartsTable(page: Page, column: string, row?: number): Promise<string>;
getTextFromOrdersTable(page: Page, column: string, row?: number): Promise<string>;
getTextWhenCartsTableIsEmpty(page: Page): Promise<string>;
getTotal(page: Page): Promise<string>;
getVoucherDetailsFromTable(page: Page, row?: number): Promise<{name: string, description: string, value: number}>;
isProductNotVisibleInCart(page: Page, row: number): Promise<boolean>;
isProductTableRowNotVisible(page: Page, row: number): Promise<boolean>;
isShippingBlockVisible(page: Page): Promise<boolean>;
isSummaryBlockVisible(page: Page): Promise<boolean>;
isVouchersTableNotVisible(page: Page): Promise<boolean>;
removeProduct(page: Page, row?: number): Promise<boolean>;
removeVoucher(page: Page, row?: number): Promise<void>;
searchCustomer(page: Page, customer: string): Promise<void>;
searchProductAndGetAlert(page: Page, productName: string): Promise<string>;
searchVoucher(page: Page, voucherName: string): Promise<string>;
selectAnotherCurrency(page: Page, currency: string): Promise<void>;
selectAnotherLanguage(page: Page, language: string): Promise<void>;
setDeliveryOption(page: Page, deliveryOptionName: string, isFreeShipping?: boolean): Promise<string>;
setFreeShipping(page: Page, isEnabled: boolean): Promise<void>;
setGift(page: Page, isEnabled: boolean): Promise<void>;
setGiftMessage(page: Page, giftMessage: string): Promise<void>;
setMoreActionsPreFilledOrder(page: Page): Promise<string>;
setMoreActionsProceedToCheckout(page: Page): Promise<Page>;
setOrderMessage(page: Page, message: string): Promise<void>;
setOrderStatus(page: Page, orderStatus: FakerOrderStatus): Promise<void>;
setPaymentMethod(page: Page, paymentMethodModuleName: string): Promise<void>;
setRecycledPackaging(page: Page, isEnabled: boolean): Promise<void>;
setSummaryAndCreateOrder(page: Page, paymentMethodModuleName: string, orderStatus: FakerOrderStatus): Promise<void>;
waitForVisibleProductImage(page: Page, row: number, image: string): Promise<void>;
}
10 changes: 10 additions & 0 deletions src/pages/BO/orders/create.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type {BOOrdersCreatePageInterface} from '@interfaces/BO/orders/create';

/* eslint-disable global-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */
function requirePage(): BOOrdersCreatePageInterface {
return require('@versions/develop/pages/BO/orders/create');
}

/* eslint-enable global-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires */

export default requirePage();
Loading

0 comments on commit e0b37f8

Please sign in to comment.