@eclipse-che/che-e2e 7.70.0-dev-e748965 → 7.70.0-dev-6d2f86b
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/README.md +13 -4
- package/configs/inversify.config.ts +18 -15
- package/configs/inversify.types.ts +2 -1
- package/configs/mocharc.ts +12 -2
- package/configs/sh-scripts/generateIndex.sh +2 -3
- package/constants/APITestConstants.ts +56 -0
- package/constants/BaseTestConstants.ts +65 -0
- package/constants/ChromeDriverConstants.ts +46 -0
- package/constants/FactoryTestConstants.ts +45 -0
- package/constants/MonacoConstants.ts +22 -0
- package/constants/OAuthConstants.ts +56 -0
- package/constants/PluginsTestConstants.ts +15 -0
- package/constants/ReporterConstants.ts +45 -0
- package/constants/TimeoutConstants.ts +28 -146
- package/dist/configs/inversify.config.js +15 -11
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +2 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +11 -2
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +54 -0
- package/dist/constants/APITestConstants.js.map +1 -0
- package/dist/constants/BaseTestConstants.js +61 -0
- package/dist/constants/BaseTestConstants.js.map +1 -0
- package/dist/constants/ChromeDriverConstants.js +44 -0
- package/dist/constants/ChromeDriverConstants.js.map +1 -0
- package/dist/constants/FactoryTestConstants.js +44 -0
- package/dist/constants/FactoryTestConstants.js.map +1 -0
- package/dist/constants/MonacoConstants.js +25 -0
- package/dist/constants/MonacoConstants.js.map +1 -0
- package/dist/constants/OAuthConstants.js +52 -0
- package/dist/constants/OAuthConstants.js.map +1 -0
- package/dist/constants/PluginsTestConstants.js +19 -0
- package/dist/constants/PluginsTestConstants.js.map +1 -0
- package/dist/constants/ReporterConstants.js +43 -0
- package/dist/constants/ReporterConstants.js.map +1 -0
- package/dist/constants/TimeoutConstants.js +22 -113
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js +7 -7
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +19 -10
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +2 -2
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +7 -6
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +3 -4
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +2 -3
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +12 -19
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +2 -2
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/interfaces/ICheLoginPage.js.map +1 -0
- package/dist/pageobjects/login/interfaces/IOcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +68 -0
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift/CheLoginPage.js → login/kubernetes/KubernetesLoginPage.js} +21 -26
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -0
- package/dist/pageobjects/{openshift → login/openshift}/OcpLoginPage.js +7 -7
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpRedHatLoginPage.js → openshift/OcpRedHatLoginPage.js} +5 -5
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{OcpUserLoginPage.js → openshift/OcpUserLoginPage.js} +7 -7
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RedHatLoginPage.js → openshift/RedHatLoginPage.js} +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/{RegularUserOcpCheLoginPage.js → openshift/RegularUserOcpCheLoginPage.js} +8 -8
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -0
- package/dist/specs/MochaHooks.js +9 -7
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +2 -2
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +4 -3
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +7 -2
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js +4 -3
- package/dist/specs/dashboard-samples/RecomendedExtentions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +2 -2
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +12 -10
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +16 -14
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +17 -15
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +4 -4
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +1 -2
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +2 -2
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +31 -27
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +7 -7
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +9 -9
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +16 -17
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +13 -11
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +11 -11
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +5 -5
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +2 -2
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +4 -2
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +3 -3
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +7 -7
- package/index.ts +19 -10
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +2 -2
- package/pageobjects/dashboard/Dashboard.ts +7 -6
- package/pageobjects/dashboard/Workspaces.ts +3 -4
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +2 -3
- package/pageobjects/git-providers/OauthPage.ts +8 -16
- package/pageobjects/ide/CheCodeLocatorLoader.ts +2 -2
- package/pageobjects/login/kubernetes/DexLoginPage.ts +58 -0
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +33 -0
- package/pageobjects/{openshift → login/openshift}/OcpLoginPage.ts +7 -7
- package/pageobjects/login/{OcpRedHatLoginPage.ts → openshift/OcpRedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{OcpUserLoginPage.ts → openshift/OcpUserLoginPage.ts} +8 -8
- package/pageobjects/login/{RedHatLoginPage.ts → openshift/RedHatLoginPage.ts} +6 -6
- package/pageobjects/login/{RegularUserOcpCheLoginPage.ts → openshift/RegularUserOcpCheLoginPage.ts} +9 -9
- package/specs/MochaHooks.ts +9 -7
- package/specs/SmokeTest.spec.ts +2 -2
- package/specs/api/EmptyWorkspaceAPI.spec.ts +4 -3
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +10 -2
- package/specs/dashboard-samples/RecomendedExtentions.spec.ts +4 -3
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +2 -2
- package/specs/factory/Factory.spec.ts +12 -10
- package/specs/factory/NoSetupRepoFactory.spec.ts +16 -14
- package/specs/factory/RefusedOAuthFactory.spec.ts +17 -15
- package/tests-library/LoginTests.ts +6 -6
- package/tests-library/WorkspaceHandlingTests.ts +1 -2
- package/utils/BrowserTabsUtil.ts +2 -2
- package/utils/CheReporter.ts +32 -28
- package/utils/DevWorkspaceConfigurationHelper.ts +7 -7
- package/utils/DevfilesRegistryHelper.ts +3 -3
- package/utils/DriverHelper.ts +20 -21
- package/utils/KubernetesCommandLineToolsExecutor.ts +11 -9
- package/utils/Logger.ts +11 -12
- package/utils/ScreenCatcher.ts +5 -5
- package/utils/request-handlers/CheApiRequestHandler.ts +2 -2
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +4 -2
- package/utils/workspace/TestWorkspaceUtil.ts +3 -3
- package/constants/TestConstants.ts +0 -255
- package/dist/constants/TestConstants.js +0 -206
- package/dist/constants/TestConstants.js.map +0 -1
- package/dist/pageobjects/login/ICheLoginPage.js.map +0 -1
- package/dist/pageobjects/login/IOcpLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpRedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/OcpUserLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RedHatLoginPage.js.map +0 -1
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/CheLoginPage.js.map +0 -1
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +0 -1
- package/pageobjects/openshift/CheLoginPage.ts +0 -42
- /package/dist/pageobjects/login/{ICheLoginPage.js → interfaces/ICheLoginPage.js} +0 -0
- /package/dist/pageobjects/login/{IOcpLoginPage.js → interfaces/IOcpLoginPage.js} +0 -0
- /package/pageobjects/login/{ICheLoginPage.ts → interfaces/ICheLoginPage.ts} +0 -0
- /package/pageobjects/login/{IOcpLoginPage.ts → interfaces/IOcpLoginPage.ts} +0 -0
|
@@ -25,7 +25,6 @@ import {
|
|
|
25
25
|
ViewItem,
|
|
26
26
|
ViewSection
|
|
27
27
|
} from 'monaco-page-objects';
|
|
28
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
29
28
|
import { expect } from 'chai';
|
|
30
29
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
31
30
|
import { StringUtil } from '../../utils/StringUtil';
|
|
@@ -38,6 +37,9 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
38
37
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
39
38
|
import { Logger } from '../../utils/Logger';
|
|
40
39
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
40
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
41
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
42
|
+
import { FactoryTestConstants } from '../../constants/FactoryTestConstants';
|
|
41
43
|
|
|
42
44
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
43
45
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -47,7 +49,7 @@ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
|
47
49
|
|
|
48
50
|
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
49
51
|
|
|
50
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
52
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`, async function (): Promise<void> {
|
|
51
53
|
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
52
54
|
|
|
53
55
|
let projectSection: ViewSection;
|
|
@@ -59,18 +61,18 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
59
61
|
const timeToRefresh: number = 1500;
|
|
60
62
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
61
63
|
const fileToChange: string = 'Date.txt';
|
|
62
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
64
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
63
65
|
const refreshButtonLabel: string = 'Refresh';
|
|
64
66
|
const pushItemLabel: string = 'Push';
|
|
65
67
|
let testRepoProjectName: string;
|
|
66
68
|
|
|
67
69
|
loginTests.loginIntoChe();
|
|
68
70
|
test(`Navigate to the factory URL`, async function (): Promise<void> {
|
|
69
|
-
await browserTabsUtil.navigateTo(
|
|
71
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
70
72
|
});
|
|
71
73
|
|
|
72
|
-
if (
|
|
73
|
-
test(`Authorize with a ${
|
|
74
|
+
if (OAuthConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
75
|
+
test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function (): Promise<void> {
|
|
74
76
|
await oauthPage.login();
|
|
75
77
|
await oauthPage.waitOauthPage();
|
|
76
78
|
await oauthPage.confirmAccess();
|
|
@@ -88,13 +90,13 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
88
90
|
});
|
|
89
91
|
|
|
90
92
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
91
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
93
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
92
94
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
93
95
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
94
96
|
});
|
|
95
97
|
|
|
96
98
|
test('Check if the project files were imported', async function (): Promise<void> {
|
|
97
|
-
const label: string =
|
|
99
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
98
100
|
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
99
101
|
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
100
102
|
expect(isFileImported).not.eqls(undefined);
|
|
@@ -167,7 +169,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
167
169
|
});
|
|
168
170
|
|
|
169
171
|
test('Push the changes', async function (): Promise<void> {
|
|
170
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
172
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
171
173
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
172
174
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
173
175
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -192,7 +194,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
192
194
|
loginTests.logoutFromChe();
|
|
193
195
|
|
|
194
196
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
195
|
-
if (!
|
|
197
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
196
198
|
await driverHelper.getDriver().close();
|
|
197
199
|
}
|
|
198
200
|
});
|
|
@@ -38,10 +38,12 @@ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
|
38
38
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
39
39
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
40
40
|
import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
|
|
41
|
-
import { GitProviderType, TestConstants } from '../../constants/TestConstants';
|
|
42
41
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
43
42
|
import { Logger } from '../../utils/Logger';
|
|
44
43
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
44
|
+
import { FactoryTestConstants, GitProviderType } from '../../constants/FactoryTestConstants';
|
|
45
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
46
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
45
47
|
|
|
46
48
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
49
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -52,7 +54,7 @@ const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
|
52
54
|
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
|
|
53
55
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
54
56
|
|
|
55
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
57
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`, async function (): Promise<void> {
|
|
56
58
|
|
|
57
59
|
let projectSection: ViewSection;
|
|
58
60
|
let scmProvider: SingleScmProvider;
|
|
@@ -65,11 +67,11 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
65
67
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
66
68
|
const fileToChange: string = 'Date.txt';
|
|
67
69
|
const pushItemLabel: string = 'Push';
|
|
68
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
70
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
69
71
|
const refreshButtonLabel: string = 'Refresh';
|
|
70
|
-
const label: string =
|
|
72
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
71
73
|
let testRepoProjectName: string;
|
|
72
|
-
const isPrivateRepo: string =
|
|
74
|
+
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
73
75
|
|
|
74
76
|
loginTests.loginIntoChe();
|
|
75
77
|
|
|
@@ -80,10 +82,10 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
80
82
|
});
|
|
81
83
|
|
|
82
84
|
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
83
|
-
await browserTabsUtil.navigateTo(
|
|
85
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
84
86
|
});
|
|
85
87
|
|
|
86
|
-
if (
|
|
88
|
+
if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
87
89
|
|
|
88
90
|
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
89
91
|
await dashboard.waitLoader();
|
|
@@ -114,7 +116,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
114
116
|
});
|
|
115
117
|
|
|
116
118
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
117
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
119
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
118
120
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
119
121
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
120
122
|
});
|
|
@@ -136,7 +138,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
136
138
|
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
137
139
|
} catch (e) {
|
|
138
140
|
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
139
|
-
if (!
|
|
141
|
+
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
140
142
|
throw new WebDriverError(e as string);
|
|
141
143
|
}
|
|
142
144
|
}
|
|
@@ -208,7 +210,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
208
210
|
});
|
|
209
211
|
|
|
210
212
|
test('Push the changes', async function (): Promise<void> {
|
|
211
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
213
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
212
214
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
213
215
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
214
216
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -217,7 +219,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
217
219
|
await scmContextMenu.select(pushItemLabel);
|
|
218
220
|
});
|
|
219
221
|
|
|
220
|
-
if (
|
|
222
|
+
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITHUB) {
|
|
221
223
|
test('Decline GitHub Extension', async function (): Promise<void> {
|
|
222
224
|
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.details);
|
|
223
225
|
const gitHaExtensionDialog: ModalDialog = new ModalDialog();
|
|
@@ -235,11 +237,11 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
235
237
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066`);
|
|
236
238
|
}
|
|
237
239
|
const input: InputBox = new InputBox();
|
|
238
|
-
await input.setText(
|
|
240
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
239
241
|
await driverHelper.wait(timeToRefresh);
|
|
240
242
|
await input.confirm();
|
|
241
243
|
await driverHelper.wait(timeToRefresh);
|
|
242
|
-
await input.setText(
|
|
244
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
243
245
|
await input.confirm();
|
|
244
246
|
await driverHelper.wait(timeToRefresh);
|
|
245
247
|
});
|
|
@@ -265,7 +267,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
265
267
|
}
|
|
266
268
|
|
|
267
269
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
268
|
-
if (!
|
|
270
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
269
271
|
await driverHelper.getDriver().close();
|
|
270
272
|
}
|
|
271
273
|
});
|
|
@@ -35,12 +35,14 @@ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTes
|
|
|
35
35
|
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
36
36
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
37
37
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
38
|
-
import { TestConstants } from '../../constants/TestConstants';
|
|
39
38
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
40
39
|
import { StringUtil } from '../../utils/StringUtil';
|
|
41
40
|
import { Logger } from '../../utils/Logger';
|
|
42
41
|
import { TimeoutConstants } from '../../constants/TimeoutConstants';
|
|
43
42
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
43
|
+
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
44
|
+
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
45
|
+
import { FactoryTestConstants } from '../../constants/FactoryTestConstants';
|
|
44
46
|
|
|
45
47
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
46
48
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -49,7 +51,7 @@ const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocato
|
|
|
49
51
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
50
52
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
51
53
|
|
|
52
|
-
suite(`Create a workspace via launching a factory from the ${
|
|
54
|
+
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`, async function (): Promise<void> {
|
|
53
55
|
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
54
56
|
|
|
55
57
|
let projectSection: ViewSection;
|
|
@@ -61,21 +63,21 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
61
63
|
const timeToRefresh: number = 1500;
|
|
62
64
|
const changesToCommit: string = (new Date()).getTime().toString();
|
|
63
65
|
const fileToChange: string = 'Date.txt';
|
|
64
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${
|
|
66
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
65
67
|
const refreshButtonLabel: string = 'Refresh';
|
|
66
68
|
const pushItemLabel: string = 'Push';
|
|
67
|
-
const label: string =
|
|
69
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
68
70
|
let testRepoProjectName: string;
|
|
69
|
-
const isPrivateRepo: string =
|
|
71
|
+
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
70
72
|
|
|
71
73
|
loginTests.loginIntoChe();
|
|
72
74
|
|
|
73
75
|
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
74
|
-
await browserTabsUtil.navigateTo(
|
|
76
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
75
77
|
});
|
|
76
78
|
|
|
77
|
-
if (
|
|
78
|
-
test(`Authorize with a ${
|
|
79
|
+
if (FactoryTestConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
80
|
+
test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function (): Promise<void> {
|
|
79
81
|
await oauthPage.login();
|
|
80
82
|
await oauthPage.waitOauthPage();
|
|
81
83
|
await oauthPage.denyAccess();
|
|
@@ -97,7 +99,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
97
99
|
});
|
|
98
100
|
|
|
99
101
|
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
100
|
-
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(
|
|
102
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
101
103
|
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
102
104
|
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
103
105
|
});
|
|
@@ -119,13 +121,13 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
119
121
|
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
120
122
|
} catch (e) {
|
|
121
123
|
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
122
|
-
if (!
|
|
124
|
+
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
123
125
|
throw new WebDriverError(e as string);
|
|
124
126
|
}
|
|
125
127
|
}
|
|
126
128
|
});
|
|
127
129
|
|
|
128
|
-
if (
|
|
130
|
+
if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
129
131
|
test('Check that project can not be cloned', async function (): Promise<void> {
|
|
130
132
|
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message);
|
|
131
133
|
const workspaceDoesNotExistDialog: ModalDialog = new ModalDialog();
|
|
@@ -205,7 +207,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
205
207
|
});
|
|
206
208
|
|
|
207
209
|
test('Push the changes', async function (): Promise<void> {
|
|
208
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${
|
|
210
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
209
211
|
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
210
212
|
Logger.debug(`scmProvider.openMoreActions`);
|
|
211
213
|
scmContextMenu = await scmProvider.openMoreActions();
|
|
@@ -224,10 +226,10 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
224
226
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066`);
|
|
225
227
|
}
|
|
226
228
|
const input: InputBox = new InputBox();
|
|
227
|
-
await input.setText(
|
|
229
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
228
230
|
await input.confirm();
|
|
229
231
|
await driverHelper.wait(timeToRefresh);
|
|
230
|
-
await input.setText(
|
|
232
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
231
233
|
await input.confirm();
|
|
232
234
|
await driverHelper.wait(timeToRefresh);
|
|
233
235
|
});
|
|
@@ -253,7 +255,7 @@ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SE
|
|
|
253
255
|
loginTests.logoutFromChe();
|
|
254
256
|
|
|
255
257
|
suiteTeardown('Close the browser', async function (): Promise<void> {
|
|
256
|
-
if (!
|
|
258
|
+
if (!BaseTestConstants.TS_DEBUG_MODE) {
|
|
257
259
|
await driverHelper.getDriver().close();
|
|
258
260
|
}
|
|
259
261
|
});
|
|
@@ -9,12 +9,12 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
|
|
11
11
|
import { CLASSES, TYPES } from '../configs/inversify.types';
|
|
12
|
-
import { ICheLoginPage } from '../pageobjects/login/ICheLoginPage';
|
|
13
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
12
|
+
import { ICheLoginPage } from '../pageobjects/login/interfaces/ICheLoginPage';
|
|
14
13
|
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
15
14
|
import { inject, injectable } from 'inversify';
|
|
16
15
|
import { Dashboard } from '../pageobjects/dashboard/Dashboard';
|
|
17
|
-
import { IOcpLoginPage } from '../pageobjects/login/IOcpLoginPage';
|
|
16
|
+
import { IOcpLoginPage } from '../pageobjects/login/interfaces/IOcpLoginPage';
|
|
17
|
+
import { BaseTestConstants } from '../constants/BaseTestConstants';
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class LoginTests {
|
|
@@ -27,8 +27,8 @@ export class LoginTests {
|
|
|
27
27
|
|
|
28
28
|
loginIntoChe(): void {
|
|
29
29
|
test('Login', async () => {
|
|
30
|
-
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(
|
|
31
|
-
await this.browserTabsUtil.navigateTo(
|
|
30
|
+
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(BaseTestConstants.TS_SELENIUM_BASE_URL)) {
|
|
31
|
+
await this.browserTabsUtil.navigateTo(BaseTestConstants.TS_SELENIUM_BASE_URL);
|
|
32
32
|
}
|
|
33
33
|
await this.productLoginPage.login();
|
|
34
34
|
await this.browserTabsUtil.maximize();
|
|
@@ -38,7 +38,7 @@ export class LoginTests {
|
|
|
38
38
|
|
|
39
39
|
loginIntoOcpConsole(): void {
|
|
40
40
|
test('Login into ocp console', async () => {
|
|
41
|
-
const openshiftConsoleUrl: string =
|
|
41
|
+
const openshiftConsoleUrl: string = BaseTestConstants.TS_SELENIUM_BASE_URL.replace('devspaces', 'console-openshift-console');
|
|
42
42
|
await this.browserTabsUtil.navigateTo(openshiftConsoleUrl);
|
|
43
43
|
await this.ocpLoginPage.login();
|
|
44
44
|
await this.browserTabsUtil.maximize();
|
|
@@ -20,7 +20,6 @@ import { ApiUrlResolver } from '../utils/workspace/ApiUrlResolver';
|
|
|
20
20
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
21
21
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
22
22
|
import { By, error } from 'selenium-webdriver';
|
|
23
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
24
23
|
|
|
25
24
|
@injectable()
|
|
26
25
|
export class WorkspaceHandlingTests {
|
|
@@ -90,7 +89,7 @@ export class WorkspaceHandlingTests {
|
|
|
90
89
|
obtainWorkspaceNameFromStartingPage(): void {
|
|
91
90
|
test('Obtain workspace name from workspace loader page', async() => {
|
|
92
91
|
const timeout: number = TimeoutConstants.TS_IDE_LOAD_TIMEOUT;
|
|
93
|
-
const polling: number =
|
|
92
|
+
const polling: number = TimeoutConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
94
93
|
const attempts: number = Math.ceil(timeout / polling);
|
|
95
94
|
|
|
96
95
|
for (let i: number = 0; i < attempts; i++) {
|
package/utils/BrowserTabsUtil.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { CLASSES } from '../configs/inversify.types';
|
|
|
13
13
|
import { DriverHelper } from './DriverHelper';
|
|
14
14
|
import { Logger } from './Logger';
|
|
15
15
|
import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
16
|
-
import {
|
|
16
|
+
import { ChromeDriverConstants } from '../constants/ChromeDriverConstants';
|
|
17
17
|
|
|
18
18
|
@injectable()
|
|
19
19
|
export class BrowserTabsUtil {
|
|
@@ -92,7 +92,7 @@ export class BrowserTabsUtil {
|
|
|
92
92
|
|
|
93
93
|
async maximize(): Promise<void> {
|
|
94
94
|
Logger.trace(`BrowserTabsUtil.maximize`);
|
|
95
|
-
if (
|
|
95
|
+
if (ChromeDriverConstants.TS_SELENIUM_LAUNCH_FULLSCREEN) {
|
|
96
96
|
Logger.debug(`TS_SELENIUM_LAUNCH_FULLSCREEN is set to true, maximizing window.`);
|
|
97
97
|
await this.driverHelper.getDriver().manage().window().maximize();
|
|
98
98
|
}
|
package/utils/CheReporter.ts
CHANGED
|
@@ -11,7 +11,6 @@ import * as mocha from 'mocha';
|
|
|
11
11
|
import { TYPES, CLASSES } from '../configs/inversify.types';
|
|
12
12
|
import * as fs from 'fs';
|
|
13
13
|
import * as rm from 'rimraf';
|
|
14
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
15
14
|
import { logging } from 'selenium-webdriver';
|
|
16
15
|
import { DriverHelper } from './DriverHelper';
|
|
17
16
|
import { ScreenCatcher } from './ScreenCatcher';
|
|
@@ -21,6 +20,11 @@ import { Logger } from './Logger';
|
|
|
21
20
|
import { e2eContainer } from '../configs/inversify.config';
|
|
22
21
|
import { WriteStream } from 'fs';
|
|
23
22
|
import { StringUtil } from './StringUtil';
|
|
23
|
+
import { BaseTestConstants } from '../constants/BaseTestConstants';
|
|
24
|
+
import { ChromeDriverConstants } from '../constants/ChromeDriverConstants';
|
|
25
|
+
import { OAuthConstants } from '../constants/OAuthConstants';
|
|
26
|
+
import { ReporterConstants } from '../constants/ReporterConstants';
|
|
27
|
+
import { PluginsTestConstants } from '../constants/PluginsTestConstants';
|
|
24
28
|
|
|
25
29
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
26
30
|
const screenCatcher: ScreenCatcher = e2eContainer.get(CLASSES.ScreenCatcher);
|
|
@@ -39,32 +43,32 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
39
43
|
let launchInformation: string =
|
|
40
44
|
`################## Launch Information ##################
|
|
41
45
|
|
|
42
|
-
TS_SELENIUM_BASE_URL: ${
|
|
43
|
-
TS_SELENIUM_HEADLESS: ${
|
|
44
|
-
TS_SELENIUM_OCP_USERNAME: ${
|
|
45
|
-
TS_SELENIUM_EDITOR: ${
|
|
46
|
-
|
|
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: ${
|
|
46
|
+
TS_SELENIUM_BASE_URL: ${BaseTestConstants.TS_SELENIUM_BASE_URL}
|
|
47
|
+
TS_SELENIUM_HEADLESS: ${ChromeDriverConstants.TS_SELENIUM_HEADLESS}
|
|
48
|
+
TS_SELENIUM_OCP_USERNAME: ${OAuthConstants.TS_SELENIUM_OCP_USERNAME}
|
|
49
|
+
TS_SELENIUM_EDITOR: ${BaseTestConstants.TS_SELENIUM_EDITOR}
|
|
50
|
+
|
|
51
|
+
TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME: ${BaseTestConstants.TS_SELENIUM_HAPPY_PATH_WORKSPACE_NAME}
|
|
52
|
+
TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS: ${ReporterConstants.TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS}
|
|
53
|
+
TS_SELENIUM_REPORT_FOLDER: ${ReporterConstants.TS_SELENIUM_REPORT_FOLDER}
|
|
54
|
+
TS_SELENIUM_EXECUTION_SCREENCAST: ${ReporterConstants.TS_SELENIUM_EXECUTION_SCREENCAST}
|
|
55
|
+
DELETE_SCREENCAST_IF_TEST_PASS: ${ReporterConstants.DELETE_SCREENCAST_IF_TEST_PASS}
|
|
56
|
+
TS_SELENIUM_REMOTE_DRIVER_URL: ${ChromeDriverConstants.TS_SELENIUM_REMOTE_DRIVER_URL}
|
|
57
|
+
DELETE_WORKSPACE_ON_FAILED_TEST: ${BaseTestConstants.DELETE_WORKSPACE_ON_FAILED_TEST}
|
|
58
|
+
TS_SELENIUM_LOG_LEVEL: ${ReporterConstants.TS_SELENIUM_LOG_LEVEL}
|
|
59
|
+
TS_SELENIUM_LAUNCH_FULLSCREEN: ${ChromeDriverConstants.TS_SELENIUM_LAUNCH_FULLSCREEN}
|
|
56
60
|
|
|
57
61
|
TS_COMMON_DASHBOARD_WAIT_TIMEOUT: ${TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT}
|
|
58
62
|
TS_SELENIUM_START_WORKSPACE_TIMEOUT: ${TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT}
|
|
59
63
|
TS_WAIT_LOADER_PRESENCE_TIMEOUT: ${TimeoutConstants.TS_WAIT_LOADER_PRESENCE_TIMEOUT}
|
|
60
64
|
|
|
61
|
-
TS_SAMPLE_LIST: ${
|
|
65
|
+
TS_SAMPLE_LIST: ${PluginsTestConstants.TS_SAMPLE_LIST}
|
|
62
66
|
|
|
63
67
|
${process.env.MOCHA_DIRECTORY ? 'MOCHA_DIRECTORY: ' + process.env.MOCHA_DIRECTORY : 'MOCHA_DRIRECTORY is not set'}
|
|
64
68
|
${process.env.USERSTORY ? 'USERSTORY: ' + process.env.USERSTORY : 'USERSTORY is not set'}
|
|
65
69
|
`;
|
|
66
70
|
|
|
67
|
-
if (
|
|
71
|
+
if (ReporterConstants.TS_SELENIUM_PRINT_TIMEOUT_VARIABLES) {
|
|
68
72
|
launchInformation += `\n TS_SELENIUM_PRINT_TIMEOUT_VARIABLES is set to true: \n`;
|
|
69
73
|
Object.entries(TimeoutConstants).forEach(
|
|
70
74
|
([key, value]) => launchInformation += `\n ${key}: ${value}`);
|
|
@@ -76,11 +80,11 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
76
80
|
|
|
77
81
|
console.log(launchInformation);
|
|
78
82
|
|
|
79
|
-
rm.sync(
|
|
83
|
+
rm.sync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER);
|
|
80
84
|
});
|
|
81
85
|
|
|
82
86
|
runner.on('test', async function (test: mocha.Test): Promise<void> {
|
|
83
|
-
if (!
|
|
87
|
+
if (!ReporterConstants.TS_SELENIUM_EXECUTION_SCREENCAST) {
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
90
|
|
|
@@ -92,13 +96,13 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
92
96
|
await screenCatcher.catchMethodScreen(test.title, currentMethodIndex, iterationIndex);
|
|
93
97
|
iterationIndex = iterationIndex + 1;
|
|
94
98
|
|
|
95
|
-
await driverHelper.wait(
|
|
99
|
+
await driverHelper.wait(ReporterConstants.TS_SELENIUM_DELAY_BETWEEN_SCREENSHOTS);
|
|
96
100
|
}
|
|
97
101
|
});
|
|
98
102
|
|
|
99
103
|
runner.on('pass', async (test: mocha.Test) => {
|
|
100
|
-
if (
|
|
101
|
-
const loadTestReportFolder: string =
|
|
104
|
+
if (BaseTestConstants.TS_LOAD_TESTS) {
|
|
105
|
+
const loadTestReportFolder: string = ReporterConstants.TS_SELENIUM_LOAD_TEST_REPORT_FOLDER;
|
|
102
106
|
const loadTestFilePath: string = loadTestReportFolder + '/load-test-results.txt';
|
|
103
107
|
const report: string = test.title + ': ' + test.duration + '\r';
|
|
104
108
|
if (!fs.existsSync(loadTestReportFolder)) {
|
|
@@ -117,8 +121,8 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
117
121
|
await driverHelper.getDriver().quit();
|
|
118
122
|
|
|
119
123
|
// delete screencast folder if conditions matched
|
|
120
|
-
if (deleteScreencast &&
|
|
121
|
-
rm.sync(
|
|
124
|
+
if (deleteScreencast && ReporterConstants.DELETE_SCREENCAST_IF_TEST_PASS) {
|
|
125
|
+
rm.sync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER);
|
|
122
126
|
}
|
|
123
127
|
});
|
|
124
128
|
|
|
@@ -134,17 +138,17 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
134
138
|
const testTitle: string = StringUtil.sanitizeTitle(test.title);
|
|
135
139
|
Logger.trace(`TestTitleSanitized:${testTitle}`);
|
|
136
140
|
|
|
137
|
-
const testReportDirPath: string = `${
|
|
141
|
+
const testReportDirPath: string = `${ReporterConstants.TS_SELENIUM_REPORT_FOLDER}/${testFullTitle}`;
|
|
138
142
|
const screenshotFileName: string = `${testReportDirPath}/screenshot-${testTitle}.png`;
|
|
139
143
|
const pageSourceFileName: string = `${testReportDirPath}/pagesource-${testTitle}.html`;
|
|
140
144
|
const browserLogsFileName: string = `${testReportDirPath}/browserlogs-${testTitle}.txt`;
|
|
141
145
|
|
|
142
146
|
|
|
143
147
|
// create reporter dir if not exist
|
|
144
|
-
const reportDirExists: boolean = fs.existsSync(
|
|
148
|
+
const reportDirExists: boolean = fs.existsSync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER);
|
|
145
149
|
|
|
146
150
|
if (!reportDirExists) {
|
|
147
|
-
fs.mkdirSync(
|
|
151
|
+
fs.mkdirSync(ReporterConstants.TS_SELENIUM_REPORT_FOLDER);
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
// create dir for failed test report if not exist
|
|
@@ -179,7 +183,7 @@ class CheReporter extends mocha.reporters.Spec {
|
|
|
179
183
|
browserLogsStream.end();
|
|
180
184
|
|
|
181
185
|
// stop and remove running workspace
|
|
182
|
-
if (
|
|
186
|
+
if (BaseTestConstants.DELETE_WORKSPACE_ON_FAILED_TEST) {
|
|
183
187
|
Logger.warn('Property DELETE_WORKSPACE_ON_FAILED_TEST se to true - trying to stop and delete running workspace.');
|
|
184
188
|
await testWorkspaceUtil.stopAndDeleteWorkspaceByName(CheReporter.latestWorkspace);
|
|
185
189
|
}
|
|
@@ -4,8 +4,8 @@ import { V1alpha2DevWorkspaceTemplate } from '@devfile/api';
|
|
|
4
4
|
import YAML from 'yaml';
|
|
5
5
|
import * as axios from 'axios';
|
|
6
6
|
import { Logger } from './Logger';
|
|
7
|
-
import { TestConstants } from '../constants/TestConstants';
|
|
8
7
|
import { ShellExecutor } from './ShellExecutor';
|
|
8
|
+
import { APITestConstants } from '../constants/APITestConstants';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* to see more about IContextParams and generateDevfileContext(params) check README.md in "@eclipse-che/che-devworkspace-generator;
|
|
@@ -39,19 +39,19 @@ export class DevWorkspaceConfigurationHelper {
|
|
|
39
39
|
params.editorEntry = 'che-incubator/che-code/latest';
|
|
40
40
|
}
|
|
41
41
|
// check if one or both has value
|
|
42
|
-
if (
|
|
42
|
+
if (APITestConstants.TS_API_TEST_UDI_IMAGE || params.defaultComponentImage) {
|
|
43
43
|
params.injectDefaultComponent = 'true';
|
|
44
44
|
// check if not explicitly passed than assign value from the constants
|
|
45
45
|
if (!params.defaultComponentImage) {
|
|
46
|
-
params.defaultComponentImage =
|
|
46
|
+
params.defaultComponentImage = APITestConstants.TS_API_TEST_UDI_IMAGE;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
// assign value from the constants if not explicitly passed
|
|
50
|
-
if (
|
|
51
|
-
params.pluginRegistryUrl =
|
|
50
|
+
if (APITestConstants.TS_API_TEST_PLUGIN_REGISTRY_URL && !params.pluginRegistryUrl) {
|
|
51
|
+
params.pluginRegistryUrl = APITestConstants.TS_API_TEST_PLUGIN_REGISTRY_URL;
|
|
52
52
|
}
|
|
53
|
-
if (
|
|
54
|
-
params.editorContent = ShellExecutor.curl(
|
|
53
|
+
if (APITestConstants.TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI && !params.editorContent) {
|
|
54
|
+
params.editorContent = ShellExecutor.curl(APITestConstants.TS_API_TEST_CHE_CODE_EDITOR_DEVFILE_URI).stdout;
|
|
55
55
|
}
|
|
56
56
|
this.params = params;
|
|
57
57
|
}
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
|
-
import { SupportedDevfilesRegistries, TestConstants } from '../constants/TestConstants';
|
|
11
10
|
import axios, { AxiosResponse } from 'axios';
|
|
12
11
|
import { Logger } from './Logger';
|
|
13
12
|
import YAML from 'yaml';
|
|
13
|
+
import { APITestConstants, SupportedDevfilesRegistries } from '../constants/APITestConstants';
|
|
14
14
|
|
|
15
15
|
export class DevfilesRegistryHelper {
|
|
16
16
|
|
|
@@ -28,7 +28,7 @@ export class DevfilesRegistryHelper {
|
|
|
28
28
|
Logger.debug(`${this.constructor.name}.${this.collectPathsToDevfilesFromRegistry.name}`);
|
|
29
29
|
const devfileSamples: object[] = [];
|
|
30
30
|
const sampleNames: string[] = [];
|
|
31
|
-
switch (
|
|
31
|
+
switch (APITestConstants.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()) {
|
|
32
32
|
case (SupportedDevfilesRegistries.GIT_HUB_CHE_DEVFILE_REGISTRY_URL): {
|
|
33
33
|
const content: any[any] = await this.getGitHubCheDevfileRegistryContent();
|
|
34
34
|
content.forEach((e: any) => {
|
|
@@ -55,7 +55,7 @@ export class DevfilesRegistryHelper {
|
|
|
55
55
|
}
|
|
56
56
|
break;
|
|
57
57
|
default: {
|
|
58
|
-
Logger.error(`${this.constructor.name}.${this.collectPathsToDevfilesFromRegistry.name}: unsupported registry url - ${
|
|
58
|
+
Logger.error(`${this.constructor.name}.${this.collectPathsToDevfilesFromRegistry.name}: unsupported registry url - ${APITestConstants.TS_API_ACCEPTANCE_TEST_REGISTRY_URL()}\n
|
|
59
59
|
supported registries: ${JSON.stringify(SupportedDevfilesRegistries)}`);
|
|
60
60
|
}
|
|
61
61
|
}
|