Skip to content

Commit 8efcae3

Browse files
committed
Added support for ps_emailalerts
1 parent 864d7db commit 8efcae3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3605
-1858
lines changed

package-lock.json

+1,014-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
"dependencies": {
2727
"@faker-js/faker": "^8.3.1",
2828
"@playwright/test": "^1.40.1",
29+
"csv-writer": "^1.6.0",
30+
"jpeg-js": "^0.4.4",
31+
"js-image-generator": "^1.0.4",
32+
"pdfjs-dist": "^3.4.120",
2933
"semver": "^7.5.4"
3034
},
3135
"devDependencies": {

src/data/faker/import.ts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type {
2+
ImportAddress,
3+
ImportBrand,
4+
ImportCategory,
5+
ImportCombination,
6+
ImportCreator,
7+
ImportCustomer,
8+
ImportHeaderItem,
9+
ImportProduct,
10+
} from '@data/types/import';
11+
12+
/**
13+
* Create new address to use in customer address form on BO and FO
14+
* @class
15+
*/
16+
export default class FakerImport {
17+
public readonly entity: string;
18+
19+
public readonly header: ImportHeaderItem[];
20+
21+
public readonly records: ImportAddress[]|ImportBrand[]|ImportCategory[]|ImportCombination[]|ImportCustomer[]|ImportProduct[];
22+
23+
/**
24+
* Constructor for class ImportData
25+
* @param valueToCreate {ImportCreator} Could be used to force the value of some members
26+
*/
27+
constructor(valueToCreate: ImportCreator) {
28+
this.entity = valueToCreate.entity;
29+
this.header = valueToCreate.header;
30+
this.records = valueToCreate.records;
31+
}
32+
}

src/data/faker/product.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ export default class FakerProduct {
134134
public deliveryTime: string;
135135

136136
/**
137-
* Constructor for class FakerProduct
138-
* @param productToCreate {Object} Could be used to force the value of some members
139-
* @todo Replace taxRule & tax by FakerTax object
140-
* @todo Rename price to priceTaxIncluded
141-
* @todo Check if retailPrice & finalPrice can be removed
142-
*/
137+
* Constructor for class FakerProduct
138+
* @param productToCreate {Object} Could be used to force the value of some members
139+
* @todo Replace taxRule & tax by FakerTax object
140+
* @todo Rename price to priceTaxIncluded
141+
* @todo Check if retailPrice & finalPrice can be removed
142+
*/
143143
constructor(productToCreate: ProductCreator = {}) {
144144
/** @type {number} ID of the product */
145145
this.id = productToCreate.id || 0;

src/data/types/import.ts

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
type ImportAddress = {
2+
id: number
3+
alias: string
4+
active: number
5+
email: string
6+
customerID: number
7+
manufacturer: string
8+
supplier: string
9+
company: string
10+
lastname: string
11+
firstname: string
12+
address1: string
13+
address2: string
14+
zipCode: string
15+
city: string
16+
country: string
17+
state: string
18+
other: string
19+
phone: string
20+
mobilePhone: string
21+
vatNumber: string
22+
dni: string
23+
};
24+
25+
type ImportBrand = {
26+
id: number
27+
active: number
28+
name: string
29+
description: string
30+
shortDescription: string
31+
metaTitle: string
32+
metaKeywords: string[]
33+
metaDescription: string
34+
imageURL: string
35+
};
36+
37+
type ImportCategory = {
38+
id: number
39+
active: number
40+
name: string
41+
parent_category: string
42+
root_category: string
43+
description: string
44+
};
45+
46+
type ImportCombination = {
47+
id: number
48+
reference: string
49+
attribute: string
50+
value: string
51+
};
52+
53+
type ImportCreator = {
54+
entity: string
55+
header: ImportHeaderItem[]
56+
records: ImportAddress[]|ImportBrand[]|ImportCategory[]|ImportCombination[]|ImportCustomer[]|ImportProduct[]
57+
}
58+
59+
type ImportCustomer = {
60+
id: number
61+
active: number
62+
title: number
63+
email: string
64+
password: string
65+
birthdate: string
66+
lastName: string
67+
firstName: string
68+
newsletter: number
69+
optIn: number
70+
registrationDate: string
71+
groups: string
72+
defaultGroup: string
73+
};
74+
75+
type ImportHeaderItem = {
76+
id: string
77+
title: string
78+
}
79+
80+
type ImportProduct = {
81+
id: number
82+
active: number
83+
name: string
84+
categories: string
85+
price_TEXC: string
86+
tax_rule_id: string
87+
cost_price: string
88+
on_sale: string
89+
discount_amount: string
90+
discount_percent: string
91+
discount_from: string
92+
discount_to: string
93+
reference: string
94+
supplier_reference: string
95+
supplier: string
96+
brand: string
97+
ean13: string
98+
upc: string
99+
value: string
100+
mpn: string
101+
width: string
102+
height: string
103+
depth: string
104+
weight: string
105+
delivery_time_in_stock: string
106+
delivery_time_out_of_stock: string
107+
quantity: number
108+
};
109+
110+
export type {
111+
ImportAddress,
112+
ImportBrand,
113+
ImportCategory,
114+
ImportCombination,
115+
ImportCreator,
116+
ImportCustomer,
117+
ImportHeaderItem,
118+
ImportProduct,
119+
};

src/data/types/product.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ type ProductFiles = {
8787
file: string,
8888
}
8989

90+
type ProductImageInformation = {
91+
id: number,
92+
isCover: boolean,
93+
position: number,
94+
caption: {
95+
en: string,
96+
fr: string
97+
},
98+
};
99+
90100
type ProductCombinationOptions = {
91101
reference: string
92102
impactOnPriceTExc: number
@@ -184,16 +194,6 @@ type ProductImageUrls = {
184194
thumbImage: string
185195
};
186196

187-
type ProductImageInformation = {
188-
id: number,
189-
isCover: boolean,
190-
position: number,
191-
caption: {
192-
en: string,
193-
fr: string
194-
},
195-
};
196-
197197
type ProductPackItem = {
198198
reference: string
199199
quantity: number
@@ -245,8 +245,8 @@ export type {
245245
ProductDiscount,
246246
ProductFilterMinMax,
247247
ProductHeaderSummary,
248-
ProductImageUrls,
249248
ProductImageInformation,
249+
ProductImageUrls,
250250
ProductInformations,
251251
ProductPackItem,
252252
ProductPackInformation,

src/index.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export {default as FakerCountry} from '@data/faker/country';
4848
export {default as FakerCurrency} from '@data/faker/currency';
4949
export {default as FakerCustomer} from '@data/faker/customer';
5050
export {default as FakerGroup} from '@data/faker/group';
51+
export {default as FakerImport} from '@data/faker/import';
5152
export {default as FakerModule} from '@data/faker/module';
5253
export {default as FakerOrderStatus} from '@data/faker/orderStatus';
5354
export {default as FakerOrder} from '@data/faker/order';
@@ -60,12 +61,19 @@ export {default as FakerTax} from '@data/faker/tax';
6061
export {default as FakerTitle} from '@data/faker/title';
6162
export {default as FakerZone} from '@data/faker/zone';
6263

64+
// Export common
65+
export {default as opsBOCatalogProduct} from '@ops/BO/catalog/product';
66+
6367
// Export Pages
6468
export * as CommonPage from '@pages/commonPage';
6569
// Export Pages BO
6670
export * as BOBasePage from '@pages/BO/BOBasePage';
6771
export {default as boLoginPage} from '@pages/BO/login';
6872
export {default as boDashboardPage} from '@pages/BO/dashboard';
73+
export {default as boDesignPositionsPage} from '@pages/BO/design/positions/index';
74+
export {default as boDesignPositionsHookModulePage} from '@pages/BO/design/positions/hookModule';
75+
export {default as boModuleManagerPage} from '@pages/BO/modules/moduleManager';
76+
export {default as boModuleManagerUninstalledModulesPage} from '@pages/BO/modules/moduleManager/uninstalledModules';
6977
export {default as boOrdersPage} from '@pages/BO/orders';
7078
export {default as boOrdersViewBasePage} from '@pages/BO/orders/view/viewOrderBasePage';
7179
export {default as boOrdersViewProductsBlockPage} from '@pages/BO/orders/view/productsBlock';
@@ -77,7 +85,7 @@ export {default as boProductsCreateTabDetailsPage} from '@pages/BO/catalog/produ
7785
export {default as boProductsCreateTabOptionsPage} from '@pages/BO/catalog/products/create/tabOptions';
7886
export {default as boProductsCreateTabPackPage} from '@pages/BO/catalog/products/create/tabPack';
7987
export {default as boProductsCreateTabPricingPage} from '@pages/BO/catalog/products/create/tabPricing';
80-
export {default as boProductsCreateTabSEOPage} from '@pages/BO/catalog/products/create/tabSeo';
88+
export {default as boProductsCreateTabSeoPage} from '@pages/BO/catalog/products/create/tabSeo';
8189
export {default as boProductsCreateTabShippingPage} from '@pages/BO/catalog/products/create/tabShipping';
8290
export {default as boProductsCreateTabStocksPage} from '@pages/BO/catalog/products/create/tabStocks';
8391
export {default as boProductsCreateTabVirtualProductPage} from '@pages/BO/catalog/products/create/tabVirtualProduct';
@@ -97,5 +105,6 @@ export {default as modBlockwishlistBoMain} from '@pages/BO/modules/blockwishlist
97105
export {default as modBlockwishlistBoStatistics} from '@pages/BO/modules/blockwishlist/statistics';
98106

99107
// Export utils
100-
export {default as testContext} from '@utils/test';
101-
export {default as basicHelper} from '@utils/basicHelper';
108+
export {default as utilsBasicHelper} from '@utils/basicHelper';
109+
export {default as utilsFile} from '@utils/file';
110+
export {default as utilsTest} from '@utils/test';

src/interfaces/BO/catalog/products/create/tabDescription.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
3-
import type {Page} from '@playwright/test';
4-
51
import type FakerProduct from '@data/faker/product';
62
import type {ProductImageInformation} from '@data/types/product';
3+
import {BOBasePagePageInterface} from '@interfaces/BO';
4+
import type {Page} from '@playwright/test';
75

86
export interface BOProductsCreateTabDescriptionPageInterface extends BOBasePagePageInterface {
97
addNewCategory(page: Page, categories: string[]): Promise<void>;

src/interfaces/BO/catalog/products/create/tabDetails.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
3-
import type {Page} from '@playwright/test';
4-
51
import type FakerProduct from '@data/faker/product';
62
import type {ProductFeatures} from '@data/types/product';
3+
import {BOBasePagePageInterface} from '@interfaces/BO';
4+
import type {Page} from '@playwright/test';
75

86
export interface BOProductsCreateTabDetailsPageInterface extends BOBasePagePageInterface {
97
addNewCustomizations(page: Page, productData: FakerProduct): Promise<void>;

src/interfaces/BO/catalog/products/create/tabOptions.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
32
import type {Page} from '@playwright/test';
43

54
export interface BOProductsCreateTabOptionsPageInterface extends BOBasePagePageInterface {

src/interfaces/BO/catalog/products/create/tabPack.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
3-
import type {Page} from '@playwright/test';
4-
51
import type {
62
ProductPackInformation,
73
ProductPackItem,
84
ProductPackOptions,
95
ProductStockMovement,
106
} from '@data/types/product';
7+
import {BOBasePagePageInterface} from '@interfaces/BO';
8+
import type {Page} from '@playwright/test';
119

1210
export interface BOProductsCreateTabPackPageInterface extends BOBasePagePageInterface {
1311
addProductToPack(page: Page, product: string, quantity: number): Promise<void>;

src/interfaces/BO/catalog/products/create/tabPricing.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
3-
import type {Page} from '@playwright/test';
4-
51
import FakerProduct from '@data/faker/product';
62
import type {ProductSpecificPrice} from '@data/types/product';
3+
import {BOBasePagePageInterface} from '@interfaces/BO';
4+
import type {Page} from '@playwright/test';
75

86
export interface BOProductsCreateTabPricingPageInterface extends BOBasePagePageInterface {
97
addEcoTax(page: Page, ecoTax: number): Promise<void>

src/interfaces/BO/catalog/products/create/tabSeo.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
32
import type {Page} from '@playwright/test';
43

54
export interface BOProductsCreateTabSeoPageInterface extends BOBasePagePageInterface {

src/interfaces/BO/catalog/products/create/tabShipping.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
import type FakerProduct from '@data/faker/product';
12
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
33
import type {Page} from '@playwright/test';
44

5-
import type FakerProduct from '@data/faker/product';
6-
75
export interface BOProductsCreateTabShippingPageInterface extends BOBasePagePageInterface {
86
clickOnEditDeliveryTimeLink(page: Page): Promise<Page>;
97
getValue(page: Page, inputName: string, languageId?: string): Promise<string>;

src/interfaces/BO/catalog/products/create/tabStocks.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
31
import type FakerProduct from '@data/faker/product';
42
import type {ProductStockMovement} from '@data/types/product';
5-
3+
import {BOBasePagePageInterface} from '@interfaces/BO';
64
import type {Page} from '@playwright/test';
75

86
export interface BOProductsCreateTabStocksPageInterface extends BOBasePagePageInterface {

src/interfaces/BO/catalog/products/create/tabVirtualProduct.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1+
import type FakerProduct from '@data/faker/product';
12
import {BOBasePagePageInterface} from '@interfaces/BO';
2-
33
import type {Page} from '@playwright/test';
44

5-
import type FakerProduct from '@data/faker/product';
6-
75
export interface BOProductsCreateTabVirtualProductPageInterface extends BOBasePagePageInterface {
86
clickOnEditDefaultBehaviourLink(page: Page): Promise<Page>;
97
getErrorMessageInDownloadFileInput(page: Page): Promise<string>;

0 commit comments

Comments
 (0)