@eclipse-che/che-e2e 7.63.0 → 7.64.0-dev-db63138
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -37
- package/build/dockerfiles/entrypoint.sh +1 -1
- package/configs/inversify.config.ts +11 -26
- package/configs/inversify.types.ts +3 -33
- package/configs/mocharc.ts +9 -3
- package/configs/sh-scripts/initDefaultValues.sh +0 -5
- package/constants/TestConstants.ts +34 -96
- package/dist/configs/inversify.config.js +8 -23
- package/dist/configs/inversify.config.js.map +1 -1
- package/dist/configs/inversify.types.js +3 -33
- package/dist/configs/inversify.types.js.map +1 -1
- package/dist/configs/mocharc.js +11 -4
- package/dist/configs/mocharc.js.map +1 -1
- package/dist/constants/TestConstants.js +31 -86
- package/dist/constants/TestConstants.js.map +1 -1
- package/dist/driver/ChromeDriver.js +1 -1
- package/dist/driver/ChromeDriver.js.map +1 -1
- package/dist/index.js +63 -0
- package/dist/index.js.map +1 -0
- package/dist/pageobjects/dashboard/CreateWorkspace.js +3 -11
- package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +16 -1
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/Workspaces.js +1 -3
- package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
- package/dist/pageobjects/git-providers/OauthPage.js +150 -0
- package/dist/pageobjects/git-providers/OauthPage.js.map +1 -0
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js +65 -0
- package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -0
- package/dist/pageobjects/login/OcpRedHatLoginPage.js +67 -0
- package/dist/pageobjects/login/OcpRedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/RedHatLoginPage.js +78 -0
- package/dist/pageobjects/login/RedHatLoginPage.js.map +1 -0
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js +3 -21
- package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/CheLoginPage.js +0 -33
- package/dist/pageobjects/openshift/CheLoginPage.js.map +1 -1
- package/dist/pageobjects/openshift/OcpLoginPage.js +0 -14
- package/dist/pageobjects/openshift/OcpLoginPage.js.map +1 -1
- package/dist/specs/MochaHooks.js +2 -2
- package/dist/specs/MochaHooks.js.map +1 -1
- package/dist/specs/devfiles/EmptyWorkspace.spec.js +1 -0
- package/dist/specs/devfiles/EmptyWorkspace.spec.js.map +1 -1
- package/dist/specs/devfiles/Quarkus.spec.js +50 -0
- package/dist/specs/devfiles/Quarkus.spec.js.map +1 -0
- package/dist/specs/factory/Factory.spec.js +160 -0
- package/dist/specs/factory/Factory.spec.js.map +1 -0
- package/dist/specs/factory/NoSetupRepoFactory.spec.js +228 -0
- package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -0
- package/dist/specs/factory/RefusedOAuthFactory.spec.js +220 -0
- package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -0
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +66 -0
- package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -0
- package/dist/tests-library/LoginTests.js +10 -2
- package/dist/tests-library/LoginTests.js.map +1 -1
- package/dist/tests-library/WorkspaceHandlingTests.js +3 -6
- package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/BrowserTabsUtil.js +2 -21
- package/dist/utils/BrowserTabsUtil.js.map +1 -1
- package/dist/utils/DriverHelper.js +11 -73
- package/dist/utils/DriverHelper.js.map +1 -1
- package/dist/utils/Logger.js +5 -0
- package/dist/utils/Logger.js.map +1 -1
- package/dist/utils/Sanitizer.js.map +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js +1 -1
- package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/vsc/GitUtil.js +41 -0
- package/dist/utils/vsc/GitUtil.js.map +1 -0
- package/dist/utils/workspace/ApiUrlResolver.js +0 -3
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
- package/dist/utils/workspace/TestWorkspaceUtil.js +2 -192
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +1 -1
- package/index.ts +37 -0
- package/package.json +9 -5
- package/pageobjects/dashboard/CreateWorkspace.ts +4 -15
- package/pageobjects/dashboard/Dashboard.ts +29 -4
- package/pageobjects/dashboard/Workspaces.ts +1 -3
- package/pageobjects/git-providers/OauthPage.ts +156 -0
- package/pageobjects/ide/CheCodeLocatorLoader.ts +69 -0
- package/pageobjects/login/OcpRedHatLoginPage.ts +49 -0
- package/pageobjects/login/RedHatLoginPage.ts +62 -0
- package/pageobjects/login/RegularUserOcpCheLoginPage.ts +1 -20
- package/pageobjects/openshift/CheLoginPage.ts +6 -55
- package/pageobjects/openshift/OcpLoginPage.ts +0 -21
- package/specs/MochaHooks.ts +2 -2
- package/specs/devfiles/EmptyWorkspace.spec.ts +1 -0
- package/specs/devfiles/Quarkus.spec.ts +52 -0
- package/specs/factory/Factory.spec.ts +199 -0
- package/specs/factory/NoSetupRepoFactory.spec.ts +272 -0
- package/specs/factory/RefusedOAuthFactory.spec.ts +260 -0
- package/specs/miscellaneous/PredefinedNamespace.spec.ts +74 -0
- package/tests-library/LoginTests.ts +9 -1
- package/tests-library/WorkspaceHandlingTests.ts +3 -7
- package/utils/BrowserTabsUtil.ts +2 -24
- package/utils/DriverHelper.ts +9 -84
- package/utils/Logger.ts +5 -0
- package/utils/Sanitizer.ts +0 -1
- package/utils/request-handlers/CheApiRequestHandler.ts +1 -1
- package/utils/vsc/GitUtil.ts +28 -0
- package/utils/workspace/ApiUrlResolver.ts +0 -4
- package/utils/workspace/ITestWorkspaceUtil.ts +1 -56
- package/utils/workspace/TestWorkspaceUtil.ts +2 -243
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js +0 -97
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +0 -1
- package/dist/pageobjects/login/MultiUserLoginPage.js +0 -49
- package/dist/pageobjects/login/MultiUserLoginPage.js.map +0 -1
- package/dist/pageobjects/login/UpdateAccountInformationPage.js +0 -74
- package/dist/pageobjects/login/UpdateAccountInformationPage.js.map +0 -1
- package/dist/pageobjects/third-parties/GitLoginPage.js +0 -85
- package/dist/pageobjects/third-parties/GitLoginPage.js.map +0 -1
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.js +0 -110
- package/dist/pageobjects/third-parties/GitOauthAppsSettings.js.map +0 -1
- package/dist/specs/login/LinkCheAndOcpUsers.spec.js +0 -40
- package/dist/specs/login/LinkCheAndOcpUsers.spec.js.map +0 -1
- package/dist/utils/WorkspaceNameHandler.js +0 -60
- package/dist/utils/WorkspaceNameHandler.js.map +0 -1
- package/dist/utils/request-handlers/tokens/CheMultiuserTokenHandler.js +0 -50
- package/dist/utils/request-handlers/tokens/CheMultiuserTokenHandler.js.map +0 -1
- package/dist/utils/request-handlers/tokens/ITokenHandler.js +0 -12
- package/dist/utils/request-handlers/tokens/ITokenHandler.js.map +0 -1
- package/dist/utils/vsc/CheGitApi.js +0 -42
- package/dist/utils/vsc/CheGitApi.js.map +0 -1
- package/dist/utils/vsc/github/GitHubUtil.js +0 -126
- package/dist/utils/vsc/github/GitHubUtil.js.map +0 -1
- package/files/devfiles/plugins/GitHubPullRequestPlugin.yaml +0 -11
- package/files/devfiles/plugins/InstallPluginUsingUI.yaml +0 -3
- package/files/devfiles/plugins/Java11PluginTest.yaml +0 -17
- package/files/devfiles/plugins/PhpPluginTest.yaml +0 -47
- package/files/devfiles/plugins/PythonPluginTest.yaml +0 -14
- package/files/devfiles/plugins/TypescriptNodeDebug2PluginTest.yaml +0 -49
- package/files/devfiles/plugins/VscodeKubernetesPlugin.yaml +0 -12
- package/files/devfiles/plugins/VscodeShellcheckPlugin.yaml +0 -12
- package/files/devfiles/plugins/VscodeValePlugin.yaml +0 -42
- package/files/devfiles/plugins/VscodeXmlPlugin.yaml +0 -12
- package/files/devfiles/plugins/VscodeYamlPlugin.yaml +0 -12
- package/files/happy-path/containers-happy-path.yaml +0 -127
- package/files/happy-path/happy-path-workspace.yaml +0 -95
- package/files/happy-path/petclinic-classpath.txt +0 -49
- package/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts +0 -95
- package/pageobjects/login/MultiUserLoginPage.ts +0 -33
- package/pageobjects/login/UpdateAccountInformationPage.ts +0 -70
- package/pageobjects/third-parties/GitLoginPage.ts +0 -81
- package/pageobjects/third-parties/GitOauthAppsSettings.ts +0 -110
- package/specs/login/LinkCheAndOcpUsers.spec.ts +0 -49
- package/utils/WorkspaceNameHandler.ts +0 -48
- package/utils/request-handlers/tokens/CheMultiuserTokenHandler.ts +0 -41
- package/utils/request-handlers/tokens/ITokenHandler.ts +0 -14
- package/utils/vsc/CheGitApi.ts +0 -22
- package/utils/vsc/github/GitHubUtil.ts +0 -110
|
@@ -21,7 +21,7 @@ export class CheApiRequestHandler {
|
|
|
21
21
|
/**
|
|
22
22
|
* This method adds a request interceptor into axios request interceptors list and returns an ID of the interceptor
|
|
23
23
|
*/
|
|
24
|
-
public static
|
|
24
|
+
public static enableRequestInterceptor(): number {
|
|
25
25
|
Logger.debug(`CheApiRequestHandler.enableRequestInterceptor`);
|
|
26
26
|
return axios.interceptors.request.use( request => {
|
|
27
27
|
try {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
|
|
11
|
+
import { injectable } from 'inversify';
|
|
12
|
+
|
|
13
|
+
@injectable()
|
|
14
|
+
export class GitUtil {
|
|
15
|
+
|
|
16
|
+
constructor() { }
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Method extracts a test repo name from git clone https url;
|
|
20
|
+
* it splits the url into string[] by "/" or ".", deletes empty elements and elements that contains just "git" word, than returns the last one;
|
|
21
|
+
* please, avoid to call the test repo as just "git" or to use dots in the name, like: github.com/user/git.git, github.com/user/name.with.dots.
|
|
22
|
+
* @param url git https url (which using for "git clone")
|
|
23
|
+
* @return project name
|
|
24
|
+
*/
|
|
25
|
+
getProjectNameFromGitUrl(url: string) {
|
|
26
|
+
return url.split(/[\/.]/).filter((e: string) => e !== '' && e !== 'git').reverse()[0];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -30,10 +30,6 @@ export class ApiUrlResolver {
|
|
|
30
30
|
return `${ApiUrlResolver.DASHBOARD_API_URL}/${namespace}/devworkspaces`;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
public getKubernetesApiUrl(): string {
|
|
34
|
-
return ApiUrlResolver.KUBERNETES_API_URL;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
33
|
private async obtainUserNamespace(): Promise<string> {
|
|
38
34
|
Logger.debug(`ApiUrlResolver.obtainUserNamespace ${this.userNamespace}`);
|
|
39
35
|
if (this.userNamespace.length === 0) {
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
|
|
11
11
|
import { WorkspaceStatus } from './WorkspaceStatus';
|
|
12
|
-
import { che } from '@eclipse-che/api';
|
|
13
12
|
|
|
14
13
|
export interface ITestWorkspaceUtil {
|
|
15
14
|
waitWorkspaceStatus(namespace: string, workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus): void;
|
|
@@ -17,7 +16,7 @@ export interface ITestWorkspaceUtil {
|
|
|
17
16
|
stopWorkspaceByName(workspaceName: string): void;
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
|
-
* Delete a
|
|
19
|
+
* Delete a workspace without stopping phase (similar with force deleting)
|
|
21
20
|
*/
|
|
22
21
|
deleteWorkspaceByName(workspaceName: string): void;
|
|
23
22
|
|
|
@@ -41,58 +40,4 @@ export interface ITestWorkspaceUtil {
|
|
|
41
40
|
* Similar with 'force' deleting
|
|
42
41
|
*/
|
|
43
42
|
deleteAllWorkspaces(namespace: string): void;
|
|
44
|
-
|
|
45
|
-
/*=====================
|
|
46
|
-
* DEPRECATED METHODS *
|
|
47
|
-
*====================*/
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
51
|
-
*/
|
|
52
|
-
cleanUpAllWorkspaces(): void;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
56
|
-
*/
|
|
57
|
-
cleanUpRunningWorkspace(workspaceName: string): void;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
61
|
-
*/
|
|
62
|
-
waitPluginAdding(namespace: string, workspaceName: string, pluginId: string): void;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
66
|
-
*/
|
|
67
|
-
removeWorkspaceById(id: string): void;
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
71
|
-
*/
|
|
72
|
-
stopWorkspaceById(id: string): void;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
76
|
-
*/
|
|
77
|
-
getIdOfRunningWorkspace(workspaceName: string): Promise<string>;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
81
|
-
*/
|
|
82
|
-
getIdOfRunningWorkspaces(): Promise<Array<string>>;
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
86
|
-
*/
|
|
87
|
-
createWsFromDevFile(customTemplate: che.workspace.devfile.Devfile): void;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
91
|
-
*/
|
|
92
|
-
getBaseDevfile(): Promise<che.workspace.devfile.Devfile>;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
96
|
-
*/
|
|
97
|
-
startWorkspace(workspaceId: string): void;
|
|
98
43
|
}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
|
|
11
11
|
import 'reflect-metadata';
|
|
12
|
-
import { che } from '@eclipse-che/api';
|
|
13
12
|
import { TestConstants } from '../../constants/TestConstants';
|
|
14
13
|
import { injectable, inject } from 'inversify';
|
|
15
14
|
import { DriverHelper } from '../DriverHelper';
|
|
@@ -81,7 +80,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
81
80
|
await this.waitWorkspaceStatus(workspaceName, WorkspaceStatus.STOPPED);
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
// delete a
|
|
83
|
+
// delete a workspace without stopping phase (similar with force deleting)
|
|
85
84
|
public async deleteWorkspaceByName(workspaceName: string) {
|
|
86
85
|
Logger.debug(`TestWorkspaceUtil.deleteWorkspaceByName ${workspaceName}` );
|
|
87
86
|
|
|
@@ -138,7 +137,7 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
138
137
|
}
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
// stop all run workspaces, check
|
|
140
|
+
// stop all run workspaces, check statuses and remove the workspaces
|
|
142
141
|
public async stopAndDeleteAllRunningWorkspaces(namespace: string) {
|
|
143
142
|
Logger.debug('TestWorkspaceUtil.stopAndDeleteAllRunProjects');
|
|
144
143
|
let response = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
@@ -160,244 +159,4 @@ export class TestWorkspaceUtil implements ITestWorkspaceUtil {
|
|
|
160
159
|
await this.deleteWorkspaceByName(response.data.items[i].metadata.name);
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
166
|
-
*/
|
|
167
|
-
public async waitPluginAdding(namespace: string, workspaceName: string, pluginName: string) {
|
|
168
|
-
Logger.debug('TestWorkspaceUtil.waitPluginAdding');
|
|
169
|
-
|
|
170
|
-
const workspaceStatusApiUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${namespace}:${workspaceName}`;
|
|
171
|
-
const attempts: number = TestConstants.TS_SELENIUM_PLUGIN_PRECENCE_ATTEMPTS;
|
|
172
|
-
const polling: number = TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
173
|
-
|
|
174
|
-
for (let i = 0; i < attempts; i++) {
|
|
175
|
-
const response = await this.processRequestHandler.get(workspaceStatusApiUrl);
|
|
176
|
-
|
|
177
|
-
if (response.status !== 200) {
|
|
178
|
-
await this.driverHelper.wait(polling);
|
|
179
|
-
continue;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
const machines: string = JSON.stringify(response.data.runtime.machines);
|
|
183
|
-
const isPluginPresent: boolean = machines.search(pluginName) > 0;
|
|
184
|
-
|
|
185
|
-
if (isPluginPresent) {
|
|
186
|
-
break;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
if (i === attempts - 1) {
|
|
190
|
-
throw new error.TimeoutError(`Exceeded maximum tries attempts, the '${pluginName}' plugin is not present in the workspace runtime.`);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
await this.driverHelper.wait(polling);
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
199
|
-
*/
|
|
200
|
-
public async getListOfWorkspaceId(): Promise<string[]> {
|
|
201
|
-
Logger.debug('TestWorkspaceUtil.getListOfWorkspaceId');
|
|
202
|
-
|
|
203
|
-
const getAllWorkspacesResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
204
|
-
|
|
205
|
-
interface IMyObj {
|
|
206
|
-
id: string;
|
|
207
|
-
status: string;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
let stringified = JSON.stringify(getAllWorkspacesResponse.data);
|
|
211
|
-
let arrayOfWorkspaces = <IMyObj[]>JSON.parse(stringified);
|
|
212
|
-
let wsList: Array<string> = [];
|
|
213
|
-
|
|
214
|
-
for (let entry of arrayOfWorkspaces) {
|
|
215
|
-
wsList.push(entry.id);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
return wsList;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
223
|
-
*/
|
|
224
|
-
public async getIdOfRunningWorkspace(wsName: string): Promise<string> {
|
|
225
|
-
Logger.debug('TestWorkspaceUtil.getIdOfRunningWorkspace');
|
|
226
|
-
|
|
227
|
-
const getWorkspacesByNameResponse = await this.processRequestHandler.get(`${await this.apiUrlResolver.getWorkspacesApiUrl()}/:${wsName}`);
|
|
228
|
-
return getWorkspacesByNameResponse.data.id;
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
234
|
-
*/
|
|
235
|
-
public async getIdOfRunningWorkspaces(): Promise<Array<string>> {
|
|
236
|
-
Logger.debug('TestWorkspaceUtil.getIdOfRunningWorkspaces');
|
|
237
|
-
|
|
238
|
-
try {
|
|
239
|
-
const getAllWorkspacesResponse = await this.processRequestHandler.get(await this.apiUrlResolver.getWorkspacesApiUrl());
|
|
240
|
-
|
|
241
|
-
interface IMyObj {
|
|
242
|
-
id: string;
|
|
243
|
-
status: string;
|
|
244
|
-
}
|
|
245
|
-
let stringified = JSON.stringify(getAllWorkspacesResponse.data);
|
|
246
|
-
let arrayOfWorkspaces = <IMyObj[]>JSON.parse(stringified);
|
|
247
|
-
let idOfRunningWorkspace: Array<string> = new Array();
|
|
248
|
-
|
|
249
|
-
for (let entry of arrayOfWorkspaces) {
|
|
250
|
-
if (entry.status === 'RUNNING') {
|
|
251
|
-
idOfRunningWorkspace.push(entry.id);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return idOfRunningWorkspace;
|
|
256
|
-
} catch (err) {
|
|
257
|
-
console.log(`Getting id of running workspaces failed. URL used: ${await this.apiUrlResolver.getWorkspacesApiUrl()}`);
|
|
258
|
-
throw err;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
264
|
-
*/
|
|
265
|
-
public async removeWorkspaceById(id: string) {
|
|
266
|
-
Logger.debug('TestWorkspaceUtil.removeWorkspaceById');
|
|
267
|
-
|
|
268
|
-
const workspaceIdUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${id}`;
|
|
269
|
-
try {
|
|
270
|
-
const deleteWorkspaceResponse = await this.processRequestHandler.delete(workspaceIdUrl);
|
|
271
|
-
if (deleteWorkspaceResponse.status !== 204) {
|
|
272
|
-
throw new Error(`Can not remove workspace. Code: ${deleteWorkspaceResponse.status} Data: ${deleteWorkspaceResponse.data}`);
|
|
273
|
-
}
|
|
274
|
-
} catch (err) {
|
|
275
|
-
console.log(`Removing of workspace failed.`);
|
|
276
|
-
throw err;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
282
|
-
*/
|
|
283
|
-
public async stopWorkspaceById(id: string) {
|
|
284
|
-
Logger.debug('TestWorkspaceUtil.stopWorkspaceById');
|
|
285
|
-
|
|
286
|
-
const stopWorkspaceApiUrl: string = `${await this.apiUrlResolver.getWorkspacesApiUrl()}/${id}`;
|
|
287
|
-
let stopWorkspaceResponse;
|
|
288
|
-
|
|
289
|
-
try {
|
|
290
|
-
stopWorkspaceResponse = await this.processRequestHandler.delete(`${stopWorkspaceApiUrl}`);
|
|
291
|
-
} catch (err) {
|
|
292
|
-
console.log(`Stop workspace call failed. URL used: ${stopWorkspaceApiUrl}`);
|
|
293
|
-
throw err;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
if (stopWorkspaceResponse.status !== 200) {
|
|
297
|
-
throw new Error(`Can not stop workspace. Code: ${stopWorkspaceResponse.status} Data: ${stopWorkspaceResponse.data}`);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
let stopped: boolean = false;
|
|
301
|
-
let wsStatus = await this.processRequestHandler.get(stopWorkspaceApiUrl);
|
|
302
|
-
for (let i = 0; i < TestConstants.TS_SELENIUM_PLUGIN_PRECENCE_ATTEMPTS; i++) {
|
|
303
|
-
wsStatus = await this.processRequestHandler.get(stopWorkspaceApiUrl);
|
|
304
|
-
if (wsStatus.data.status === WorkspaceStatus.STOPPED) {
|
|
305
|
-
stopped = true;
|
|
306
|
-
break;
|
|
307
|
-
}
|
|
308
|
-
await this.driverHelper.wait(TestConstants.TS_SELENIUM_DEFAULT_POLLING);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
if (!stopped) {
|
|
312
|
-
let waitTime = TestConstants.TS_SELENIUM_PLUGIN_PRECENCE_ATTEMPTS * TestConstants.TS_SELENIUM_DEFAULT_POLLING;
|
|
313
|
-
throw new error.TimeoutError(`The workspace was not stopped in ${waitTime} ms. Currnet status is: ${wsStatus.data.status}`);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
/**
|
|
318
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
319
|
-
*/
|
|
320
|
-
public async cleanUpAllWorkspaces() {
|
|
321
|
-
Logger.debug('TestWorkspaceUtil.cleanUpAllWorkspaces');
|
|
322
|
-
|
|
323
|
-
let listOfRunningWorkspaces: Array<string> = await this.getIdOfRunningWorkspaces();
|
|
324
|
-
for (const entry of listOfRunningWorkspaces) {
|
|
325
|
-
await this.stopWorkspaceById(entry);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
let listAllWorkspaces: Array<string> = await this.getListOfWorkspaceId();
|
|
329
|
-
|
|
330
|
-
for (const entry of listAllWorkspaces) {
|
|
331
|
-
await this.removeWorkspaceById(entry);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
338
|
-
*/
|
|
339
|
-
public async cleanUpRunningWorkspace(workspaceName: string) {
|
|
340
|
-
if (workspaceName === undefined || workspaceName.length === 0) {
|
|
341
|
-
Logger.warn(`Could nod delete workspace because workspaceName is undefined or empty`);
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
Logger.debug(`TestWorkspaceUtil.cleanUpRunningWorkspace ${workspaceName}`);
|
|
346
|
-
const workspaceID: string = await this.getIdOfRunningWorkspace(workspaceName);
|
|
347
|
-
|
|
348
|
-
if (workspaceID === undefined || workspaceID.length === 0) {
|
|
349
|
-
Logger.error(`Could nod delete workspace with name ${workspaceName} because workspaceID is undefined or empty`);
|
|
350
|
-
return;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
Logger.trace(`TestWorkspaceUtil.cleanUpRunningWorkspace Stopping workspace:${workspaceName} with ID:${workspaceID}`);
|
|
354
|
-
await this.stopWorkspaceById(workspaceID);
|
|
355
|
-
Logger.trace(`TestWorkspaceUtil.cleanUpRunningWorkspace Deleting workspace ${workspaceName}`);
|
|
356
|
-
await this.removeWorkspaceById(workspaceID);
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
361
|
-
*/
|
|
362
|
-
async createWsFromDevFile(customTemplate: che.workspace.devfile.Devfile) {
|
|
363
|
-
Logger.debug('TestWorkspaceUtil.createWsFromDevFile');
|
|
364
|
-
|
|
365
|
-
try {
|
|
366
|
-
await this.processRequestHandler.post(await this.apiUrlResolver.getWorkspacesApiUrl() + '/devfile', customTemplate);
|
|
367
|
-
} catch (error) {
|
|
368
|
-
console.error(error);
|
|
369
|
-
throw error;
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
375
|
-
*/
|
|
376
|
-
async getBaseDevfile(): Promise<che.workspace.devfile.Devfile> {
|
|
377
|
-
Logger.debug('TestWorkspaceUtil.getBaseDevfile');
|
|
378
|
-
|
|
379
|
-
const baseDevfile: che.workspace.devfile.Devfile = {
|
|
380
|
-
apiVersion: '1.0.0',
|
|
381
|
-
metadata: {
|
|
382
|
-
name: 'test-workspace'
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
|
|
386
|
-
return baseDevfile;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* @deprecated Method deprecated. Works with CHE server only
|
|
391
|
-
*/
|
|
392
|
-
async startWorkspace(workspaceId: string) {
|
|
393
|
-
Logger.debug('TestWorkspaceUtil.startWorkspace');
|
|
394
|
-
|
|
395
|
-
try {
|
|
396
|
-
await this.processRequestHandler.post(`${await this.apiUrlResolver.getWorkspacesApiUrl()}/${workspaceId}/runtime`);
|
|
397
|
-
} catch (error) {
|
|
398
|
-
console.error(error);
|
|
399
|
-
throw error;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
|
|
403
162
|
}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.WorkspaceDetailsPlugins = void 0;
|
|
16
|
-
/*********************************************************************
|
|
17
|
-
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
18
|
-
*
|
|
19
|
-
* This program and the accompanying materials are made
|
|
20
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
21
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
22
|
-
*
|
|
23
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
24
|
-
**********************************************************************/
|
|
25
|
-
const DriverHelper_1 = require("../../../utils/DriverHelper");
|
|
26
|
-
const inversify_1 = require("inversify");
|
|
27
|
-
require("reflect-metadata");
|
|
28
|
-
const inversify_types_1 = require("../../../configs/inversify.types");
|
|
29
|
-
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
30
|
-
const WorkspaceDetails_1 = require("./WorkspaceDetails");
|
|
31
|
-
const WorkspaceStatus_1 = require("../../../utils/workspace/WorkspaceStatus");
|
|
32
|
-
const Logger_1 = require("../../../utils/Logger");
|
|
33
|
-
const TimeoutConstants_1 = require("../../../constants/TimeoutConstants");
|
|
34
|
-
let WorkspaceDetailsPlugins = class WorkspaceDetailsPlugins {
|
|
35
|
-
constructor(driverHelper, workspaceDetails, testWorkspaceUtil) {
|
|
36
|
-
this.driverHelper = driverHelper;
|
|
37
|
-
this.workspaceDetails = workspaceDetails;
|
|
38
|
-
this.testWorkspaceUtil = testWorkspaceUtil;
|
|
39
|
-
}
|
|
40
|
-
async waitPluginListItem(pluginName) {
|
|
41
|
-
Logger_1.Logger.debug(`WorkspaceDetailsPlugins.waitPluginListItem ${pluginName}`);
|
|
42
|
-
const pluginListItemLocator = selenium_webdriver_1.By.css(this.getPluginListItemCssLocator(pluginName));
|
|
43
|
-
await this.driverHelper.waitVisibility(pluginListItemLocator, TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT);
|
|
44
|
-
}
|
|
45
|
-
async enablePlugin(pluginName, pluginVersion) {
|
|
46
|
-
Logger_1.Logger.debug(`WorkspaceDetailsPlugins.enablePlugin ${pluginName}:${pluginVersion}`);
|
|
47
|
-
await this.waitPluginDisabling(pluginName, pluginVersion);
|
|
48
|
-
await this.clickOnPluginListItemSwitcher(pluginName, pluginVersion);
|
|
49
|
-
await this.waitPluginEnabling(pluginName, pluginVersion);
|
|
50
|
-
}
|
|
51
|
-
async disablePlugin(pluginName, pluginVersion) {
|
|
52
|
-
Logger_1.Logger.debug(`WorkspaceDetailsPlugins.disablePlugin ${pluginName}:${pluginVersion}`);
|
|
53
|
-
await this.waitPluginEnabling(pluginName, pluginVersion);
|
|
54
|
-
await this.clickOnPluginListItemSwitcher(pluginName, pluginVersion);
|
|
55
|
-
await this.waitPluginDisabling(pluginName, pluginVersion);
|
|
56
|
-
}
|
|
57
|
-
async addPluginAndOpenWorkspace(namespace, workspaceName, pluginName, pluginId, pluginVersion) {
|
|
58
|
-
Logger_1.Logger.debug(`WorkspaceDetailsPlugins.addPluginAndOpenWorkspace ${namespace}/${workspaceName} plugin: ${pluginName}:${pluginVersion}`);
|
|
59
|
-
await this.workspaceDetails.selectTab('Plugins');
|
|
60
|
-
await this.enablePlugin(pluginName, pluginVersion);
|
|
61
|
-
await this.workspaceDetails.saveChanges();
|
|
62
|
-
await this.workspaceDetails.openWorkspace(namespace, workspaceName);
|
|
63
|
-
await this.testWorkspaceUtil.waitWorkspaceStatus(namespace, workspaceName, WorkspaceStatus_1.WorkspaceStatus.RUNNING);
|
|
64
|
-
await this.testWorkspaceUtil.waitPluginAdding(namespace, workspaceName, pluginId);
|
|
65
|
-
}
|
|
66
|
-
getPluginListItemCssLocator(pluginName, pluginVersion) {
|
|
67
|
-
if (pluginVersion) {
|
|
68
|
-
return `.plugin-item div[plugin-item-name*='${pluginName}'][plugin-item-version='${pluginVersion}']`;
|
|
69
|
-
}
|
|
70
|
-
return `.plugin-item div[plugin-item-name*='${pluginName}']`;
|
|
71
|
-
}
|
|
72
|
-
getPluginListItemSwitcherCssLocator(pluginName, pluginVersion) {
|
|
73
|
-
return `${this.getPluginListItemCssLocator(pluginName, pluginVersion)} md-switch`;
|
|
74
|
-
}
|
|
75
|
-
async clickOnPluginListItemSwitcher(pluginName, pluginVersion, timeout = TimeoutConstants_1.TimeoutConstants.TS_CLICK_DASHBOARD_ITEM_TIMEOUT) {
|
|
76
|
-
const pluginListItemSwitcherLocator = selenium_webdriver_1.By.css(this.getPluginListItemSwitcherCssLocator(pluginName, pluginVersion));
|
|
77
|
-
await this.driverHelper.waitAndClick(pluginListItemSwitcherLocator, timeout);
|
|
78
|
-
}
|
|
79
|
-
async waitPluginEnabling(pluginName, pluginVersion, timeout = TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT) {
|
|
80
|
-
const enabledPluginSwitcherLocator = selenium_webdriver_1.By.css(`${this.getPluginListItemCssLocator(pluginName, pluginVersion)} md-switch[aria-checked='true']`);
|
|
81
|
-
await this.driverHelper.waitVisibility(enabledPluginSwitcherLocator, timeout);
|
|
82
|
-
}
|
|
83
|
-
async waitPluginDisabling(pluginName, pluginVersion, timeout = TimeoutConstants_1.TimeoutConstants.TS_COMMON_DASHBOARD_WAIT_TIMEOUT) {
|
|
84
|
-
const disabledPluginSwitcherLocator = selenium_webdriver_1.By.css(`${this.getPluginListItemCssLocator(pluginName, pluginVersion)} md-switch[aria-checked='false']`);
|
|
85
|
-
await this.driverHelper.waitVisibility(disabledPluginSwitcherLocator, timeout);
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
WorkspaceDetailsPlugins = __decorate([
|
|
89
|
-
inversify_1.injectable(),
|
|
90
|
-
__param(0, inversify_1.inject(inversify_types_1.CLASSES.DriverHelper)),
|
|
91
|
-
__param(1, inversify_1.inject(inversify_types_1.CLASSES.WorkspaceDetails)),
|
|
92
|
-
__param(2, inversify_1.inject(inversify_types_1.TYPES.WorkspaceUtil)),
|
|
93
|
-
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper,
|
|
94
|
-
WorkspaceDetails_1.WorkspaceDetails, Object])
|
|
95
|
-
], WorkspaceDetailsPlugins);
|
|
96
|
-
exports.WorkspaceDetailsPlugins = WorkspaceDetailsPlugins;
|
|
97
|
-
//# sourceMappingURL=WorkspaceDetailsPlugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkspaceDetailsPlugins.js","sourceRoot":"","sources":["../../../../pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,8DAA2D;AAC3D,yCAA+C;AAC/C,4BAA0B;AAC1B,sEAAkE;AAClE,2DAAwC;AACxC,yDAAsD;AACtD,8EAA2E;AAC3E,kDAA+C;AAC/C,0EAAuE;AAIvE,IAAa,uBAAuB,GAApC,MAAa,uBAAuB;IAChC,YAA2D,YAA0B,EACtB,gBAAkC,EACvC,iBAAqC;QAFpC,iBAAY,GAAZ,YAAY,CAAc;QACtB,qBAAgB,GAAhB,gBAAgB,CAAkB;QACvC,sBAAiB,GAAjB,iBAAiB,CAAoB;IAAI,CAAC;IAEpG,KAAK,CAAC,kBAAkB,CAAC,UAAkB;QACvC,eAAM,CAAC,KAAK,CAAC,8CAA8C,UAAU,EAAE,CAAC,CAAC;QAEzE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E,OAAO,CAAC,CAAC;IAClF,CAAC;IAEO,KAAK,CAAC,mBAAmB,CAAC,UAAkB,EAAE,aAAsB,EAAE,UAAkB,mCAAgB,CAAC,gCAAgC;QAC7I,MAAM,6BAA6B,GAAO,uBAAE,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,2BAA2B,CAAC,UAAU,EAAE,aAAa,CAAC,kCAAkC,CAAC,CAAC;QAEnJ,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,6BAA6B,EAAE,OAAO,CAAC,CAAC;IACnF,CAAC;CAEJ,CAAA;AAzEY,uBAAuB;IADnC,sBAAU,EAAE;IAEI,WAAA,kBAAM,CAAC,yBAAO,CAAC,YAAY,CAAC,CAAA;IAC5B,WAAA,kBAAM,CAAC,yBAAO,CAAC,gBAAgB,CAAC,CAAA;IAChC,WAAA,kBAAM,CAAC,uBAAK,CAAC,aAAa,CAAC,CAAA;qCAFiC,2BAAY;QACJ,mCAAgB;GAFxF,uBAAuB,CAyEnC;AAzEY,0DAAuB"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.MultiUserLoginPage = void 0;
|
|
16
|
-
/*********************************************************************
|
|
17
|
-
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
18
|
-
*
|
|
19
|
-
* This program and the accompanying materials are made
|
|
20
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
21
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
22
|
-
*
|
|
23
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
24
|
-
**********************************************************************/
|
|
25
|
-
require("reflect-metadata");
|
|
26
|
-
const CheLoginPage_1 = require("../openshift/CheLoginPage");
|
|
27
|
-
const inversify_1 = require("inversify");
|
|
28
|
-
const inversify_types_1 = require("../../configs/inversify.types");
|
|
29
|
-
const TestConstants_1 = require("../../constants/TestConstants");
|
|
30
|
-
const Logger_1 = require("../../utils/Logger");
|
|
31
|
-
let MultiUserLoginPage = class MultiUserLoginPage {
|
|
32
|
-
constructor(cheLogin) {
|
|
33
|
-
this.cheLogin = cheLogin;
|
|
34
|
-
}
|
|
35
|
-
async login() {
|
|
36
|
-
Logger_1.Logger.debug('MultiUserLoginPage.login');
|
|
37
|
-
await this.cheLogin.waitEclipseCheLoginFormPage();
|
|
38
|
-
await this.cheLogin.inputUserNameEclipseCheLoginPage(TestConstants_1.TestConstants.TS_SELENIUM_USERNAME);
|
|
39
|
-
await this.cheLogin.inputPaswordEclipseCheLoginPage(TestConstants_1.TestConstants.TS_SELENIUM_PASSWORD);
|
|
40
|
-
await this.cheLogin.clickEclipseCheLoginButton();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
MultiUserLoginPage = __decorate([
|
|
44
|
-
inversify_1.injectable(),
|
|
45
|
-
__param(0, inversify_1.inject(inversify_types_1.CLASSES.CheLoginPage)),
|
|
46
|
-
__metadata("design:paramtypes", [CheLoginPage_1.CheLoginPage])
|
|
47
|
-
], MultiUserLoginPage);
|
|
48
|
-
exports.MultiUserLoginPage = MultiUserLoginPage;
|
|
49
|
-
//# sourceMappingURL=MultiUserLoginPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiUserLoginPage.js","sourceRoot":"","sources":["../../../pageobjects/login/MultiUserLoginPage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,4BAA0B;AAE1B,4DAAyD;AACzD,yCAA+C;AAC/C,mEAAwD;AACxD,iEAA8D;AAC9D,+CAA4C;AAG5C,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE3B,YACmD,QAAsB;QAAtB,aAAQ,GAAR,QAAQ,CAAc;IAAI,CAAC;IAE9E,KAAK,CAAC,KAAK;QACP,eAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAEzC,MAAM,IAAI,CAAC,QAAQ,CAAC,2BAA2B,EAAE,CAAC;QAClD,MAAM,IAAI,CAAC,QAAQ,CAAC,gCAAgC,CAAC,6BAAa,CAAC,oBAAoB,CAAC,CAAC;QACzF,MAAM,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC,6BAAa,CAAC,oBAAoB,CAAC,CAAC;QACxF,MAAM,IAAI,CAAC,QAAQ,CAAC,0BAA0B,EAAE,CAAC;IACrD,CAAC;CAEJ,CAAA;AAdY,kBAAkB;IAD9B,sBAAU,EAAE;IAIJ,WAAA,kBAAM,CAAC,yBAAO,CAAC,YAAY,CAAC,CAAA;qCAA4B,2BAAY;GAHhE,kBAAkB,CAc9B;AAdY,gDAAkB"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.UpdateAccountInformationPage = void 0;
|
|
16
|
-
/*********************************************************************
|
|
17
|
-
* Copyright (c) 2019-2023 Red Hat, Inc.
|
|
18
|
-
*
|
|
19
|
-
* This program and the accompanying materials are made
|
|
20
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
21
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
22
|
-
*
|
|
23
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
24
|
-
**********************************************************************/
|
|
25
|
-
require("reflect-metadata");
|
|
26
|
-
const inversify_1 = require("inversify");
|
|
27
|
-
const Logger_1 = require("../../utils/Logger");
|
|
28
|
-
const DriverHelper_1 = require("../../utils/DriverHelper");
|
|
29
|
-
const inversify_types_1 = require("../../configs/inversify.types");
|
|
30
|
-
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
31
|
-
let UpdateAccountInformationPage = class UpdateAccountInformationPage {
|
|
32
|
-
constructor(driverHelper) {
|
|
33
|
-
this.driverHelper = driverHelper;
|
|
34
|
-
}
|
|
35
|
-
async enterEmail(email, timeout) {
|
|
36
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.enterEmail');
|
|
37
|
-
await this.driverHelper.enterValue(selenium_webdriver_1.By.id('email'), email, timeout);
|
|
38
|
-
}
|
|
39
|
-
async enterFirstName(firstName, timeout) {
|
|
40
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.enterFirstName');
|
|
41
|
-
await this.driverHelper.enterValue(selenium_webdriver_1.By.id('firstName'), firstName, timeout);
|
|
42
|
-
}
|
|
43
|
-
async enterLastName(lastName, timeout) {
|
|
44
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.enterLastName');
|
|
45
|
-
await this.driverHelper.enterValue(selenium_webdriver_1.By.id('lastName'), lastName, timeout);
|
|
46
|
-
}
|
|
47
|
-
async clickConfirmButton(timeout) {
|
|
48
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.clickConfirmButton');
|
|
49
|
-
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.xpath('//input[@type=\'submit\']'), timeout);
|
|
50
|
-
}
|
|
51
|
-
async clickAddToExistingAccountButton(timeout) {
|
|
52
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.clickAddToExistingAccountButton');
|
|
53
|
-
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.id('linkAccount'), timeout);
|
|
54
|
-
}
|
|
55
|
-
async enterPassword(password, timeout) {
|
|
56
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.enterPassword');
|
|
57
|
-
await this.driverHelper.enterValue(selenium_webdriver_1.By.id('password'), password, timeout);
|
|
58
|
-
}
|
|
59
|
-
async clickLogInButton(timeout) {
|
|
60
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.clickLogInButton');
|
|
61
|
-
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.id('kc-login'), timeout);
|
|
62
|
-
}
|
|
63
|
-
async clickToAllowSelectedPermissionsButton(timeout) {
|
|
64
|
-
Logger_1.Logger.debug('UpdateAccountInformationPage.clickToAllowSelectedPermissionsButton');
|
|
65
|
-
await this.driverHelper.waitAndClick(selenium_webdriver_1.By.xpath('//input[@name=\'approve\']'), timeout);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
UpdateAccountInformationPage = __decorate([
|
|
69
|
-
inversify_1.injectable(),
|
|
70
|
-
__param(0, inversify_1.inject(inversify_types_1.CLASSES.DriverHelper)),
|
|
71
|
-
__metadata("design:paramtypes", [DriverHelper_1.DriverHelper])
|
|
72
|
-
], UpdateAccountInformationPage);
|
|
73
|
-
exports.UpdateAccountInformationPage = UpdateAccountInformationPage;
|
|
74
|
-
//# sourceMappingURL=UpdateAccountInformationPage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateAccountInformationPage.js","sourceRoot":"","sources":["../../../pageobjects/login/UpdateAccountInformationPage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,4BAA0B;AAC1B,yCAA+C;AAC/C,+CAA4C;AAC5C,2DAAwD;AACxD,mEAAwD;AACxD,2DAAwC;AAGxC,IAAa,4BAA4B,GAAzC,MAAa,4BAA4B;IAErC,YAA2D,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAI,CAAC;IAE1F,KAAK,CAAC,UAAU,CAAC,KAAa,EAAE,OAAe;QAC3C,eAAM,CAAC,KAAK,CAAC,yCAAyC,CAAC,CAAC;QAExD,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,uBAAE,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,SAAiB,EAAE,OAAe;QACnD,eAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QAE5D,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,uBAAE,CAAC,EAAE,CAAC,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IAC/E,CAAC;IAED,KAAK,CAAC,aAAa,CAAC,QAAgB,EAAE,OAAe;QACjD,eAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAE3D,MAAM,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