diff --git a/src/data/types/globals.ts b/src/data/types/globals.ts new file mode 100644 index 00000000..b6269878 --- /dev/null +++ b/src/data/types/globals.ts @@ -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 +} + +type GlobalBrowser = { + name: string + lang: string + width: number + height: number + sandboxArgs: Array + acceptDownloads: boolean + config: GlobalBrowserConfig + interceptErrors: any +} + +type GlobalPSConfig = { + parametersFile: string +} + +type GlobalBrowserErrors = { + responses: Array + js: Array + console: Array +} + +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, +}; diff --git a/src/data/types/playwright.d.ts b/src/data/types/playwright.ts similarity index 94% rename from src/data/types/playwright.d.ts rename to src/data/types/playwright.ts index c8e05a1a..b49cc30c 100644 --- a/src/data/types/playwright.d.ts +++ b/src/data/types/playwright.ts @@ -2,7 +2,7 @@ type PageWaitForSelectorOptionsState = 'attached' | 'detached' | 'visible' | 'hi type WaitForNavigationWaitUntil = 'load'|'domcontentloaded'|'networkidle'|'commit'; -export { +export type { PageWaitForSelectorOptionsState, WaitForNavigationWaitUntil, }; diff --git a/src/index.ts b/src/index.ts index baba90f2..9e0e718b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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'; diff --git a/src/types/globals.d.ts b/src/types/globals.d.ts index 6fe60c55..54f42cbd 100644 --- a/src/types/globals.d.ts +++ b/src/types/globals.d.ts @@ -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 - } - - type GlobalBrowser = { - name: string - lang: string - width: number - height: number - sandboxArgs: Array - acceptDownloads: boolean - config: GlobalBrowserConfig - interceptErrors: any - } - - type GlobalPSConfig = { - parametersFile: string - } - - type GlobalBrowserErrors = { - responses: Array - js: Array - console: Array - } - - 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 {};