Skip to content

Commit

Permalink
Merge pull request #7 from PrestaShop/global
Browse files Browse the repository at this point in the history
Export types
  • Loading branch information
Progi1984 authored Jan 19, 2024
2 parents 403edda + 3fef0fc commit e5c3528
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 88 deletions.
85 changes: 85 additions & 0 deletions src/data/types/globals.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
type GlobalInstall = {
URL: string
ENABLE_SSL: boolean
LANGUAGE: string
COUNTRY: string
DB_SERVER: string
DB_NAME: string
DB_USER: string
DB_PASSWD: string
DB_PREFIX: string
SHOP_NAME: string
}

type GlobalFO = {
URL: string
}

type GlobalBO = {
URL: string
EMAIL: string
PASSWD: string
FIRSTNAME: string
LASTNAME: string
}

type GlobalBrowserConfig = {
headless: any
timeout: number
slowMo: number
channel?: string
args?: Array<string>
}

type GlobalBrowser = {
name: string
lang: string
width: number
height: number
sandboxArgs: Array<string>
acceptDownloads: boolean
config: GlobalBrowserConfig
interceptErrors: any
}

type GlobalPSConfig = {
parametersFile: string
}

type GlobalBrowserErrors = {
responses: Array<any>
js: Array<any>
console: Array<any>
}

type GlobalScreenshot = {
FOLDER: string
AFTER_FAIL: any
}

type GlobalMaildevConfig = {
smtpPort: number
smtpServer: string
silent: boolean
}

type GlobalKeycloakConfig = {
keycloakExternalUrl: string
keycloakInternalUrl: string
keycloakAdminUser: string
keycloakAdminPass: string
keycloakClientId: string
}

export type {
GlobalInstall,
GlobalFO,
GlobalBO,
GlobalBrowser,
GlobalBrowserConfig,
GlobalPSConfig,
GlobalBrowserErrors,
GlobalScreenshot,
GlobalMaildevConfig,
GlobalKeycloakConfig,
};
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type PageWaitForSelectorOptionsState = 'attached' | 'detached' | 'visible' | 'hi

type WaitForNavigationWaitUntil = 'load'|'domcontentloaded'|'networkidle'|'commit';

export {
export type {
PageWaitForSelectorOptionsState,
WaitForNavigationWaitUntil,
};
17 changes: 16 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
// Export data
export type {PageWaitForSelectorOptionsState, WaitForNavigationWaitUntil} from '@data/types/playwright';
export type {
GlobalInstall,
GlobalFO,
GlobalBO,
GlobalBrowser,
GlobalBrowserConfig,
GlobalPSConfig,
GlobalBrowserErrors,
GlobalScreenshot,
GlobalMaildevConfig,
GlobalKeycloakConfig,
} from '@data/types/globals';
export type {
PageWaitForSelectorOptionsState,
WaitForNavigationWaitUntil,
} from '@data/types/playwright';

// Export interfaces
export type {DashboardPageInterface} from '@interfaces/BO/dashboard';
Expand Down
99 changes: 13 additions & 86 deletions src/types/globals.d.ts
Original file line number Diff line number Diff line change
@@ -1,90 +1,17 @@
/* eslint-disable vars-on-top, no-var */

type GlobalInstall = {
URL: string
ENABLE_SSL: boolean
LANGUAGE: string
COUNTRY: string
DB_SERVER: string
DB_NAME: string
DB_USER: string
DB_PASSWD: string
DB_PREFIX: string
SHOP_NAME: string
}

type GlobalFO = {
URL: string
}

type GlobalBO = {
URL: string
EMAIL: string
PASSWD: string
FIRSTNAME: string
LASTNAME: string
}

type GlobalBrowserConfig = {
headless: any
timeout: number
slowMo: number
channel?: string
args?: Array<string>
}

type GlobalBrowser = {
name: string
lang: string
width: number
height: number
sandboxArgs: Array<string>
acceptDownloads: boolean
config: GlobalBrowserConfig
interceptErrors: any
}

type GlobalPSConfig = {
parametersFile: string
}

type GlobalBrowserErrors = {
responses: Array<any>
js: Array<any>
console: Array<any>
}

type GlobalScreenshot = {
FOLDER: string
AFTER_FAIL: any
}

type GlobalMaildevConfig = {
smtpPort: number
smtpServer: string
silent: boolean
}

type GlobalKeycloakConfig = {
keycloakExternalUrl: string
keycloakInternalUrl: string
keycloakAdminUser: string
keycloakAdminPass: string
keycloakClientId: string
}

declare global {
var INSTALL: GlobalInstall;
var URLHasPort: boolean;
var FO: GlobalFO;
var BO: GlobalBO;
var PSConfig: GlobalPSConfig;
var BROWSER: GlobalBrowser;
var GENERATE_FAILED_STEPS: any;
var SCREENSHOT: GlobalScreenshot;
var maildevConfig: GlobalMaildevConfig;
var keycloakConfig: GlobalKeycloakConfig;
var browserErrors: GlobalBrowserErrors;
}
declare global {
var INSTALL: GlobalInstall;
var URLHasPort: boolean;
var FO: GlobalFO;
var BO: GlobalBO;
var PSConfig: GlobalPSConfig;
var BROWSER: GlobalBrowser;
var GENERATE_FAILED_STEPS: any;
var SCREENSHOT: GlobalScreenshot;
var maildevConfig: GlobalMaildevConfig;
var keycloakConfig: GlobalKeycloakConfig;
var browserErrors: GlobalBrowserErrors;
}

export {};

0 comments on commit e5c3528

Please sign in to comment.