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