-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from PrestaShop/pr4
test: commonjs build
- Loading branch information
Showing
10 changed files
with
87 additions
and
74 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export interface DashboardPageInterface { | ||
import {BOBasePagePageInterface} from '@interfaces/BO'; | ||
|
||
export interface DashboardPageInterface extends BOBasePagePageInterface { | ||
readonly pageTitle: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {CommonPageInterface} from '@interfaces/index'; | ||
import type {Page} from '@playwright/test'; | ||
|
||
export interface BOBasePagePageInterface extends CommonPageInterface { | ||
logoutBO(page: Page): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type {Page} from '@playwright/test'; | ||
|
||
export interface CommonPageInterface { | ||
getPageTitle(page: Page): Promise<string>; | ||
|
||
goTo(page: Page, url: string): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import type {DashboardPageInterface} from '@interfaces/BO/dashboard'; | ||
import semver from 'semver'; | ||
|
||
let file: string; | ||
const psVersion = process.env.PS_VERSION ?? '0.0.0'; | ||
|
||
if (semver.gte(process.env.PS_VERSION as string, '8.0.0')) { | ||
file = '@versions/8.0.0/pages/BO/dashboard'; | ||
} else { | ||
file = '@versions/8.0.0/pages/BO/dashboard'; | ||
/* eslint-disable global-require */ | ||
function requirePage(): DashboardPageInterface { | ||
if (semver.gte(psVersion, '8.0.0')) { | ||
return require('@versions/8.0.0/pages/BO/dashboard'); | ||
} | ||
return require('@versions/8.0.0/pages/BO/dashboard'); | ||
} | ||
/* eslint-enable global-require */ | ||
|
||
const Dashboard = await import(file); | ||
export default Dashboard; | ||
export default requirePage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
import type {LoginPageInterface} from '@interfaces/BO/login'; | ||
import semver from 'semver'; | ||
|
||
let file: string; | ||
const psVersion = process.env.PS_VERSION ?? '0.0.0'; | ||
|
||
if (semver.gte(process.env.PS_VERSION as string, '8.0.0')) { | ||
file = '@versions/8.0.0/pages/BO/login'; | ||
} else { | ||
file = '@versions/8.0.0/pages/BO/login'; | ||
/* eslint-disable global-require */ | ||
function requirePage(): LoginPageInterface { | ||
if (semver.gte(psVersion, '8.0.0')) { | ||
return require('@versions/8.0.0/pages/BO/login'); | ||
} | ||
return require('@versions/8.0.0/pages/BO/login'); | ||
} | ||
/* eslint-enable global-require */ | ||
|
||
const Login = await import(file); | ||
export default Login; | ||
export default requirePage(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,55 @@ | ||
{ | ||
"compilerOptions": { | ||
"noImplicitAny": true, | ||
"noImplicitThis": true, | ||
"module": "es2022", | ||
"target": "es2022", | ||
"strict": true, | ||
"moduleResolution": "node", | ||
"listEmittedFiles": true, | ||
"allowSyntheticDefaultImports": true, | ||
"resolveJsonModule": true, | ||
"esModuleInterop": true, | ||
"allowJs": true, | ||
"downlevelIteration": true, | ||
"baseUrl": "./", | ||
"outDir": "dist", | ||
"target": "es6", | ||
"module": "commonjs", | ||
"skipDefaultLibCheck": true, | ||
"skipLibCheck": true, | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"noImplicitThis": false, | ||
"strict": true, | ||
"strictFunctionTypes": true, | ||
"isolatedModules": true, | ||
"declaration": true, | ||
"lib": [ | ||
"dom", | ||
"dom.iterable", | ||
"esnext" | ||
], | ||
"baseUrl": "./", | ||
"outDir": "./dist", | ||
"paths": { | ||
"@interfaces/*": ["src/interfaces/*"], | ||
"@pages/*": ["src/pages/*"], | ||
"@common/*": ["src/common/*"], | ||
"@data/*": ["src/data/*"], | ||
"@types/*": ["src/types/*"], | ||
"@utils/*": ["src/utils/*"], | ||
"@versions/*": ["src/versions/*"] | ||
"@interfaces/*": [ | ||
"src/interfaces/*" | ||
], | ||
"@pages/*": [ | ||
"src/pages/*" | ||
], | ||
"@data/*": [ | ||
"src/data/*" | ||
], | ||
"@types/*": [ | ||
"src/types/*" | ||
], | ||
"@utils/*": [ | ||
"src/utils/*" | ||
], | ||
"@versions/*": [ | ||
"src/versions/*" | ||
] | ||
}, | ||
"typeRoots": ["types", "node_modules/@types"], | ||
"skipLibCheck": true | ||
"typeRoots": [ | ||
"types", | ||
"node_modules/@types" | ||
], | ||
}, | ||
"include": ["src/**/*"], | ||
"exclude": ["node_modules"] | ||
"include": [ | ||
"src/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |