@eclipse-che/che-e2e 7.73.0 → 7.74.0-dev-1d09cb7
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/configs/inversify.config.ts +6 -6
- package/configs/inversify.types.ts +27 -27
- package/configs/mocharc.ts +21 -21
- package/constants/APITestConstants.ts +39 -38
- package/constants/BaseTestConstants.ts +46 -43
- package/constants/ChromeDriverConstants.ts +29 -29
- package/constants/FactoryTestConstants.ts +30 -30
- package/constants/MonacoConstants.ts +10 -10
- package/constants/OAuthConstants.ts +46 -46
- package/constants/ReporterConstants.ts +28 -28
- package/constants/TimeoutConstants.ts +101 -101
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +1 -1
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/APITestConstants.js +2 -2
- package/dist/constants/APITestConstants.js.map +1 -1
- package/dist/constants/BaseTestConstants.js +2 -1
- package/dist/constants/BaseTestConstants.js.map +1 -1
- package/dist/constants/ChromeDriverConstants.js +1 -1
- package/dist/constants/ChromeDriverConstants.js.map +1 -1
- package/dist/constants/FactoryTestConstants.js +1 -1
- package/dist/constants/FactoryTestConstants.js.map +1 -1
- package/dist/constants/MonacoConstants.js +1 -1
- package/dist/constants/MonacoConstants.js.map +1 -1
- package/dist/constants/OAuthConstants.js +1 -1
- package/dist/constants/OAuthConstants.js.map +1 -1
- package/dist/constants/ReporterConstants.js +1 -1
- package/dist/constants/ReporterConstants.js.map +1 -1
- package/dist/constants/TimeoutConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/pageobjects/dashboard/CreateWorkspace.js +8 -8
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +11 -11
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +14 -14
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +8 -8
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +17 -17
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +1 -1
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js +5 -5
- package/dist/pageobjects/login/kubernetes/DexLoginPage.js.map +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js +1 -1
- package/dist/pageobjects/login/kubernetes/KubernetesLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpLoginPage.js +10 -10
- package/dist/pageobjects/login/openshift/OcpLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/OcpRedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js +1 -1
- package/dist/pageobjects/login/openshift/OcpUserLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js +6 -6
- package/dist/pageobjects/login/openshift/RedHatLoginPage.js.map +1 -1
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js +2 -2
- package/dist/pageobjects/login/openshift/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpApplicationPage.js +2 -2
- package/dist/pageobjects/openshift/OcpApplicationPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js +5 -5
- package/dist/pageobjects/openshift/OcpImportFromGitPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpMainPage.js +11 -11
- package/dist/pageobjects/openshift/OcpMainPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +1 -1
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/SmokeTest.spec.js +7 -3
- package/dist/specs/SmokeTest.spec.js.map +1 -1
- package/dist/specs/api/ContainerOverridesAPI.spec.js.map +1 -1
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js +7 -5
- package/dist/specs/api/DevfileAcceptanceTestAPI.spec.js.map +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js +1 -1
- package/dist/specs/api/EmptyWorkspaceAPI.spec.js.map +1 -1
- package/dist/specs/api/PodOverridesAPI.spec.js +2 -1
- package/dist/specs/api/PodOverridesAPI.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js +9 -5
- package/dist/specs/dashboard-samples/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/Quarkus.spec.js +7 -3
- package/dist/specs/dashboard-samples/Quarkus.spec.js.map +1 -1
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js +6 -2
- package/dist/specs/dashboard-samples/RecommendedExtensions.spec.js.map +1 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js +3 -1
- package/dist/specs/devconsole-intergration/DevConsoleIntegration.spec.js.map +1 -1
- package/dist/specs/factory/Factory.spec.js +3 -1
- package/dist/specs/factory/Factory.spec.js.map +1 -1
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +4 -2
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -1
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +4 -2
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -1
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +6 -2
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -1
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/ProjectAndFileTests.js +3 -3
- package/dist/tests-library/ProjectAndFileTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +54 -74
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +10 -10
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/CheReporter.js.map +1 -1
- package/dist/utils/DevWorkspaceConfigurationHelper.js +2 -2
- package/dist/utils/DevWorkspaceConfigurationHelper.js.map +1 -1
- package/dist/utils/DevfilesRegistryHelper.js +7 -7
- package/dist/utils/DevfilesRegistryHelper.js.map +1 -1
- package/dist/utils/DriverHelper.js +81 -81
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/KubernetesCommandLineToolsExecutor.js +38 -35
- package/dist/utils/KubernetesCommandLineToolsExecutor.js.map +1 -1
- package/dist/utils/Logger.js +45 -21
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/ScreenCatcher.js.map +1 -1
- package/dist/utils/ShellExecutor.js.map +1 -1
- package/dist/utils/StringUtil.js +2 -2
- package/dist/utils/StringUtil.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +13 -11
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js +1 -1
- package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js +3 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +20 -16
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/ChromeDriver.ts +44 -44
- package/driver/IDriver.ts +1 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/CreateWorkspace.ts +52 -52
- package/pageobjects/dashboard/Dashboard.ts +72 -72
- package/pageobjects/dashboard/Workspaces.ts +138 -139
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +92 -93
- package/pageobjects/git-providers/OauthPage.ts +136 -136
- package/pageobjects/ide/CheCodeLocatorLoader.ts +40 -40
- package/pageobjects/login/interfaces/ICheLoginPage.ts +1 -1
- package/pageobjects/login/interfaces/IOcpLoginPage.ts +1 -1
- package/pageobjects/login/kubernetes/DexLoginPage.ts +27 -27
- package/pageobjects/login/kubernetes/KubernetesLoginPage.ts +11 -11
- package/pageobjects/login/openshift/OcpLoginPage.ts +50 -50
- package/pageobjects/login/openshift/OcpRedHatLoginPage.ts +21 -21
- package/pageobjects/login/openshift/OcpUserLoginPage.ts +14 -14
- package/pageobjects/login/openshift/RedHatLoginPage.ts +44 -41
- package/pageobjects/login/openshift/RegularUserOcpCheLoginPage.ts +23 -23
- package/pageobjects/openshift/OcpApplicationPage.ts +16 -16
- package/pageobjects/openshift/OcpImportFromGitPage.ts +54 -54
- package/pageobjects/openshift/OcpMainPage.ts +64 -64
- package/resources/pod-overrides-airgap.yaml +37 -0
- package/specs/MochaHooks.ts +44 -44
- package/specs/SmokeTest.spec.ts +35 -31
- package/specs/api/ContainerOverridesAPI.spec.ts +23 -23
- package/specs/api/DevfileAcceptanceTestAPI.spec.ts +93 -91
- package/specs/api/EmptyWorkspaceAPI.spec.ts +50 -50
- package/specs/api/PodOverridesAPI.spec.ts +30 -29
- package/specs/dashboard-samples/EmptyWorkspace.spec.ts +29 -25
- package/specs/dashboard-samples/Quarkus.spec.ts +31 -27
- package/specs/dashboard-samples/RecommendedExtensions.spec.ts +156 -152
- package/specs/devconsole-intergration/DevConsoleIntegration.spec.ts +62 -64
- package/specs/factory/Factory.spec.ts +149 -147
- package/specs/factory/NoSetupRepoFactory.spec.ts +188 -186
- package/specs/factory/RefusedOAuthFactory.spec.ts +182 -180
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +52 -48
- package/tests-library/LoginTests.ts +29 -29
- package/tests-library/ProjectAndFileTests.ts +13 -13
- package/tests-library/WorkspaceHandlingTests.ts +84 -103
- package/utils/BrowserTabsUtil.ts +69 -69
- package/utils/CheReporter.ts +4 -6
- package/utils/DevWorkspaceConfigurationHelper.ts +58 -58
- package/utils/DevfilesRegistryHelper.ts +51 -51
- package/utils/DriverHelper.ts +599 -600
- package/utils/KubernetesCommandLineToolsExecutor.ts +166 -158
- package/utils/Logger.ts +119 -67
- package/utils/ScreenCatcher.ts +42 -42
- package/utils/ShellExecutor.ts +10 -10
- package/utils/StringUtil.ts +29 -29
- package/utils/request-handlers/CheApiRequestHandler.ts +84 -82
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +18 -18
- package/utils/request-handlers/headers/IAuthorizationHeaderHandler.ts +1 -1
- package/utils/workspace/ApiUrlResolver.ts +23 -23
- package/utils/workspace/ITestWorkspaceUtil.ts +29 -29
- package/utils/workspace/TestWorkspaceUtil.ts +120 -116
- package/utils/workspace/WorkspaceStatus.ts +3 -3
|
@@ -27,7 +27,6 @@ import {
|
|
|
27
27
|
ViewSection
|
|
28
28
|
} from 'monaco-page-objects';
|
|
29
29
|
import { expect } from 'chai';
|
|
30
|
-
import WebDriverError = error.WebDriverError;
|
|
31
30
|
import { registerRunningWorkspace } from '../MochaHooks';
|
|
32
31
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
33
32
|
import { CLASSES } from '../../configs/inversify.types';
|
|
@@ -43,6 +42,7 @@ import { LoginTests } from '../../tests-library/LoginTests';
|
|
|
43
42
|
import { OAuthConstants } from '../../constants/OAuthConstants';
|
|
44
43
|
import { BaseTestConstants } from '../../constants/BaseTestConstants';
|
|
45
44
|
import { FactoryTestConstants, GitProviderType } from '../../constants/FactoryTestConstants';
|
|
45
|
+
import WebDriverError = error.WebDriverError;
|
|
46
46
|
|
|
47
47
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
48
48
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
@@ -51,210 +51,212 @@ const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocato
|
|
|
51
51
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
52
52
|
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
|
|
53
53
|
|
|
54
|
-
suite(`Create a workspace via launching a factory from the ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository and deny the access`, async function
|
|
55
|
-
|
|
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> {
|
|
55
|
+
const oauthPage: OauthPage = new OauthPage(driverHelper);
|
|
56
|
+
|
|
57
|
+
let projectSection: ViewSection;
|
|
58
|
+
let scmProvider: SingleScmProvider;
|
|
59
|
+
let rest: SingleScmProvider[];
|
|
60
|
+
let scmContextMenu: ContextMenu;
|
|
56
61
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
62
|
+
// test specific data
|
|
63
|
+
const timeToRefresh: number = 1500;
|
|
64
|
+
const changesToCommit: string = (new Date()).getTime().toString();
|
|
65
|
+
const fileToChange: string = 'Date.txt';
|
|
66
|
+
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
67
|
+
const refreshButtonLabel: string = 'Refresh';
|
|
68
|
+
const pushItemLabel: string = 'Push';
|
|
69
|
+
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
70
|
+
let testRepoProjectName: string;
|
|
71
|
+
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
61
72
|
|
|
62
|
-
|
|
63
|
-
const timeToRefresh: number = 1500;
|
|
64
|
-
const changesToCommit: string = (new Date()).getTime().toString();
|
|
65
|
-
const fileToChange: string = 'Date.txt';
|
|
66
|
-
const commitChangesButtonLabel: string = `Commit Changes on "${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
|
|
67
|
-
const refreshButtonLabel: string = 'Refresh';
|
|
68
|
-
const pushItemLabel: string = 'Push';
|
|
69
|
-
const label: string = BaseTestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
|
|
70
|
-
let testRepoProjectName: string;
|
|
71
|
-
const isPrivateRepo: string = FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO ? 'private' : 'public';
|
|
73
|
+
loginTests.loginIntoChe();
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
test(`Navigate to the ${isPrivateRepo} repository factory URL`, async function(): Promise<void> {
|
|
76
|
+
await browserTabsUtil.navigateTo(FactoryTestConstants.TS_SELENIUM_FACTORY_URL());
|
|
77
|
+
});
|
|
74
78
|
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
if (OAuthConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
|
|
80
|
+
test(`Authorize with a ${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth and deny access`, async function(): Promise<void> {
|
|
81
|
+
await oauthPage.login();
|
|
82
|
+
await oauthPage.waitOauthPage();
|
|
83
|
+
await oauthPage.denyAccess();
|
|
77
84
|
});
|
|
85
|
+
}
|
|
78
86
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
await oauthPage.waitOauthPage();
|
|
83
|
-
await oauthPage.denyAccess();
|
|
84
|
-
});
|
|
85
|
-
}
|
|
87
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
88
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
89
|
+
});
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
test('The workspace starts with access deny flag in the url', async function(): Promise<void> {
|
|
92
|
+
expect(await driverHelper.getDriver().getCurrentUrl()).contains('&error_code=access_denied');
|
|
93
|
+
});
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
test('Registering the running workspace', async function(): Promise<void> {
|
|
96
|
+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
97
|
+
});
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
test('Wait the workspace readiness', async function(): Promise<void> {
|
|
100
|
+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
|
|
101
|
+
});
|
|
96
102
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
103
|
+
test('Check if a project folder has been created', async function(): Promise<void> {
|
|
104
|
+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
|
|
105
|
+
Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
|
|
106
|
+
projectSection = await new SideBarView().getContent().getSection(testRepoProjectName);
|
|
107
|
+
});
|
|
100
108
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})
|
|
109
|
+
test('Accept the project as a trusted one', async function(): Promise<void> {
|
|
110
|
+
// click somewhere to trigger "Welcome Content" dialog
|
|
111
|
+
try {
|
|
112
|
+
await driverHelper.waitAndClick(webCheCodeLocators.Workbench.notificationItem);
|
|
113
|
+
} catch (e) {
|
|
114
|
+
Logger.info(`Click on ${webCheCodeLocators.Workbench.notificationItem} to get "Welcome Content" dialog ${e as string}`);
|
|
115
|
+
}
|
|
116
|
+
// "Welcome Content" dialog can be shown before of after dialog with an error for private repo
|
|
117
|
+
try {
|
|
118
|
+
const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
|
|
119
|
+
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.text, TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
|
|
120
|
+
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
121
|
+
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
122
|
+
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
123
|
+
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
126
|
+
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
127
|
+
throw new WebDriverError(e as string);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
106
131
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
// "Welcome Content" dialog can be shown before of after dialog with an error for private repo
|
|
115
|
-
try {
|
|
116
|
-
const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
|
|
117
|
-
await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.text, TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
|
|
118
|
-
const welcomeContentDialog: ModalDialog = new ModalDialog();
|
|
119
|
-
Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
|
|
120
|
-
await welcomeContentDialog.pushButton(buttonYesITrustTheAuthors);
|
|
121
|
-
await driverHelper.waitDisappearance(webCheCodeLocators.WelcomeContent.text);
|
|
122
|
-
} catch (e) {
|
|
123
|
-
Logger.info(`"Accept the project as a trusted one" dialog was not shown firstly for "${isPrivateRepo}"`);
|
|
124
|
-
if (!FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
125
|
-
throw new WebDriverError(e as string);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
132
|
+
if (FactoryTestConstants.TS_SELENIUM_IS_PRIVATE_FACTORY_GIT_REPO) {
|
|
133
|
+
test('Check that project can not be cloned', async function(): Promise<void> {
|
|
134
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Dialog.message);
|
|
135
|
+
const workspaceDoesNotExistDialog: ModalDialog = new ModalDialog();
|
|
136
|
+
const message: string = await workspaceDoesNotExistDialog.getMessage();
|
|
137
|
+
expect(message).contains('space does not exist');
|
|
128
138
|
});
|
|
129
139
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const message: string = await workspaceDoesNotExistDialog.getMessage();
|
|
135
|
-
expect(message).contains('space does not exist');
|
|
136
|
-
});
|
|
137
|
-
|
|
138
|
-
test('Check that project files were not imported', async function (): Promise<void> {
|
|
139
|
-
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
140
|
-
expect(isFileImported).eqls(undefined);
|
|
141
|
-
});
|
|
140
|
+
test('Check that project files were not imported', async function(): Promise<void> {
|
|
141
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
142
|
+
expect(isFileImported).eqls(undefined);
|
|
143
|
+
});
|
|
142
144
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
145
|
+
} else {
|
|
146
|
+
test('Check if the project files were imported', async function(): Promise<void> {
|
|
147
|
+
Logger.debug(`projectSection.findItem: find ${label}`);
|
|
148
|
+
const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
|
|
149
|
+
// projectSection.findItem(label) can return undefined but test will goes on
|
|
150
|
+
expect(isFileImported).not.eqls(undefined);
|
|
151
|
+
});
|
|
150
152
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
test('Make changes to the file', async function(): Promise<void> {
|
|
154
|
+
Logger.debug(`projectSection.openItem: "${fileToChange}"`);
|
|
155
|
+
await projectSection.openItem(fileToChange);
|
|
156
|
+
const editor: TextEditor = await new EditorView().openEditor(fileToChange) as TextEditor;
|
|
157
|
+
await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
|
|
158
|
+
Logger.debug(`editor.clearText`);
|
|
159
|
+
await editor.clearText();
|
|
160
|
+
Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
|
|
161
|
+
await editor.typeTextAt(1, 1, changesToCommit);
|
|
162
|
+
});
|
|
161
163
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
test('Open a source control manager', async function(): Promise<void> {
|
|
165
|
+
const viewSourceControl: string = `Source Control`;
|
|
166
|
+
const sourceControl: ViewControl = await new ActivityBar().getViewControl(viewSourceControl) as ViewControl;
|
|
167
|
+
Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
|
|
168
|
+
await sourceControl.openView();
|
|
169
|
+
const scmView: NewScmView = new NewScmView();
|
|
170
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
|
|
171
|
+
[scmProvider, ...rest] = await scmView.getProviders();
|
|
172
|
+
Logger.debug(`scmView.getProviders: "${scmProvider}, ${scmProvider}"`);
|
|
173
|
+
});
|
|
172
174
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
175
|
+
test('Check if the changes are displayed in the source control manager', async function(): Promise<void> {
|
|
176
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
177
|
+
await driverHelper.wait(timeToRefresh);
|
|
178
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
179
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
180
|
+
// wait while changes counter will be refreshed
|
|
181
|
+
await driverHelper.wait(timeToRefresh);
|
|
182
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
183
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
184
|
+
expect(changes).eql(1);
|
|
185
|
+
});
|
|
184
186
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
187
|
+
test('Stage the changes', async function(): Promise<void> {
|
|
188
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
189
|
+
Logger.debug(`scmProvider.openMoreActions`);
|
|
190
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
191
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
|
|
192
|
+
Logger.debug(`scmContextMenu.select: "Changes" -> "Stage All Changes"`);
|
|
193
|
+
await scmContextMenu.select('Changes', 'Stage All Changes');
|
|
194
|
+
});
|
|
193
195
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
196
|
+
test('Commit the changes', async function(): Promise<void> {
|
|
197
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
|
|
198
|
+
Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
|
|
199
|
+
await scmProvider.commitChanges('Commit ' + changesToCommit);
|
|
200
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
201
|
+
await driverHelper.wait(timeToRefresh);
|
|
202
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
203
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
204
|
+
// wait while changes counter will be refreshed
|
|
205
|
+
await driverHelper.wait(timeToRefresh);
|
|
206
|
+
const changes: number = await scmProvider.getChangeCount();
|
|
207
|
+
Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
|
|
208
|
+
expect(changes).eql(0);
|
|
209
|
+
});
|
|
208
210
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
211
|
+
test('Push the changes', async function(): Promise<void> {
|
|
212
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
|
|
213
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
|
|
214
|
+
Logger.debug(`scmProvider.openMoreActions`);
|
|
215
|
+
scmContextMenu = await scmProvider.openMoreActions();
|
|
216
|
+
await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
|
|
217
|
+
Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
|
|
218
|
+
await scmContextMenu.select(pushItemLabel);
|
|
219
|
+
});
|
|
218
220
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
test('Insert git credentials which were asked after push', async function(): Promise<void> {
|
|
222
|
+
try {
|
|
223
|
+
await driverHelper.waitVisibility(webCheCodeLocators.InputBox.message);
|
|
224
|
+
} catch (e) {
|
|
225
|
+
Logger.info(`Workspace did not ask credentials before push - ${e};
|
|
224
226
|
Known issue for github.com - https://issues.redhat.com/browse/CRW-4066, please check if not other git provider. `);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
test('Check if the changes were pushed', async function (): Promise<void> {
|
|
237
|
-
try {
|
|
238
|
-
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
239
|
-
await scmProvider.takeAction(refreshButtonLabel);
|
|
240
|
-
} catch (e) {
|
|
241
|
-
Logger.info('Check you use correct credentials.' +
|
|
242
|
-
'For bitbucket.org ensure you use an app password: https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/;' +
|
|
243
|
-
'For github.com - personal access token instead of password.');
|
|
244
|
-
}
|
|
245
|
-
const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel), 'aria-disabled');
|
|
246
|
-
expect(isCommitButtonDisabled).eql('true');
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
test('Stop the workspace', async function (): Promise<void> {
|
|
251
|
-
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
252
|
-
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
227
|
+
expect(FactoryTestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER).eqls(GitProviderType.GITHUB);
|
|
228
|
+
}
|
|
229
|
+
const input: InputBox = new InputBox();
|
|
230
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_USERNAME);
|
|
231
|
+
await input.confirm();
|
|
232
|
+
await driverHelper.wait(timeToRefresh);
|
|
233
|
+
await input.setText(OAuthConstants.TS_SELENIUM_GIT_PROVIDER_PASSWORD);
|
|
234
|
+
await input.confirm();
|
|
235
|
+
await driverHelper.wait(timeToRefresh);
|
|
253
236
|
});
|
|
254
237
|
|
|
255
|
-
test('
|
|
256
|
-
|
|
238
|
+
test('Check if the changes were pushed', async function(): Promise<void> {
|
|
239
|
+
try {
|
|
240
|
+
Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
|
|
241
|
+
await scmProvider.takeAction(refreshButtonLabel);
|
|
242
|
+
} catch (e) {
|
|
243
|
+
Logger.info('Check you use correct credentials.' +
|
|
244
|
+
'For bitbucket.org ensure you use an app password: https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/;' +
|
|
245
|
+
'For github.com - personal access token instead of password.');
|
|
246
|
+
}
|
|
247
|
+
const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel), 'aria-disabled');
|
|
248
|
+
expect(isCommitButtonDisabled).eql('true');
|
|
257
249
|
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
test('Stop the workspace', async function(): Promise<void> {
|
|
253
|
+
await workspaceHandlingTests.stopWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
254
|
+
await browserTabsUtil.closeAllTabsExceptCurrent();
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
test('Delete the workspace', async function(): Promise<void> {
|
|
258
|
+
await workspaceHandlingTests.removeWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
259
|
+
});
|
|
258
260
|
|
|
259
|
-
|
|
261
|
+
loginTests.logoutFromChe();
|
|
260
262
|
});
|
|
@@ -13,62 +13,66 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
|
|
|
13
13
|
const predefinedNamespaceName: string = 'predefined-ns';
|
|
14
14
|
|
|
15
15
|
async function runShellScript(shellCommandToExecution: string): Promise<string> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
const { stdout, stderr } = await exec(shellCommandToExecution);
|
|
17
|
+
console.log(stdout);
|
|
18
|
+
console.error(stderr);
|
|
19
|
+
return stdout;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
suite(`Create predefined workspace and check it `, async function
|
|
23
|
-
|
|
22
|
+
suite(`Create predefined workspace and check it `, async function(): Promise<void> {
|
|
23
|
+
let workspaceName: string = '';
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
25
|
+
const setEditRightsForUser: string = `oc adm policy add-role-to-user edit user -n ${predefinedNamespaceName}`;
|
|
26
|
+
const getDevWorkspaceFromPredefinedNameSpace: string = `oc get dw -n ${predefinedNamespaceName}`;
|
|
27
|
+
const deletePredefinedNamespace: string = `oc delete project ${predefinedNamespaceName}`;
|
|
28
|
+
const createPredefinedProjectCommand: string = 'cat <<EOF | oc apply -f - \n' +
|
|
29
|
+
'kind: Namespace\n' +
|
|
30
|
+
'apiVersion: v1\n' +
|
|
31
|
+
'metadata:\n' +
|
|
32
|
+
` name: ${predefinedNamespaceName}\n` +
|
|
33
|
+
' labels:\n' +
|
|
34
|
+
' app.kubernetes.io/part-of: che.eclipse.org\n' +
|
|
35
|
+
' app.kubernetes.io/component: workspaces-namespace\n' +
|
|
36
|
+
' annotations:\n' +
|
|
37
|
+
' che.eclipse.org/username: user\n' +
|
|
38
|
+
'EOF';
|
|
39
|
+
// create a predefined namespace for user using shell script and login into user dashboard
|
|
40
|
+
suiteSetup(async function(): Promise<void> {
|
|
41
|
+
Logger.info('Test prerequisites:');
|
|
42
|
+
Logger.info(' (1) there is OCP user with username and user password that have been set in the TS_SELENIUM_OCP_USERNAME and TS_SELENIUM_OCP_PASSWORD variables');
|
|
43
|
+
Logger.info(' (2) \'oc\' client installed and logged into test OCP cluster with admin rights.');
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
await runShellScript(createPredefinedProjectCommand);
|
|
46
|
+
await runShellScript(setEditRightsForUser);
|
|
47
|
+
});
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
suiteTeardown(async (): Promise<void> => {
|
|
50
|
+
const workspaceName: string = WorkspaceHandlingTests.getWorkspaceName();
|
|
51
|
+
try {
|
|
52
|
+
await runShellScript(deletePredefinedNamespace);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
Logger.error(`Cannot remove the predefined project: ${workspaceName}, please fix it manually: ${e}`);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
workspaceHandlingTests.
|
|
58
|
+
loginTests.loginIntoChe();
|
|
59
|
+
// create the Empty workspace using CHE Dashboard
|
|
60
|
+
test(`Create and open new workspace, stack:${'Empty Workspace'}`, async function(): Promise<void> {
|
|
61
|
+
await workspaceHandlingTests.createAndOpenWorkspace('Empty Workspace');
|
|
62
|
+
});
|
|
63
|
+
test('Obtain workspace name from workspace loader page', async function(): Promise<void> {
|
|
64
|
+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
65
|
+
});
|
|
62
66
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
// verify that just created workspace with unique name is present in the predefined namespace
|
|
68
|
+
test('Validate the created workspace is present in predefined namespace', async function(): Promise<void> {
|
|
69
|
+
workspaceName = WorkspaceHandlingTests.getWorkspaceName();
|
|
70
|
+
registerRunningWorkspace(workspaceName);
|
|
71
|
+
const ocDevWorkspaceOutput: string = await runShellScript(getDevWorkspaceFromPredefinedNameSpace);
|
|
72
|
+
await assert.isTrue(ocDevWorkspaceOutput.includes(workspaceName));
|
|
73
|
+
});
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
loginTests.logoutFromChe();
|
|
72
76
|
});
|
|
73
77
|
|
|
74
78
|
|
|
@@ -18,36 +18,36 @@ import { BaseTestConstants } from '../constants/BaseTestConstants';
|
|
|
18
18
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class LoginTests {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
constructor(
|
|
22
|
+
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
23
|
+
@inject(TYPES.CheLogin) private readonly productLoginPage: ICheLoginPage,
|
|
24
|
+
@inject(TYPES.OcpLogin) private readonly ocpLoginPage: IOcpLoginPage,
|
|
25
|
+
@inject(CLASSES.Dashboard) private readonly dashboard: Dashboard) {
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
loginIntoChe(): void {
|
|
29
|
+
test('Login', async () => {
|
|
30
|
+
if (!(await this.browserTabsUtil.getCurrentUrl()).includes(BaseTestConstants.TS_SELENIUM_BASE_URL)) {
|
|
31
|
+
await this.browserTabsUtil.navigateTo(BaseTestConstants.TS_SELENIUM_BASE_URL);
|
|
32
|
+
}
|
|
33
|
+
await this.productLoginPage.login();
|
|
34
|
+
await this.browserTabsUtil.maximize();
|
|
35
|
+
await this.dashboard.waitStartingPageLoaderDisappearance();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
loginIntoOcpConsole(): void {
|
|
40
|
+
test('Login into ocp console', async () => {
|
|
41
|
+
const openshiftConsoleUrl: string = BaseTestConstants.TS_SELENIUM_BASE_URL.replace('devspaces', 'console-openshift-console');
|
|
42
|
+
await this.browserTabsUtil.navigateTo(openshiftConsoleUrl);
|
|
43
|
+
await this.ocpLoginPage.login();
|
|
44
|
+
await this.browserTabsUtil.maximize();
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
logoutFromChe(): void {
|
|
49
|
+
test('Logout', async () => {
|
|
50
|
+
await this.dashboard.logout();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
53
|
}
|
|
@@ -19,19 +19,19 @@ import { TimeoutConstants } from '../constants/TimeoutConstants';
|
|
|
19
19
|
@injectable()
|
|
20
20
|
export class ProjectAndFileTests {
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
constructor(
|
|
23
|
+
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
25
|
+
async waitWorkspaceReadinessForCheCodeEditor(): Promise<void> {
|
|
26
|
+
Logger.debug(`waiting for editor.`);
|
|
27
|
+
try {
|
|
28
|
+
const start: number = new Date().getTime();
|
|
29
|
+
await this.driverHelper.getDriver().wait(until.elementLocated(By.className('monaco-workbench')), TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
|
|
30
|
+
const end: number = new Date().getTime();
|
|
31
|
+
Logger.debug(`editor was opened in ${end - start} seconds.`);
|
|
32
|
+
} catch (err) {
|
|
33
|
+
Logger.error(`waiting for workspace readiness failed: ${err}`);
|
|
34
|
+
throw err;
|
|
36
35
|
}
|
|
36
|
+
}
|
|
37
37
|
}
|