File tree 11 files changed +30
-20
lines changed
11 files changed +30
-20
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @prestashop-core/ui-testing" ,
3
- "version" : " 0.0.5 " ,
3
+ "version" : " 0.0.6 " ,
4
4
"description" : " " ,
5
5
"main" : " dist/index.js" ,
6
6
"types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change 1
1
import type { DashboardPageInterface } from '@interfaces/BO/dashboard' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require */
7
8
function requirePage ( ) : DashboardPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { LoginPageInterface } from '@interfaces/BO/login' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require */
7
8
function requirePage ( ) : LoginPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { ModuleBlockwishlistMainPageInterface } from '@interfaces/BO/modules/blockwishlist/index' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require */
7
8
function requirePage ( ) : ModuleBlockwishlistMainPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { ModuleBlockwishlistStatisticsPageInterface } from '@interfaces/BO/modules/blockwishlist/statistics' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require */
7
8
function requirePage ( ) : ModuleBlockwishlistStatisticsPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { ModuleManagerPageInterface } from '@interfaces/BO/modules/moduleManager' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require, @typescript-eslint/no-var-requires */
7
8
function requirePage ( ) : ModuleManagerPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { FoCategoryPageInterface } from '@interfaces/FO/category' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require */
7
8
function requirePage ( ) : FoCategoryPageInterface {
Original file line number Diff line number Diff line change 1
1
import type { FoHomePageInterface } from '@interfaces/FO/home' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require, @typescript-eslint/no-var-requires */
7
8
function requirePage ( ) : FoHomePageInterface {
Original file line number Diff line number Diff line change 1
1
import type { FoLoginPageInterface } from '@interfaces/FO/login' ;
2
+ import testContext from '@utils/testContext' ;
2
3
import semver from 'semver' ;
3
4
4
- const psVersion = global . getPSVersion ( ) ;
5
+ const psVersion = testContext . getPSVersion ( ) ;
5
6
6
7
/* eslint-disable global-require, @typescript-eslint/no-var-requires */
7
8
function requirePage ( ) : FoLoginPageInterface {
Original file line number Diff line number Diff line change @@ -12,17 +12,6 @@ declare global {
12
12
var maildevConfig : GlobalMaildevConfig ;
13
13
var keycloakConfig : GlobalKeycloakConfig ;
14
14
var browserErrors : GlobalBrowserErrors ;
15
-
16
- // eslint-disable-next-line no-inner-declarations
17
- function getPSVersion ( ) : string {
18
- if ( ! process . env . PS_VERSION ) {
19
- return '0.0.0' ;
20
- }
21
- if ( process . env . PS_VERSION === 'nightly' ) {
22
- return '99.99.99' ;
23
- }
24
- return process . env . PS_VERSION ;
25
- }
26
15
}
27
16
28
17
export { } ;
Original file line number Diff line number Diff line change @@ -30,4 +30,17 @@ export default {
30
30
throw Error ( 'This error is thrown to just generate a report with failed steps' ) ;
31
31
}
32
32
} ,
33
+ /**
34
+ * Return the version of current PrestaShop (depending the env value `PS_VERSION`)
35
+ * @returns string
36
+ */
37
+ getPSVersion ( ) : string {
38
+ if ( ! process . env . PS_VERSION ) {
39
+ return '0.0.0' ;
40
+ }
41
+ if ( process . env . PS_VERSION === 'nightly' ) {
42
+ return '99.99.99' ;
43
+ }
44
+ return process . env . PS_VERSION ;
45
+ } ,
33
46
} ;
You can’t perform that action at this time.
0 commit comments