@eclipse-che/che-e2e 7.74.0-dev-1d09cb7 → 7.74.0-dev-aace77a
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 +197 -0
- package/.prettierignore +10 -0
- package/.prettierrc.json +10 -0
- package/CODE_STYLE.md +144 -0
- package/README.md +47 -47
- package/configs/inversify.config.ts +39 -14
- package/configs/inversify.types.ts +44 -30
- 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 +42 -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 +36 -9
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +19 -5
- 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} +12 -12
- package/dist/constants/API_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{BaseTestConstants.js → BASE_TEST_CONSTANTS.js} +16 -16
- package/dist/constants/BASE_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js +36 -0
- package/dist/constants/CHROME_DRIVER_CONSTANTS.js.map +1 -0
- package/dist/constants/{FactoryTestConstants.js → FACTORY_TEST_CONSTANTS.js} +14 -13
- package/dist/constants/FACTORY_TEST_CONSTANTS.js.map +1 -0
- package/dist/constants/{MonacoConstants.js → MONACO_CONSTANTS.js} +7 -7
- package/dist/constants/MONACO_CONSTANTS.js.map +1 -0
- package/dist/constants/{OAuthConstants.js → OAUTH_CONSTANTS.js} +14 -14
- 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} +12 -12
- 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 -22
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +18 -12
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +15 -15
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +20 -21
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +55 -60
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +58 -48
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +22 -20
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +26 -12
- 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 +14 -14
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +7 -7
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +24 -28
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +13 -16
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +9 -9
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +19 -23
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +20 -19
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +11 -11
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +24 -24
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +30 -30
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +33 -27
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +17 -17
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js +8 -6
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +27 -24
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +17 -17
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +10 -8
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +10 -10
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +13 -13
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +52 -52
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +23 -19
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +38 -41
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +52 -50
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +49 -51
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +45 -42
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js +13 -13
- 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 +22 -19
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +21 -21
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js +91 -65
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +34 -15
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +34 -18
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +73 -68
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/IContextParams.js +12 -0
- package/dist/utils/IContextParams.js.map +1 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js +3 -0
- package/dist/utils/IKubernetesCommandLineToolsExecutor.js.map +1 -0
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +146 -107
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +18 -19
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js +26 -16
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js +29 -9
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +19 -9
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +29 -29
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +12 -8
- 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 +25 -23
- 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 -58
- package/driver/IDriver.ts +3 -3
- package/index.ts +11 -9
- package/package.json +59 -49
- package/pageobjects/dashboard/CreateWorkspace.ts +65 -55
- package/pageobjects/dashboard/Dashboard.ts +100 -100
- package/pageobjects/dashboard/Workspaces.ts +210 -186
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +153 -131
- package/pageobjects/git-providers/OauthPage.ts +177 -166
- package/pageobjects/ide/CheCodeLocatorLoader.ts +51 -46
- package/pageobjects/login/interfaces/ICheLoginPage.ts +3 -3
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +3 -3
- package/pageobjects/login/kubernetes/DexLoginPage.ts +31 -30
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +15 -14
- package/pageobjects/login/openshift/OcpLoginPage.ts +51 -56
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +27 -27
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +15 -18
- package/pageobjects/login/openshift/RedHatLoginPage.ts +49 -46
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +43 -34
- package/pageobjects/openshift/OcpApplicationPage.ts +21 -19
- package/pageobjects/openshift/OcpImportFromGitPage.ts +68 -68
- package/pageobjects/openshift/OcpMainPage.ts +69 -69
- package/specs/MochaHooks.ts +59 -52
- package/specs/SmokeTest.spec.ts +47 -45
- package/specs/api/ContainerOverridesAPI.spec.ts +39 -26
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +110 -97
- package/specs/api/EmptyWorkspaceAPI.spec.ts +67 -58
- package/specs/api/PodOverridesAPI.spec.ts +48 -34
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +36 -36
- package/specs/dashboard-samples/Quarkus.spec.ts +41 -40
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +202 -183
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +85 -75
- package/specs/factory/Factory.spec.ts +184 -178
- package/specs/factory/NoSetupRepoFactory.spec.ts +233 -219
- package/specs/factory/RefusedOAuthFactory.spec.ts +223 -211
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +70 -64
- package/tests-library/LoginTests.ts +34 -32
- package/tests-library/ProjectAndFileTests.ts +21 -18
- package/tests-library/WorkspaceHandlingTests.ts +98 -89
- package/tsconfig.json +15 -15
- package/utils/BrowserTabsUtil.ts +78 -74
- package/utils/CheReporter.ts +159 -157
- package/utils/DevWorkspaceConfigurationHelper.ts +63 -69
- package/utils/DevfilesRegistryHelper.ts +71 -57
- package/utils/DriverHelper.ts +728 -700
- package/utils/IContextParams.ts +26 -0
- package/utils/IKubernetesCommandLineToolsExecutor.ts +42 -0
- package/utils/KubernetesCommandLineToolsExecutor.ts +231 -183
- package/utils/Logger.ts +102 -125
- package/utils/ScreenCatcher.ts +57 -46
- package/utils/ShellExecutor.ts +23 -12
- package/utils/StringUtil.ts +49 -36
- package/utils/request-handlers/CheApiRequestHandler.ts +91 -88
- 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 +152 -145
- package/utils/workspace/WorkspaceStatus.ts +5 -5
- package/constants/APITestConstants.ts +0 -57
- package/constants/BaseTestConstants.ts +0 -68
- 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 +0 -44
- 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
|
@@ -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
|
|
@@ -12,7 +12,7 @@ import { SideBarView, ViewItem, ViewSection } from 'monaco-page-objects';
|
|
|
12
12
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
13
13
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
14
14
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
15
|
-
import { CLASSES } from '../../configs/inversify.types';
|
|
15
|
+
import { CLASSES, TYPES } from '../../configs/inversify.types';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
17
17
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
18
18
|
import { expect } from 'chai';
|
|
@@ -21,76 +21,86 @@ import { OcpImportFromGitPage } from '../../pageobjects/openshift/OcpImportFromG
|
|
|
21
21
|
import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor';
|
|
22
22
|
import { StringUtil } from '../../utils/StringUtil';
|
|
23
23
|
import { OcpApplicationPage } from '../../pageobjects/openshift/OcpApplicationPage';
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
24
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
25
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
26
|
+
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
27
|
+
|
|
28
|
+
suite('DevConsole Integration', function (): void {
|
|
29
|
+
let ocpImportPage: OcpImportFromGitPage;
|
|
30
|
+
let ocpApplicationPage: OcpApplicationPage;
|
|
31
|
+
|
|
32
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
33
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
34
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
35
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
36
|
+
const ocpMainPage: OcpMainPage = e2eContainer.get(CLASSES.OcpMainPage);
|
|
37
|
+
const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUtil);
|
|
38
|
+
const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get(
|
|
39
|
+
CLASSES.KubernetesCommandLineToolsExecutor
|
|
40
|
+
);
|
|
41
|
+
// test specific data
|
|
42
|
+
const gitImportRepo: string = 'https://github.com/crw-qe/summit-lab-spring-music.git';
|
|
43
|
+
const gitImportReference: string = 'pipeline';
|
|
44
|
+
const projectLabel: string = 'app.openshift.io/runtime=spring';
|
|
45
|
+
const projectName: string = 'devconsole-integration-test';
|
|
46
|
+
|
|
47
|
+
suiteSetup('Create new empty project using ocp', function (): void {
|
|
48
|
+
kubernetesCommandLineToolsExecutor.loginToOcp();
|
|
49
|
+
kubernetesCommandLineToolsExecutor.createProject(projectName);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
loginTests.loginIntoOcpConsole();
|
|
53
|
+
|
|
54
|
+
test('Select test project and Developer role on DevConsole', async function (): Promise<void> {
|
|
55
|
+
await ocpMainPage.selectDeveloperRole();
|
|
56
|
+
await ocpMainPage.selectProject(projectName);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test('Open import from git project page', async function (): Promise<void> {
|
|
60
|
+
ocpImportPage = await ocpMainPage.openImportFromGitPage();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('Fill and submit import data', async function (): Promise<void> {
|
|
64
|
+
ocpApplicationPage = await ocpImportPage.fitAndSubmitConfiguration(gitImportRepo, gitImportReference, projectLabel);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('Wait until application creates', async function (): Promise<void> {
|
|
68
|
+
await ocpApplicationPage.waitApplicationIcon();
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('Check if application has worked link "Open Source Code"', async function (): Promise<void> {
|
|
72
|
+
await ocpApplicationPage.waitAndOpenEditSourceCodeIcon();
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
loginTests.loginIntoChe();
|
|
76
|
+
|
|
77
|
+
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
78
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('Registering the running workspace', function (): void {
|
|
82
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('Check if application source code opens in workspace', async function (): Promise<void> {
|
|
86
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('Check if project and files imported', async function (): Promise<void> {
|
|
90
|
+
const applicationSourceProjectName: string = StringUtil.getProjectNameFromGitUrl(gitImportRepo);
|
|
91
|
+
const projectSection: ViewSection = await new SideBarView().getContent().getSection(applicationSourceProjectName);
|
|
92
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME);
|
|
93
|
+
expect(isFileImported).not.eqls(undefined);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('Stop and delete the workspace by API', async function (): Promise<void> {
|
|
97
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
98
|
+
testWorkspaceUtil.stopAndDeleteWorkspaceByName(WorkspaceHandlingTests.getWorkspaceName());
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
loginTests.logoutFromChe();
|
|
102
|
+
|
|
103
|
+
suiteTeardown('Delete project using ocp', function (): void {
|
|
104
|
+
kubernetesCommandLineToolsExecutor.deleteProject(projectName);
|
|
105
|
+
});
|
|
96
106
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/** *******************************************************************
|
|
2
|
+
* copyright (c) 2021 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
|
|
@@ -12,23 +12,22 @@ import 'reflect-metadata';
|
|
|
12
12
|
|
|
13
13
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
ActivityBar,
|
|
16
|
+
ContextMenu,
|
|
17
|
+
EditorView,
|
|
18
|
+
Locators,
|
|
19
|
+
ModalDialog,
|
|
20
|
+
NewScmView,
|
|
21
|
+
SideBarView,
|
|
22
|
+
SingleScmProvider,
|
|
23
|
+
TextEditor,
|
|
24
|
+
ViewControl,
|
|
25
|
+
ViewItem,
|
|
26
|
+
ViewSection
|
|
27
27
|
} from 'monaco-page-objects';
|
|
28
28
|
import { expect } from 'chai';
|
|
29
29
|
import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
|
|
30
30
|
import { StringUtil } from '../../utils/StringUtil';
|
|
31
|
-
import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
|
|
32
31
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
33
32
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
34
33
|
import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
|
|
@@ -37,166 +36,173 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
37
36
|
import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
38
37
|
import { Logger } from '../../utils/Logger';
|
|
39
38
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
39
|
+
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
40
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
41
|
+
import { FACTORY_TEST_CONSTANTS } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
42
|
+
|
|
43
|
+
suite(
|
|
44
|
+
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`,
|
|
45
|
+
function (): void {
|
|
46
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
47
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
48
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
49
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
50
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
51
|
+
const webCheCodeLocators: Locators = e2eContainer.get(CLASSES.CheCodeLocatorLoader);
|
|
52
|
+
const oauthPage: OauthPage = e2eContainer.get(CLASSES.OauthPage);
|
|
53
|
+
|
|
54
|
+
let projectSection: ViewSection;
|
|
55
|
+
let scmProvider: SingleScmProvider;
|
|
56
|
+
let rest: SingleScmProvider[];
|
|
57
|
+
let scmContextMenu: ContextMenu;
|
|
58
|
+
|
|
59
|
+
// test specific data
|
|
60
|
+
const timeToRefresh: number = 1500;
|
|
61
|
+
const changesToCommit: string = new Date().getTime().toString();
|
|
62
|
+
const fileToChange: string = 'Date.txt';
|
|
63
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
64
|
+
const refreshButtonLabel: string = 'Refresh';
|
|
65
|
+
const pushItemLabel: string = 'Push';
|
|
66
|
+
let testRepoProjectName: string;
|
|
67
|
+
|
|
68
|
+
loginTests.loginIntoChe();
|
|
69
|
+
test('Navigate to the factory URL', async function (): Promise<void> {
|
|
70
|
+
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
74
|
+
test(`Authorize with a ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function (): Promise<void> {
|
|
75
|
+
await oauthPage.login();
|
|
76
|
+
await oauthPage.waitOauthPage();
|
|
77
|
+
await oauthPage.confirmAccess();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
82
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
test('Registering the running workspace', function (): void {
|
|
86
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
test('Wait the workspace readiness', async function (): Promise<void> {
|
|
90
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
94
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
95
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
96
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('Check if the project files were imported', async function (): Promise<void> {
|
|
100
|
+
const label: string = BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
101
|
+
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
102
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
103
|
+
expect(isFileImported).not.eqls(undefined);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
107
|
+
const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
|
|
108
|
+
const trustedProjectDialog: ModalDialog = new ModalDialog();
|
|
109
|
+
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button);
|
|
110
|
+
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
111
|
+
await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test('Make changes to the file', async function (): Promise<void> {
|
|
115
|
+
Logger.debug(`projectSection.openItem: "${fileToChange}"`);
|
|
116
|
+
await projectSection.openItem(fileToChange);
|
|
117
|
+
const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor;
|
|
118
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
|
|
119
|
+
Logger.debug('editor.clearText');
|
|
120
|
+
await editor.clearText();
|
|
121
|
+
Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
|
|
122
|
+
await editor.typeTextAt(1, 1, changesToCommit);
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
test('Open a source control manager', async function (): Promise<void> {
|
|
126
|
+
const viewSourceControl: string = 'Source Control';
|
|
127
|
+
const sourceControl: ViewControl = (await new ActivityBar().getViewControl(viewSourceControl)) as ViewControl;
|
|
128
|
+
Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
|
|
129
|
+
await sourceControl.openView();
|
|
130
|
+
const scmView: NewScmView = new NewScmView();
|
|
131
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.inputField);
|
|
132
|
+
[scmProvider, ...rest] = await scmView.getProviders();
|
|
133
|
+
Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('Check if the changes are displayed in the source control manager', async function (): Promise<void> {
|
|
137
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
138
|
+
await driverHelper.wait(timeToRefresh);
|
|
139
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
140
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
141
|
+
// wait while changes counter will be refreshed
|
|
142
|
+
await driverHelper.wait(timeToRefresh);
|
|
143
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
144
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
145
|
+
expect(changes).eql(1);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
test('Stage the changes', async function (): Promise<void> {
|
|
149
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
150
|
+
Logger.debug('scmProvider.openMoreActions');
|
|
151
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
152
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
|
|
153
|
+
Logger.debug('scmContextMenu.select: "Changes" -> "Stage All Changes"');
|
|
154
|
+
await scmContextMenu.select('Changes', 'Stage All Changes');
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
test('Commit the changes', async function (): Promise<void> {
|
|
158
|
+
Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
|
|
159
|
+
await scmProvider.commitChanges('Commit ' + changesToCommit);
|
|
160
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
161
|
+
await driverHelper.wait(timeToRefresh);
|
|
162
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
163
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
164
|
+
// wait while changes counter will be refreshed
|
|
165
|
+
await driverHelper.wait(timeToRefresh);
|
|
166
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
167
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
168
|
+
expect(changes).eql(0);
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('Push the changes', async function (): Promise<void> {
|
|
172
|
+
await driverHelper.waitVisibility(
|
|
173
|
+
webCheCodeLocators.ScmView.actionConstructor(
|
|
174
|
+
`Push 1 commits to origin/${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`
|
|
175
|
+
)
|
|
176
|
+
);
|
|
177
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
178
|
+
Logger.debug('scmProvider.openMoreActions');
|
|
179
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
180
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
|
|
181
|
+
Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
|
|
182
|
+
await scmContextMenu.select(pushItemLabel);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test('Check if the changes were pushed', async function (): Promise<void> {
|
|
186
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
187
|
+
await driverHelper.wait(timeToRefresh);
|
|
188
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
189
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
190
|
+
const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(
|
|
191
|
+
webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel),
|
|
192
|
+
'aria-disabled'
|
|
193
|
+
);
|
|
194
|
+
expect(isCommitButtonDisabled).eql('true');
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
test('Stop the workspace', async function (): Promise<void> {
|
|
198
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
199
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
test('Delete the workspace', async function (): Promise<void> {
|
|
203
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
loginTests.logoutFromChe();
|
|
207
|
+
}
|
|
208
|
+
);
|