@eclipse-che/che-e2e 7.73.0 → 7.74.0-dev-41d1364
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +10 -0
- package/.eslintrc.js +183 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +10 -0
- package/README.md +47 -47
- package/configs/inversify.config.ts +14 -10
- package/configs/inversify.types.ts +29 -29
- package/configs/mocharc.ts +21 -24
- package/constants/API_TEST_CONSTANTS.ts +67 -0
- package/constants/BASE_TEST_CONSTANTS.ts +80 -0
- package/constants/CHROME_DRIVER_CONSTANTS.ts +54 -0
- package/constants/FACTORY_TEST_CONSTANTS.ts +61 -0
- package/constants/MONACO_CONSTANTS.ts +25 -0
- package/constants/OAUTH_CONSTANTS.ts +67 -0
- package/constants/PLUGIN_TEST_CONSTANTS.ts +15 -0
- package/constants/REPORTER_CONSTANTS.ts +53 -0
- package/constants/TIMEOUT_CONSTANTS.ts +131 -0
- package/dist/configs/inversify.config.js +14 -8
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +2 -2
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +13 -16
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/{APITestConstants.js → API_TEST_CONSTANTS.js} +13 -13
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +17 -16
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{ChromeDriverConstants.js → CHROME_DRIVER_CONSTANTS.js} +14 -14
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
- package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +15 -14
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +8 -8
- package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
- package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +15 -15
- package/dist/constants/OAUTH_CONSTANTS.js.map +1 -0
- package/dist/constants/{PluginsTestConstants.js → PLUGIN_TEST_CONSTANTS.js} +7 -7
- package/dist/constants/PLUGIN_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{ReporterConstants.js → REPORTER_CONSTANTS.js} +13 -13
- package/dist/constants/REPORTER_CONSTANTS.js.map +1 -0
- package/dist/constants/{TimeoutConstants.js → TIMEOUT_CONSTANTS.js} +24 -24
- package/dist/constants/TIMEOUT_CONSTANTS.js.map +1 -0
- package/dist/driver/ChromeDriver.js +12 -16
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +18 -18
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +27 -27
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +42 -42
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +44 -33
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +37 -35
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +10 -10
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js +2 -2
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js +2 -2
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +10 -10
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +6 -6
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +23 -23
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +11 -11
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +10 -10
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +7 -7
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +9 -9
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +15 -15
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +27 -24
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +17 -13
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +10 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +31 -18
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +18 -12
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +12 -2
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +12 -8
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -9
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +47 -43
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +17 -10
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +28 -26
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +41 -36
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +37 -35
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +18 -5
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +7 -7
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +9 -7
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +61 -78
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +29 -24
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +44 -44
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +19 -10
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +25 -19
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +126 -128
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +53 -46
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +62 -39
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +18 -12
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +9 -0
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +17 -9
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +36 -34
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +10 -6
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/IAuthorizationHeaderHandler.js +2 -2
- package/dist/utils/workspace/ApiUrlResolver.js +5 -5
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/ITestWorkspaceUtil.js +2 -2
- package/dist/utils/workspace/TestWorkspaceUtil.js +36 -30
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js +2 -2
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +45 -51
- package/driver/IDriver.ts +3 -3
- package/index.ts +9 -9
- package/package.json +59 -49
- package/pageobjects/dashboard/CreateWorkspace.ts +65 -56
- package/pageobjects/dashboard/Dashboard.ts +101 -100
- package/pageobjects/dashboard/Workspaces.ts +197 -166
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +151 -127
- package/pageobjects/git-providers/OauthPage.ts +177 -166
- package/pageobjects/ide/CheCodeLocatorLoader.ts +49 -46
- package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
- package/pageobjects/login/kubernetes/DexLoginPage.ts +32 -31
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +16 -15
- package/pageobjects/login/openshift/OcpLoginPage.ts +62 -55
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +30 -25
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +16 -19
- package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -44
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +39 -35
- package/pageobjects/openshift/OcpApplicationPage.ts +21 -20
- package/pageobjects/openshift/OcpImportFromGitPage.ts +70 -68
- package/pageobjects/openshift/OcpMainPage.ts +69 -68
- package/resources/pod-overrides-airgap.yaml +37 -0
- package/specs/MochaHooks.ts +59 -50
- package/specs/SmokeTest.spec.ts +43 -36
- package/specs/api/ContainerOverridesAPI.spec.ts +33 -26
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +107 -94
- package/specs/api/EmptyWorkspaceAPI.spec.ts +62 -57
- package/specs/api/PodOverridesAPI.spec.ts +42 -32
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +31 -27
- package/specs/dashboard-samples/Quarkus.spec.ts +34 -30
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +192 -170
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -55
- package/specs/factory/Factory.spec.ts +178 -166
- package/specs/factory/NoSetupRepoFactory.spec.ts +227 -210
- package/specs/factory/RefusedOAuthFactory.spec.ts +219 -203
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +64 -50
- package/tests-library/LoginTests.ts +34 -32
- package/tests-library/ProjectAndFileTests.ts +21 -18
- package/tests-library/WorkspaceHandlingTests.ts +98 -108
- package/tsconfig.json +15 -15
- package/utils/BrowserTabsUtil.ts +104 -98
- package/utils/CheReporter.ts +142 -148
- package/utils/DevWorkspaceConfigurationHelper.ts +70 -61
- package/utils/DevfilesRegistryHelper.ts +67 -58
- package/utils/DriverHelper.ts +726 -701
- package/utils/KubernetesCommandLineToolsExecutor.ts +196 -172
- package/utils/Logger.ts +104 -75
- package/utils/ScreenCatcher.ts +59 -48
- package/utils/ShellExecutor.ts +19 -11
- package/utils/StringUtil.ts +40 -32
- package/utils/request-handlers/CheApiRequestHandler.ts +92 -87
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +32 -21
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +3 -3
- package/utils/workspace/ApiUrlResolver.ts +31 -26
- package/utils/workspace/ITestWorkspaceUtil.ts +31 -31
- package/utils/workspace/TestWorkspaceUtil.ts +153 -142
- package/utils/workspace/WorkspaceStatus.ts +5 -5
- package/constants/APITestConstants.ts +0 -56
- package/constants/BaseTestConstants.ts +0 -65
- package/constants/ChromeDriverConstants.ts +0 -46
- package/constants/FactoryTestConstants.ts +0 -51
- package/constants/MonacoConstants.ts +0 -22
- package/constants/OAuthConstants.ts +0 -57
- package/constants/PluginsTestConstants.ts +0 -15
- package/constants/ReporterConstants.ts +0 -45
- package/constants/TimeoutConstants.ts +0 -113
- package/dist/constants/APITestConstants.js.map +0 -1
- package/dist/constants/BaseTestConstants.js.map +0 -1
- package/dist/constants/ChromeDriverConstants.js.map +0 -1
- package/dist/constants/FactoryTestConstants.js.map +0 -1
- package/dist/constants/MonacoConstants.js.map +0 -1
- package/dist/constants/OAuthConstants.js.map +0 -1
- package/dist/constants/PluginsTestConstants.js.map +0 -1
- package/dist/constants/ReporterConstants.js.map +0 -1
- package/dist/constants/TimeoutConstants.js.map +0 -1
- package/tslint.json +0 -126
package/utils/CheReporter.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2019-2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -10,20 +10,20 @@
|
|
|
10
10
|
import * as mocha from 'mocha';
|
|
11
11
|
import { CLASSES } from '../configs/inversify.types';
|
|
12
12
|
import * as fs from 'fs';
|
|
13
|
+
import { WriteStream } from 'fs';
|
|
13
14
|
import * as rm from 'rimraf';
|
|
14
15
|
import { logging } from 'selenium-webdriver';
|
|
15
16
|
import { DriverHelper } from './DriverHelper';
|
|
16
17
|
import { ScreenCatcher } from './ScreenCatcher';
|
|
17
|
-
import {
|
|
18
|
+
import { TIMEOUT_CONSTANTS } from '../constants/TIMEOUT_CONSTANTS';
|
|
18
19
|
import { Logger } from './Logger';
|
|
19
20
|
import { e2eContainer } from '../configs/inversify.config';
|
|
20
|
-
import { WriteStream } from 'fs';
|
|
21
21
|
import { StringUtil } from './StringUtil';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
22
|
+
import { BASE_TEST_CONSTANTS } from '../constants/BASE_TEST_CONSTANTS';
|
|
23
|
+
import { CHROME_DRIVER_CONSTANTS } from '../constants/CHROME_DRIVER_CONSTANTS';
|
|
24
|
+
import { OAUTH_CONSTANTS } from '../constants/OAUTH_CONSTANTS';
|
|
25
|
+
import { REPORTER_CONSTANTS } from '../constants/REPORTER_CONSTANTS';
|
|
26
|
+
import { PLUGIN_TEST_CONSTANTS } from '../constants/PLUGIN_TEST_CONSTANTS';
|
|
27
27
|
|
|
28
28
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
29
29
|
const screenCatcher: ScreenCatcher = e2eContainer.get(CLASSES.ScreenCatcher);
|
|
@@ -31,155 +31,149 @@ let methodIndex: number = 0;
|
|
|
31
31
|
let deleteScreencast: boolean = true;
|
|
32
32
|
|
|
33
33
|
class CheReporter extends mocha.reporters.Spec {
|
|
34
|
+
constructor(runner: mocha.Runner, options: mocha.MochaOptions) {
|
|
35
|
+
super(runner, options);
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
runner.on('start', async (): Promise<void> => {
|
|
39
|
-
let launchInformation: string =
|
|
40
|
-
`################## Launch Information ##################
|
|
37
|
+
runner.on('start', (): void => {
|
|
38
|
+
let launchInformation: string = `################## Launch Information ##################
|
|
41
39
|
|
|
42
|
-
TS_SELENIUM_BASE_URL: ${
|
|
43
|
-
TS_SELENIUM_HEADLESS: ${
|
|
44
|
-
TS_SELENIUM_OCP_USERNAME: ${
|
|
45
|
-
TS_SELENIUM_EDITOR: ${
|
|
40
|
+
TS_SELENIUM_BASE_URL: ${BASE_TEST_CONSTANTS.TS_SELENIUM_BASE_URL}
|
|
41
|
+
TS_SELENIUM_HEADLESS: ${CHROME_DRIVER_CONSTANTS.TS_SELENIUM_HEADLESS}
|
|
42
|
+
TS_SELENIUM_OCP_USERNAME: ${OAUTH_CONSTANTS.TS_SELENIUM_OCP_USERNAME}
|
|
43
|
+
TS_SELENIUM_EDITOR: ${BASE_TEST_CONSTANTS.TS_SELENIUM_EDITOR}
|
|
46
44
|
|
|
47
|
-
TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: ${
|
|
48
|
-
TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: ${
|
|
49
|
-
TS_SELENIUM_REPORT_FOLDER: ${
|
|
50
|
-
TS_SELENIUM_EXECUTION_SCREENCAST: ${
|
|
51
|
-
DELETE_SCREENCAST_IF_TEST_PASS: ${
|
|
52
|
-
TS_SELENIUM_REMOTE_DRIVER_URL: ${
|
|
53
|
-
DELETE_WORKSPACE_ON_FAILED_TEST: ${
|
|
54
|
-
TS_SELENIUM_LOG_LEVEL: ${
|
|
55
|
-
TS_SELENIUM_LAUNCH_FULLSCREEN: ${
|
|
45
|
+
TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: ${BASE_TEST_CONSTANTS.TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME}
|
|
46
|
+
TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: ${REPORTER_CONSTANTS.TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS}
|
|
47
|
+
TS_SELENIUM_REPORT_FOLDER: ${REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER}
|
|
48
|
+
TS_SELENIUM_EXECUTION_SCREENCAST: ${REPORTER_CONSTANTS.TS_SELENIUM_EXECUTION_SCREENCAST}
|
|
49
|
+
DELETE_SCREENCAST_IF_TEST_PASS: ${REPORTER_CONSTANTS.DELETE_SCREENCAST_IF_TEST_PASS}
|
|
50
|
+
TS_SELENIUM_REMOTE_DRIVER_URL: ${CHROME_DRIVER_CONSTANTS.TS_SELENIUM_REMOTE_DRIVER_URL}
|
|
51
|
+
DELETE_WORKSPACE_ON_FAILED_TEST: ${BASE_TEST_CONSTANTS.DELETE_WORKSPACE_ON_FAILED_TEST}
|
|
52
|
+
TS_SELENIUM_LOG_LEVEL: ${REPORTER_CONSTANTS.TS_SELENIUM_LOG_LEVEL}
|
|
53
|
+
TS_SELENIUM_LAUNCH_FULLSCREEN: ${CHROME_DRIVER_CONSTANTS.TS_SELENIUM_LAUNCH_FULLSCREEN}
|
|
56
54
|
|
|
57
|
-
TS_COMMON_DASHBOARD_WAIT_TIMEOUT: ${
|
|
58
|
-
TS_SELENIUM_START_WORKSPACE_TIMEOUT: ${
|
|
59
|
-
TS_WAIT_LOADER_PRESENCE_TIMEOUT: ${
|
|
55
|
+
TS_COMMON_DASHBOARD_WAIT_TIMEOUT: ${TIMEOUT_CONSTANTS.TS_COMMON_DASHBOARD_WAIT_TIMEOUT}
|
|
56
|
+
TS_SELENIUM_START_WORKSPACE_TIMEOUT: ${TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT}
|
|
57
|
+
TS_WAIT_LOADER_PRESENCE_TIMEOUT: ${TIMEOUT_CONSTANTS.TS_WAIT_LOADER_PRESENCE_TIMEOUT}
|
|
60
58
|
|
|
61
|
-
TS_SAMPLE_LIST: ${
|
|
59
|
+
TS_SAMPLE_LIST: ${PLUGIN_TEST_CONSTANTS.TS_SAMPLE_LIST}
|
|
62
60
|
|
|
63
61
|
${process.env.MOCHA_DIRECTORY ? 'MOCHA_DIRECTORY: ' + process.env.MOCHA_DIRECTORY : 'MOCHA_DRIRECTORY is not set'}
|
|
64
62
|
${process.env.USERSTORY ? 'USERSTORY: ' + process.env.USERSTORY : 'USERSTORY is not set'}
|
|
65
63
|
`;
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
browserLogsStream.end();
|
|
180
|
-
|
|
181
|
-
});
|
|
182
|
-
}
|
|
65
|
+
if (REPORTER_CONSTANTS.TS_SELENIUM_PRINT_TIMEOUT_VARIABLES) {
|
|
66
|
+
launchInformation += '\n TS_SELENIUM_PRINT_TIMEOUT_VARIABLES is set to true: \n';
|
|
67
|
+
Object.entries(TIMEOUT_CONSTANTS).forEach(([key, value]): string => (launchInformation += `\n ${key}: ${value}`));
|
|
68
|
+
} else {
|
|
69
|
+
launchInformation += '\n to output timeout variables, set TS_SELENIUM_PRINT_TIMEOUT_VARIABLES to true';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
launchInformation += '\n ######################################################## \n';
|
|
73
|
+
|
|
74
|
+
console.log(launchInformation);
|
|
75
|
+
|
|
76
|
+
rm.sync(REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
runner.on('test', async function (test: mocha.Test): Promise<void> {
|
|
80
|
+
if (!REPORTER_CONSTANTS.TS_SELENIUM_EXECUTION_SCREENCAST) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
methodIndex = methodIndex + 1;
|
|
85
|
+
const currentMethodIndex: number = methodIndex;
|
|
86
|
+
let iterationIndex: number = 1;
|
|
87
|
+
|
|
88
|
+
while (!(test.state === 'passed' || test.state === 'failed')) {
|
|
89
|
+
await screenCatcher.catchMethodScreen(test.title, currentMethodIndex, iterationIndex);
|
|
90
|
+
iterationIndex = iterationIndex + 1;
|
|
91
|
+
|
|
92
|
+
await driverHelper.wait(REPORTER_CONSTANTS.TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
runner.on('pass', (test: mocha.Test): void => {
|
|
97
|
+
if (BASE_TEST_CONSTANTS.TS_LOAD_TESTS) {
|
|
98
|
+
const loadTestReportFolder: string = REPORTER_CONSTANTS.TS_SELENIUM_LOAD_TEST_REPORT_FOLDER;
|
|
99
|
+
const loadTestFilePath: string = loadTestReportFolder + '/load-test-results.txt';
|
|
100
|
+
const report: string = test.title + ': ' + test.duration + '\r';
|
|
101
|
+
if (!fs.existsSync(loadTestReportFolder)) {
|
|
102
|
+
fs.mkdirSync(loadTestReportFolder);
|
|
103
|
+
}
|
|
104
|
+
fs.appendFileSync(loadTestFilePath, report);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
runner.on('end', async (): Promise<void> => {
|
|
109
|
+
// ensure that fired events done
|
|
110
|
+
await driverHelper.wait(5000);
|
|
111
|
+
|
|
112
|
+
// close driver
|
|
113
|
+
await driverHelper.getDriver().quit();
|
|
114
|
+
|
|
115
|
+
// delete screencast folder if conditions matched
|
|
116
|
+
if (deleteScreencast && REPORTER_CONSTANTS.DELETE_SCREENCAST_IF_TEST_PASS) {
|
|
117
|
+
rm.sync(REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER);
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
runner.on('fail', async function (test: mocha.Test): Promise<void> {
|
|
122
|
+
Logger.error(`CheReporter runner.on.fail: ${test.fullTitle()} failed after ${test.duration}ms`);
|
|
123
|
+
// raise flag for keeping the screencast
|
|
124
|
+
deleteScreencast = false;
|
|
125
|
+
|
|
126
|
+
Logger.trace(`FullTitle:${test.fullTitle()}`);
|
|
127
|
+
const testFullTitle: string = StringUtil.sanitizeTitle(test.fullTitle());
|
|
128
|
+
Logger.trace(`FullTitleSanitized:${testFullTitle}`);
|
|
129
|
+
Logger.trace(`TestTitle:${test.title}`);
|
|
130
|
+
const testTitle: string = StringUtil.sanitizeTitle(test.title);
|
|
131
|
+
Logger.trace(`TestTitleSanitized:${testTitle}`);
|
|
132
|
+
|
|
133
|
+
const testReportDirPath: string = `${REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER}/${testFullTitle}`;
|
|
134
|
+
const screenshotFileName: string = `${testReportDirPath}/screenshot-${testTitle}.png`;
|
|
135
|
+
const pageSourceFileName: string = `${testReportDirPath}/pagesource-${testTitle}.html`;
|
|
136
|
+
const browserLogsFileName: string = `${testReportDirPath}/browserlogs-${testTitle}.txt`;
|
|
137
|
+
|
|
138
|
+
// create reporter dir if not exist
|
|
139
|
+
const reportDirExists: boolean = fs.existsSync(REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER);
|
|
140
|
+
|
|
141
|
+
if (!reportDirExists) {
|
|
142
|
+
fs.mkdirSync(REPORTER_CONSTANTS.TS_SELENIUM_REPORT_FOLDER);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// create dir for failed test report if not exist
|
|
146
|
+
const testReportDirExists: boolean = fs.existsSync(testReportDirPath);
|
|
147
|
+
|
|
148
|
+
if (!testReportDirExists) {
|
|
149
|
+
fs.mkdirSync(testReportDirPath);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// take screenshot and write to file
|
|
153
|
+
const screenshot: string = await driverHelper.getDriver().takeScreenshot();
|
|
154
|
+
const screenshotStream: WriteStream = fs.createWriteStream(screenshotFileName);
|
|
155
|
+
screenshotStream.write(Buffer.from(screenshot, 'base64'));
|
|
156
|
+
screenshotStream.end();
|
|
157
|
+
|
|
158
|
+
// take page source and write to file
|
|
159
|
+
const pageSource: string = await driverHelper.getDriver().getPageSource();
|
|
160
|
+
const pageSourceStream: WriteStream = fs.createWriteStream(pageSourceFileName);
|
|
161
|
+
pageSourceStream.write(Buffer.from(pageSource));
|
|
162
|
+
pageSourceStream.end();
|
|
163
|
+
|
|
164
|
+
// take browser console logs and write to file
|
|
165
|
+
const browserLogsEntries: logging.Entry[] = await driverHelper.getDriver().manage().logs().get('browser');
|
|
166
|
+
let browserLogs: string = '';
|
|
167
|
+
|
|
168
|
+
browserLogsEntries.forEach((log): void => {
|
|
169
|
+
browserLogs += `\"${log.level}\" \"${log.type}\" \"${log.message}\"\n`;
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const browserLogsStream: WriteStream = fs.createWriteStream(browserLogsFileName);
|
|
173
|
+
browserLogsStream.write(Buffer.from(browserLogs));
|
|
174
|
+
browserLogsStream.end();
|
|
175
|
+
});
|
|
176
|
+
}
|
|
183
177
|
}
|
|
184
178
|
|
|
185
179
|
export = CheReporter;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
1
10
|
import { Main as Generator } from '@eclipse-che/che-devworkspace-generator/lib/main';
|
|
2
11
|
import { DevfileContext } from '@eclipse-che/che-devworkspace-generator/lib/api/devfile-context';
|
|
3
12
|
import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
|
|
@@ -5,7 +14,7 @@ import YAML from 'yaml';
|
|
|
5
14
|
import * as axios from 'axios';
|
|
6
15
|
import { Logger } from './Logger';
|
|
7
16
|
import { ShellExecutor } from './ShellExecutor';
|
|
8
|
-
import {
|
|
17
|
+
import { API_TEST_CONSTANTS } from '../constants/API_TEST_CONSTANTS';
|
|
9
18
|
|
|
10
19
|
/**
|
|
11
20
|
* to see more about IContextParams and generateDevfileContext(params) check README.md in "@eclipse-che/che-devworkspace-generator;
|
|
@@ -13,71 +22,71 @@ import { APITestConstants } from '../constants/APITestConstants';
|
|
|
13
22
|
*/
|
|
14
23
|
|
|
15
24
|
interface IContextParams {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
devfilePath?: string | undefined;
|
|
26
|
+
devfileUrl?: string | undefined;
|
|
27
|
+
devfileContent?: string | undefined;
|
|
28
|
+
outputFile?: string | undefined;
|
|
29
|
+
editorPath?: string | undefined;
|
|
30
|
+
editorContent?: string | undefined;
|
|
31
|
+
editorEntry?: string | undefined;
|
|
32
|
+
pluginRegistryUrl?: string | undefined;
|
|
33
|
+
projects?: {
|
|
34
|
+
name: string;
|
|
35
|
+
location: string;
|
|
36
|
+
}[];
|
|
37
|
+
injectDefaultComponent?: string | undefined;
|
|
38
|
+
defaultComponentImage?: string | undefined;
|
|
30
39
|
}
|
|
31
40
|
|
|
32
41
|
export class DevWorkspaceConfigurationHelper {
|
|
33
|
-
|
|
34
|
-
|
|
42
|
+
private generator: Generator = new Generator();
|
|
43
|
+
private readonly params: IContextParams;
|
|
35
44
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
constructor(params: IContextParams) {
|
|
46
|
+
// check if all undefined
|
|
47
|
+
if (!(params.editorPath || params.editorEntry || params.editorContent)) {
|
|
48
|
+
params.editorEntry = 'che-incubator/che-code/latest';
|
|
49
|
+
}
|
|
50
|
+
// check if one or both has value
|
|
51
|
+
if (API_TEST_CONSTANTS.TS_API_TEST_UDI_IMAGE || params.defaultComponentImage) {
|
|
52
|
+
params.injectDefaultComponent = 'true';
|
|
53
|
+
// check if not explicitly passed than assign value from the constants
|
|
54
|
+
if (!params.defaultComponentImage) {
|
|
55
|
+
params.defaultComponentImage = API_TEST_CONSTANTS.TS_API_TEST_UDI_IMAGE;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// assign value from the constants if not explicitly passed
|
|
59
|
+
if (API_TEST_CONSTANTS.TS_API_TEST_PLUGIN_REGISTRY_URL && !params.pluginRegistryUrl) {
|
|
60
|
+
params.pluginRegistryUrl = API_TEST_CONSTANTS.TS_API_TEST_PLUGIN_REGISTRY_URL;
|
|
61
|
+
}
|
|
62
|
+
if (API_TEST_CONSTANTS.TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI && !params.editorContent) {
|
|
63
|
+
params.editorContent = ShellExecutor.curl(API_TEST_CONSTANTS.TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI).stdout;
|
|
64
|
+
}
|
|
65
|
+
this.params = params;
|
|
66
|
+
}
|
|
58
67
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
async generateDevfileContext(): Promise<DevfileContext> {
|
|
69
|
+
Logger.debug();
|
|
70
|
+
if (!this.params.projects) {
|
|
71
|
+
this.params.projects = [];
|
|
72
|
+
}
|
|
73
|
+
return await this.generator.generateDevfileContext(
|
|
74
|
+
{
|
|
75
|
+
...this.params,
|
|
76
|
+
projects: this.params.projects
|
|
77
|
+
},
|
|
78
|
+
axios.default as any
|
|
79
|
+
);
|
|
80
|
+
}
|
|
72
81
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
// write templates and then DevWorkspace in a single file
|
|
83
|
+
getDevWorkspaceConfigurationYamlAsString(context: DevfileContext): string {
|
|
84
|
+
Logger.debug();
|
|
85
|
+
const allContentArray: any[] = context.devWorkspaceTemplates.map((template: V1alpha2DevWorkspaceTemplate): string =>
|
|
86
|
+
YAML.stringify(template)
|
|
87
|
+
);
|
|
88
|
+
allContentArray.push(YAML.stringify(context.devWorkspace));
|
|
80
89
|
|
|
81
|
-
|
|
82
|
-
|
|
90
|
+
return allContentArray.join('---\n');
|
|
91
|
+
}
|
|
83
92
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2023 Red Hat, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This program and the accompanying materials are made
|
|
5
5
|
* available under the terms of the Eclipse Public License 2.0
|
|
@@ -10,68 +10,77 @@
|
|
|
10
10
|
import axios, { AxiosResponse } from 'axios';
|
|
11
11
|
import { Logger } from './Logger';
|
|
12
12
|
import YAML from 'yaml';
|
|
13
|
-
import {
|
|
13
|
+
import { API_TEST_CONSTANTS, SUPPORTED_DEVFILE_REGISTRIES } from '../constants/API_TEST_CONSTANTS';
|
|
14
14
|
|
|
15
15
|
export class DevfilesRegistryHelper {
|
|
16
|
+
async getInbuiltDevfilesRegistryContent(): Promise<AxiosResponse> {
|
|
17
|
+
Logger.debug();
|
|
18
|
+
return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL());
|
|
19
|
+
}
|
|
16
20
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
async getGitHubCheDevfileRegistryContent(): Promise<AxiosResponse> {
|
|
22
|
+
Logger.debug();
|
|
23
|
+
return await this.getContent(SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL);
|
|
24
|
+
}
|
|
21
25
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
async collectPathsToDevfilesFromRegistry(): Promise<object[]> {
|
|
27
|
+
Logger.debug();
|
|
28
|
+
const devfileSamples: object[] = [];
|
|
29
|
+
const sampleNames: string[] = [];
|
|
30
|
+
switch (API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()) {
|
|
31
|
+
case SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL:
|
|
32
|
+
{
|
|
33
|
+
const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
|
|
34
|
+
content.forEach((e: any): void => {
|
|
35
|
+
if (e.name[0] !== '.') {
|
|
36
|
+
sampleNames.push(e.name);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
for (const sample of sampleNames) {
|
|
41
|
+
const sampleEndpoint: string = `${SUPPORTED_DEVFILE_REGISTRIES.GIT_HUB_CHE_DEVFILE_REGISTRY_URL}${sample}/meta.yaml`;
|
|
42
|
+
const sampleEndpointContent: AxiosResponse = await this.getContent(sampleEndpoint);
|
|
43
|
+
const decodedFileContent: string = Buffer.from((sampleEndpointContent as any).content, 'base64').toString();
|
|
44
|
+
const metaYamlContent: any = YAML.parse(decodedFileContent);
|
|
45
|
+
devfileSamples.push({
|
|
46
|
+
name: sample,
|
|
47
|
+
link: metaYamlContent.links.v2
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
case SUPPORTED_DEVFILE_REGISTRIES.INBUILT_APPLICATION_DEVFILE_REGISTRY_URL():
|
|
54
|
+
{
|
|
55
|
+
const content: any[any] = await this.getInbuiltDevfilesRegistryContent();
|
|
37
56
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
for (const sample of content) {
|
|
58
|
+
devfileSamples.push({
|
|
59
|
+
name: sample.displayName,
|
|
60
|
+
link: sample.links.v2
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
Logger.debug(`samples list: ${JSON.stringify(devfileSamples)}`);
|
|
64
|
+
}
|
|
65
|
+
break;
|
|
66
|
+
default: {
|
|
67
|
+
Logger.error(`unsupported registry url - ${API_TEST_CONSTANTS.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()}\n
|
|
68
|
+
supported registries: ${JSON.stringify(SUPPORTED_DEVFILE_REGISTRIES)}`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return devfileSamples;
|
|
72
|
+
}
|
|
50
73
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
Logger.debug(`${this.constructor.name}.${this.collectPathsToDevfilesFromRegistry.name}: samples list: ${JSON.stringify(devfileSamples)}`);
|
|
55
|
-
}
|
|
56
|
-
break;
|
|
57
|
-
default: {
|
|
58
|
-
Logger.error(`${this.constructor.name}.${this.collectPathsToDevfilesFromRegistry.name}: unsupported registry url - ${APITestConstants.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()}\n
|
|
59
|
-
supported registries: ${JSON.stringify(SupportedDevfilesRegistries)}`);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return devfileSamples;
|
|
63
|
-
}
|
|
74
|
+
private async getContent(url: string, headers?: object): Promise<AxiosResponse> {
|
|
75
|
+
Logger.debug(`${url}`);
|
|
64
76
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
return response?.data;
|
|
76
|
-
}
|
|
77
|
+
let response: AxiosResponse | undefined;
|
|
78
|
+
try {
|
|
79
|
+
response = await axios.get(url, headers);
|
|
80
|
+
} catch (error) {
|
|
81
|
+
Logger.error(`${error} + ${url}`);
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
return response?.data;
|
|
85
|
+
}
|
|
77
86
|
}
|