@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) 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
|
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
import 'reflect-metadata';
|
|
12
12
|
import { e2eContainer } from '../../configs/inversify.config';
|
|
13
13
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
ActivityBar,
|
|
15
|
+
ContextMenu,
|
|
16
|
+
EditorView,
|
|
17
|
+
error,
|
|
18
|
+
InputBox,
|
|
19
|
+
Locators,
|
|
20
|
+
ModalDialog,
|
|
21
|
+
NewScmView,
|
|
22
|
+
SideBarView,
|
|
23
|
+
SingleScmProvider,
|
|
24
|
+
TextEditor,
|
|
25
|
+
ViewControl,
|
|
26
|
+
ViewItem,
|
|
27
|
+
ViewSection
|
|
28
28
|
} from 'monaco-page-objects';
|
|
29
29
|
import { expect } from 'chai';
|
|
30
30
|
import { StringUtil } from '../../utils/StringUtil';
|
|
@@ -37,236 +37,250 @@ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
|
|
|
37
37
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
38
38
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
39
39
|
import { Workspaces } from '../../pageobjects/dashboard/Workspaces';
|
|
40
|
-
import {
|
|
40
|
+
import { TIMEOUT_CONSTANTS } from '../../constants/TIMEOUT_CONSTANTS';
|
|
41
41
|
import { Logger } from '../../utils/Logger';
|
|
42
42
|
import { LoginTests } from '../../tests-library/LoginTests';
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
43
|
+
import { FACTORY_TEST_CONSTANTS, GitProviderType } from '../../constants/FACTORY_TEST_CONSTANTS';
|
|
44
|
+
import { OAUTH_CONSTANTS } from '../../constants/OAUTH_CONSTANTS';
|
|
45
|
+
import { BASE_TEST_CONSTANTS } from '../../constants/BASE_TEST_CONSTANTS';
|
|
46
46
|
import WebDriverError = error.WebDriverError;
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
48
|
+
suite(
|
|
49
|
+
`Create a workspace via launching a factory from the ${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository without OAuth setup`,
|
|
50
|
+
function (): void {
|
|
51
|
+
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
52
|
+
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
53
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
54
|
+
const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
|
|
55
|
+
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
56
|
+
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
57
|
+
const workspaces: Workspaces = e2eContainer.get(CLASSES.Workspaces);
|
|
58
|
+
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
56
59
|
|
|
57
|
-
|
|
60
|
+
let projectSection: ViewSection;
|
|
61
|
+
let scmProvider: SingleScmProvider;
|
|
62
|
+
let scmContextMenu: ContextMenu;
|
|
58
63
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
64
|
+
// test specific data
|
|
65
|
+
let numberOfCreatedWorkspaces: number = 0;
|
|
66
|
+
const timeToRefresh: number = 1500;
|
|
67
|
+
const changesToCommit: string = new Date().getTime().toString();
|
|
68
|
+
const fileToChange: string = 'Date.txt';
|
|
69
|
+
const pushItemLabel: string = 'Push';
|
|
70
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
71
|
+
const refreshButtonLabel: string = 'Refresh';
|
|
72
|
+
const label: string = BASE_TEST_CONSTANTS.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
73
|
+
let testRepoProjectName: string;
|
|
74
|
+
const isPrivateRepo: string = FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
let numberOfCreatedWorkspaces: number = 0;
|
|
66
|
-
const timeToRefresh: number = 1500;
|
|
67
|
-
const changesToCommit: string = (new Date()).getTime().toString();
|
|
68
|
-
const fileToChange: string = 'Date.txt';
|
|
69
|
-
const pushItemLabel: string = 'Push';
|
|
70
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
71
|
-
const refreshButtonLabel: string = 'Refresh';
|
|
72
|
-
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
73
|
-
let testRepoProjectName: string;
|
|
74
|
-
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
76
|
+
loginTests.loginIntoChe();
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
test('Get number of previously created workspaces', async function (): Promise<void> {
|
|
79
|
+
await dashboard.clickWorkspacesButton();
|
|
80
|
+
await workspaces.waitPage();
|
|
81
|
+
numberOfCreatedWorkspaces = (await workspaces.getAllCreatedWorkspacesNames()).length;
|
|
82
|
+
});
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
numberOfCreatedWorkspaces = (await workspaces.getAllCreatedWorkspacesNames()).length;
|
|
82
|
-
});
|
|
84
|
+
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function (): Promise<void> {
|
|
85
|
+
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
|
|
86
|
+
});
|
|
83
87
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
89
|
+
test(`Check that workspace cannot be created without OAuth for ${isPrivateRepo} repo`, async function (): Promise<void> {
|
|
90
|
+
await dashboard.waitLoader();
|
|
91
|
+
const loaderAlert: string = await dashboard.getLoaderAlert();
|
|
92
|
+
expect(loaderAlert).contains.oneOf([
|
|
93
|
+
'Cause: Unsupported OAuth provider',
|
|
94
|
+
'Cause: No PersonalAccessTokenFetcher configured'
|
|
95
|
+
]);
|
|
96
|
+
});
|
|
87
97
|
|
|
88
|
-
|
|
98
|
+
test('Check that workspace was not created', async function (): Promise<void> {
|
|
99
|
+
await dashboard.openDashboard();
|
|
100
|
+
await dashboard.clickWorkspacesButton();
|
|
101
|
+
await workspaces.waitPage();
|
|
102
|
+
const allCreatedWorkspacesNames: string[] = await workspaces.getAllCreatedWorkspacesNames();
|
|
103
|
+
expect(allCreatedWorkspacesNames).has.length(numberOfCreatedWorkspaces);
|
|
104
|
+
});
|
|
89
105
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
106
|
+
loginTests.logoutFromChe();
|
|
107
|
+
} else {
|
|
108
|
+
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
|
|
109
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
110
|
+
});
|
|
95
111
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
await workspaces.waitPage();
|
|
100
|
-
const allCreatedWorkspacesNames: string[] = await workspaces.getAllCreatedWorkspacesNames();
|
|
101
|
-
expect(allCreatedWorkspacesNames).has.length(numberOfCreatedWorkspaces);
|
|
102
|
-
});
|
|
112
|
+
test('Registering the running workspace', function (): void {
|
|
113
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
114
|
+
});
|
|
103
115
|
|
|
104
|
-
|
|
116
|
+
test('Wait the workspace readiness', async function (): Promise<void> {
|
|
117
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
118
|
+
});
|
|
105
119
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
120
|
+
test('Check if a project folder has been created', async function (): Promise<void> {
|
|
121
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
122
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
123
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
124
|
+
});
|
|
110
125
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
126
|
+
test('Accept the project as a trusted one', async function (): Promise<void> {
|
|
127
|
+
// click somewhere to trigger "Welcome Content" dialog
|
|
128
|
+
try {
|
|
129
|
+
await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
|
|
130
|
+
} catch (e) {
|
|
131
|
+
Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
|
|
132
|
+
}
|
|
133
|
+
// "Welcome Content" dialog can be shown before of after dialog with an error for private repo
|
|
134
|
+
try {
|
|
135
|
+
const buttonYesITrustTheAuthors: string = 'Yes, I trust the authors';
|
|
136
|
+
await driverHelper.waitVisibility(
|
|
137
|
+
webCheCodeLocators.WelcomeContent.text,
|
|
138
|
+
TIMEOUT_CONSTANTS.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM
|
|
139
|
+
);
|
|
140
|
+
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
141
|
+
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
142
|
+
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
143
|
+
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
144
|
+
} catch (e) {
|
|
145
|
+
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
146
|
+
if (!FACTORY_TEST_CONSTANTS.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
147
|
+
throw new WebDriverError(e as string);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
114
151
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
152
|
+
test('Check if the project files were imported', async function (): Promise<void> {
|
|
153
|
+
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
154
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
155
|
+
// projectSection.findItem(label) can return undefined but test will goes on
|
|
156
|
+
expect(isFileImported).not.eqls(undefined);
|
|
157
|
+
});
|
|
118
158
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
159
|
+
test('Make changes to the file', async function (): Promise<void> {
|
|
160
|
+
Logger.debug(`projectSection.openItem: "${fileToChange}"`);
|
|
161
|
+
await projectSection.openItem(fileToChange);
|
|
162
|
+
const editor: TextEditor = (await new EditorView().openEditor(fileToChange)) as TextEditor;
|
|
163
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
|
|
164
|
+
Logger.debug('editor.clearText');
|
|
165
|
+
await editor.clearText();
|
|
166
|
+
Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
|
|
167
|
+
await editor.typeTextAt(1, 1, changesToCommit);
|
|
168
|
+
});
|
|
124
169
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
137
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
138
|
-
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
139
|
-
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
140
|
-
} catch (e) {
|
|
141
|
-
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
142
|
-
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
143
|
-
throw new WebDriverError(e as string);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
});
|
|
170
|
+
test('Open a source control manager', async function (): Promise<void> {
|
|
171
|
+
const viewSourceControl: string = 'Source Control';
|
|
172
|
+
const sourceControl: ViewControl = (await new ActivityBar().getViewControl(viewSourceControl)) as ViewControl;
|
|
173
|
+
Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
|
|
174
|
+
await sourceControl.openView();
|
|
175
|
+
const scmView: NewScmView = new NewScmView();
|
|
176
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.inputField);
|
|
177
|
+
let rest: SingleScmProvider[];
|
|
178
|
+
[scmProvider, ...rest] = await scmView.getProviders();
|
|
179
|
+
Logger.debug(`scmView.getProviders: "${JSON.stringify(scmProvider)}, ${rest}"`);
|
|
180
|
+
});
|
|
147
181
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
182
|
+
test('Check if the changes are displayed in the source control manager', async function (): Promise<void> {
|
|
183
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
184
|
+
await driverHelper.wait(timeToRefresh);
|
|
185
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
186
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
187
|
+
// wait while changes counter will be refreshed
|
|
188
|
+
await driverHelper.wait(timeToRefresh);
|
|
189
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
190
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
191
|
+
expect(changes).eql(1);
|
|
192
|
+
});
|
|
154
193
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
await editor.typeTextAt(1, 1, changesToCommit);
|
|
164
|
-
});
|
|
194
|
+
test('Stage the changes', async function (): Promise<void> {
|
|
195
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
196
|
+
Logger.debug('scmProvider.openMoreActions');
|
|
197
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
198
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
|
|
199
|
+
Logger.debug('scmContextMenu.select: "Changes" -> "Stage All Changes"');
|
|
200
|
+
await scmContextMenu.select('Changes', 'Stage All Changes');
|
|
201
|
+
});
|
|
165
202
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
203
|
+
test('Commit the changes', async function (): Promise<void> {
|
|
204
|
+
Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
|
|
205
|
+
await scmProvider.commitChanges('Commit ' + changesToCommit);
|
|
206
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
207
|
+
await driverHelper.wait(timeToRefresh);
|
|
208
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
209
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
210
|
+
// wait while changes counter will be refreshed
|
|
211
|
+
await driverHelper.wait(timeToRefresh);
|
|
212
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
213
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
214
|
+
expect(changes).eql(0);
|
|
215
|
+
});
|
|
176
216
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
217
|
+
test('Push the changes', async function (): Promise<void> {
|
|
218
|
+
await driverHelper.waitVisibility(
|
|
219
|
+
webCheCodeLocators.ScmView.actionConstructor(
|
|
220
|
+
`Push 1 commits to origin/${FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`
|
|
221
|
+
)
|
|
222
|
+
);
|
|
223
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
224
|
+
Logger.debug('scmProvider.openMoreActions');
|
|
225
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
226
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
|
|
227
|
+
Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
|
|
228
|
+
await scmContextMenu.select(pushItemLabel);
|
|
229
|
+
});
|
|
188
230
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
});
|
|
231
|
+
if (FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITHUB) {
|
|
232
|
+
test('Decline GitHub Extension', async function (): Promise<void> {
|
|
233
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.details);
|
|
234
|
+
const gitHaExtensionDialog: ModalDialog = new ModalDialog();
|
|
235
|
+
await gitHaExtensionDialog.pushButton('Cancel');
|
|
236
|
+
});
|
|
237
|
+
}
|
|
197
238
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
await driverHelper.wait(timeToRefresh);
|
|
204
|
-
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
205
|
-
await scmProvider.takeAction(refreshButtonLabel);
|
|
206
|
-
// wait while changes counter will be refreshed
|
|
207
|
-
await driverHelper.wait(timeToRefresh);
|
|
208
|
-
const changes: number = await scmProvider.getChangeCount();
|
|
209
|
-
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
210
|
-
expect(changes).eql(0);
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
test('Push the changes', async function(): Promise<void> {
|
|
214
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
215
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
216
|
-
Logger.debug(`scmProvider.openMoreActions`);
|
|
217
|
-
scmContextMenu = await scmProvider.openMoreActions();
|
|
218
|
-
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
|
|
219
|
-
Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
|
|
220
|
-
await scmContextMenu.select(pushItemLabel);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
if (FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER === GitProviderType.GITHUB) {
|
|
224
|
-
test('Decline GitHub Extension', async function(): Promise<void> {
|
|
225
|
-
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.details);
|
|
226
|
-
const gitHaExtensionDialog: ModalDialog = new ModalDialog();
|
|
227
|
-
await gitHaExtensionDialog.pushButton('Cancel');
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
test('Insert git credentials which were asked after push', async function(): Promise<void> {
|
|
232
|
-
try {
|
|
233
|
-
await driverHelper.waitVisibility(webCheCodeLocators.InputBox.message);
|
|
234
|
-
} catch (e) {
|
|
235
|
-
Logger.info(`Workspace did not ask credentials before push - ${e};
|
|
239
|
+
test('Insert git credentials which were asked after push', async function (): Promise<void> {
|
|
240
|
+
try {
|
|
241
|
+
await driverHelper.waitVisibility(webCheCodeLocators.InputBox.message);
|
|
242
|
+
} catch (e) {
|
|
243
|
+
Logger.info(`Workspace did not ask credentials before push - ${e};
|
|
236
244
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066, please check if not other git provider. `);
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
expect(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_PROVIDER).eqls(GitProviderType.GITHUB);
|
|
246
|
+
}
|
|
247
|
+
const input: InputBox = new InputBox();
|
|
248
|
+
await input.setText(OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
249
|
+
await input.confirm();
|
|
250
|
+
await driverHelper.wait(timeToRefresh);
|
|
251
|
+
await input.setText(OAUTH_CONSTANTS.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
252
|
+
await input.confirm();
|
|
253
|
+
await driverHelper.wait(timeToRefresh);
|
|
254
|
+
});
|
|
247
255
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
256
|
+
test('Check if the changes were pushed', async function (): Promise<void> {
|
|
257
|
+
try {
|
|
258
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
259
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
260
|
+
} catch (e) {
|
|
261
|
+
Logger.info(
|
|
262
|
+
'Check you use correct credentials.' +
|
|
263
|
+
'For bitbucket.org ensure you use an app password: https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/;' +
|
|
264
|
+
'For github.com - personal access token instead of password.'
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(
|
|
268
|
+
webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel),
|
|
269
|
+
'aria-disabled'
|
|
270
|
+
);
|
|
271
|
+
expect(isCommitButtonDisabled).eql('true');
|
|
272
|
+
});
|
|
260
273
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
274
|
+
test('Stop the workspace', async function (): Promise<void> {
|
|
275
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
276
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
277
|
+
});
|
|
265
278
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
279
|
+
test('Delete the workspace', async function (): Promise<void> {
|
|
280
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
281
|
+
});
|
|
269
282
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
283
|
+
loginTests.logoutFromChe();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
);
|