@@ -2,61 +2,35 @@ import { Page, Locator, FrameLocator } from '@playwright/test';
22import { AdminPageBase } from "@models/AdminPageBase" ;
33
44export class ProductFormPage extends AdminPageBase {
5- public readonly titleInput : Locator ;
6- public readonly englishNameInput : Locator ;
7- public readonly imageInput : Locator ;
8- public readonly thumbnailInput : Locator ;
9- public readonly productCategoryDropdownTree : Locator ;
10- public readonly modelInput : Locator ;
11- public readonly colorInput : Locator ;
12- public readonly priceInput : Locator ;
13- public readonly discountPriceInput : Locator ;
14- public readonly costPriceInput : Locator ;
15- public readonly specificationInput : Locator ;
16- public readonly warrantyInput : Locator ;
17- public readonly detailedContentFrame : Locator ;
18- public readonly seoTitleInput : Locator ;
19- public readonly seoKeywordsInput : Locator ;
20- public readonly seoDescriptionInput : Locator ;
21- public readonly sortInput : Locator ;
22- public readonly sourceInput : Locator ;
23- public readonly publishDateInput : Locator ;
24- public readonly descriptionInput : Locator ;
25- public readonly statusDropdown : Locator ;
26- public readonly saveButton : Locator ;
27- public readonly saveAndExitButton : Locator ;
28- public readonly publishButton : Locator ;
29- public readonly cancelButton : Locator ;
30- public readonly addImageButton : Locator ;
5+ public readonly titleInput = this . page . locator ( '#Title' ) ;
6+ public readonly englishNameInput = this . page . locator ( '#Url' ) ;
7+ public readonly imageInput = this . page . locator ( '#ImageUrl' ) ;
8+ public readonly thumbnailInput = this . page . locator ( '#ImageThumbUrl' ) ;
9+ public readonly productCategoryDropdownTree = this . page . locator ( '#dropdown-tree-ProductCategoryID > .form-control' ) ;
10+ public readonly modelInput = this . page . locator ( '#PartNumber' ) ;
11+ public readonly colorInput = this . page . locator ( '#Color' ) ;
12+ public readonly priceInput = this . page . locator ( '#Price' ) ;
13+ public readonly discountPriceInput = this . page . locator ( '#RebatePrice' ) ;
14+ public readonly costPriceInput = this . page . locator ( '#PurchasePrice' ) ;
15+ public readonly specificationInput = this . page . locator ( '#Norm' ) ;
16+ public readonly warrantyInput = this . page . locator ( '#ShelfLife' ) ;
17+ public readonly detailedContentFrame = this . page . locator ( '#ProductContent_ifr' ) ;
18+ public readonly seoTitleInput = this . page . locator ( '#SEOTitle' ) ;
19+ public readonly seoKeywordsInput = this . page . locator ( '#SEOKeyWord' ) ;
20+ public readonly seoDescriptionInput = this . page . locator ( '#SEODescription' ) ;
21+ public readonly sortInput = this . page . locator ( '#OrderIndex' ) ;
22+ public readonly sourceInput = this . page . locator ( '#SourceFrom' ) ;
23+ public readonly publishDateInput = this . page . locator ( '#PublishDate' ) ;
24+ public readonly descriptionInput = this . page . locator ( '#Description' ) ;
25+ public readonly statusDropdown = this . page . locator ( '#Status' ) ;
26+ public readonly saveButton = this . page . locator ( 'input[value="保存"]' ) ;
27+ public readonly saveAndExitButton = this . page . locator ( 'input[value="保存并退出"]' ) ;
28+ public readonly publishButton = this . page . locator ( 'input[value="发布"]' ) ;
29+ public readonly cancelButton = this . page . locator ( 'a.btn-default' ) ;
30+ public readonly addImageButton = this . page . locator ( '.btn-xs.add' ) ;
3131
3232 constructor ( page : Page ) {
3333 super ( page ) ;
34- this . titleInput = page . locator ( '#Title' ) ;
35- this . englishNameInput = page . locator ( '#Url' ) ;
36- this . imageInput = page . locator ( '#ImageUrl' ) ;
37- this . thumbnailInput = page . locator ( '#ImageThumbUrl' ) ;
38- this . productCategoryDropdownTree = page . locator ( '#dropdown-tree-ProductCategoryID > .form-control' ) ;
39- this . modelInput = page . locator ( '#PartNumber' ) ;
40- this . colorInput = page . locator ( '#Color' ) ;
41- this . priceInput = page . locator ( '#Price' ) ;
42- this . discountPriceInput = page . locator ( '#RebatePrice' ) ;
43- this . costPriceInput = page . locator ( '#PurchasePrice' ) ;
44- this . specificationInput = page . locator ( '#Norm' ) ;
45- this . warrantyInput = page . locator ( '#ShelfLife' ) ;
46- this . detailedContentFrame = page . locator ( '#ProductContent_ifr' ) ;
47- this . seoTitleInput = page . locator ( '#SEOTitle' ) ;
48- this . seoKeywordsInput = page . locator ( '#SEOKeyWord' ) ;
49- this . seoDescriptionInput = page . locator ( '#SEODescription' ) ;
50- this . sortInput = page . locator ( '#OrderIndex' ) ;
51- this . sourceInput = page . locator ( '#SourceFrom' ) ;
52- this . publishDateInput = page . locator ( '#PublishDate' ) ;
53- this . descriptionInput = page . locator ( '#Description' ) ;
54- this . statusDropdown = page . locator ( '#Status' ) ;
55- this . saveButton = page . locator ( 'input[value="保存"]' ) ;
56- this . saveAndExitButton = page . locator ( 'input[value="保存并退出"]' ) ;
57- this . publishButton = page . locator ( 'input[value="发布"]' ) ;
58- this . cancelButton = page . locator ( 'a.btn-default' ) ;
59- this . addImageButton = page . locator ( '.btn-xs.add' ) ;
6034 }
6135
6236 async navigateTo ( ) : Promise < void > {
0 commit comments