@eclipse-che/che-e2e 7.64.0-dev-20514b2 → 7.64.0-dev-f0466d9
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 +5 -35
- package/configs/mocharc.ts +9 -3
- package/configs/sh-scripts/initDefaultValues.sh +0 -5
- package/constants/TestConstants.ts +35 -97
- package/constants/TimeoutConstants.ts +1 -1
- 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/constants/TimeoutConstants.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 +8 -16
- 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/SmokeTest.spec.js +49 -0
- package/dist/specs/SmokeTest.spec.js.map +1 -0
- 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 +15 -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/CheReporter.js +5 -2
- package/dist/utils/CheReporter.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/ScreenCatcher.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/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/vsc/GitUtil.js +36 -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 +3 -193
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/driver/ChromeDriver.ts +3 -3
- package/index.ts +37 -0
- package/package.json +9 -5
- package/pageobjects/dashboard/CreateWorkspace.ts +10 -21
- package/pageobjects/dashboard/Dashboard.ts +37 -16
- package/pageobjects/dashboard/Workspaces.ts +21 -23
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +16 -16
- 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/OcpUserLoginPage.ts +1 -1
- package/pageobjects/login/RedHatLoginPage.ts +62 -0
- package/pageobjects/login/RegularUserOcpCheLoginPage.ts +2 -21
- package/pageobjects/openshift/CheLoginPage.ts +8 -57
- package/pageobjects/openshift/OcpLoginPage.ts +8 -29
- package/specs/MochaHooks.ts +9 -9
- package/specs/SmokeTest.spec.ts +50 -0
- 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 +16 -7
- package/tslint.json +4 -4
- package/utils/BrowserTabsUtil.ts +9 -31
- package/utils/CheReporter.ts +12 -8
- package/utils/DriverHelper.ts +40 -115
- package/utils/Logger.ts +13 -8
- package/utils/Sanitizer.ts +0 -1
- package/utils/ScreenCatcher.ts +8 -7
- package/utils/request-handlers/CheApiRequestHandler.ts +1 -1
- package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +2 -1
- package/utils/vsc/GitUtil.ts +25 -0
- package/utils/workspace/ApiUrlResolver.ts +3 -6
- package/utils/workspace/ITestWorkspaceUtil.ts +1 -56
- package/utils/workspace/TestWorkspaceUtil.ts +24 -265
- 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
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { injectable } from 'inversify';
|
|
2
|
-
import axios from 'axios';
|
|
3
|
-
|
|
4
|
-
@injectable()
|
|
5
|
-
export class GitHubUtil {
|
|
6
|
-
private static readonly GITHUB_API_ENTRIPOINT_URL = 'https://api.github.com/';
|
|
7
|
-
/**
|
|
8
|
-
* add public part of ssh key to the defied github account
|
|
9
|
-
* @param authToken
|
|
10
|
-
* @param title
|
|
11
|
-
* @param key
|
|
12
|
-
*/
|
|
13
|
-
async addPublicSshKeyToUserAccount(authToken: string, title: string, key: string) {
|
|
14
|
-
const gitHubApiSshURL: string = GitHubUtil.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
|
|
15
|
-
const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
|
|
16
|
-
|
|
17
|
-
const data = {
|
|
18
|
-
title: `${title}`,
|
|
19
|
-
key: `${key}`
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
try { await axios.post(gitHubApiSshURL, JSON.stringify(data), authHeader); } catch (error) {
|
|
23
|
-
console.error('Cannot add the public key to the GitHub account: ');
|
|
24
|
-
console.error(error);
|
|
25
|
-
throw error;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async getRawContentFromFile(pathToFile: string): Promise<string> {
|
|
30
|
-
const gitHubContentEntryPointUrl: string = 'https://raw.githubusercontent.com/';
|
|
31
|
-
const pathToRawContent: string = `${gitHubContentEntryPointUrl}${pathToFile}`;
|
|
32
|
-
const authorization: string = 'Authorization';
|
|
33
|
-
const contentType: string = 'Content-Type';
|
|
34
|
-
|
|
35
|
-
try {
|
|
36
|
-
delete axios.defaults.headers.common[authorization];
|
|
37
|
-
delete axios.defaults.headers.common[contentType];
|
|
38
|
-
const response = await axios.get(`${gitHubContentEntryPointUrl}${pathToFile}`);
|
|
39
|
-
return response.data;
|
|
40
|
-
} catch (error) {
|
|
41
|
-
console.error('Cannot get content form the raw github content: ' + pathToRawContent);
|
|
42
|
-
console.error(error);
|
|
43
|
-
throw error;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async getPublicSshKeys(authToken: string): Promise<Array<string>> {
|
|
48
|
-
const gitHubApiSshURL: string = GitHubUtil.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
|
|
49
|
-
const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
|
|
50
|
-
try {
|
|
51
|
-
const response = await axios.get(gitHubApiSshURL, authHeader);
|
|
52
|
-
const stringified = JSON.stringify(response.data);
|
|
53
|
-
const arrayOfWorkspaces = JSON.parse(stringified);
|
|
54
|
-
const idOfRunningWorkspace: Array<string> = new Array();
|
|
55
|
-
for (let entry of arrayOfWorkspaces) {
|
|
56
|
-
idOfRunningWorkspace.push(entry.id);
|
|
57
|
-
}
|
|
58
|
-
return idOfRunningWorkspace;
|
|
59
|
-
} catch (error) {
|
|
60
|
-
console.error('Cannot get public Keys from github: ' + gitHubApiSshURL);
|
|
61
|
-
console.error(error);
|
|
62
|
-
throw error;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async removePublicSshKey(authToken: string, keyId: string) {
|
|
67
|
-
const gitHubApiSshURL: string = GitHubUtil.GITHUB_API_ENTRIPOINT_URL + 'user/keys/' + keyId;
|
|
68
|
-
const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
|
|
69
|
-
try { await axios.delete(gitHubApiSshURL, authHeader); } catch (error) {
|
|
70
|
-
console.error('Cannot delete the public key from the GitHub account: ');
|
|
71
|
-
console.error(error);
|
|
72
|
-
throw error;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
async deletePublicSshKeyByName(authToken: string, keyName: string) {
|
|
77
|
-
const gitHubApiSshURL: string = GitHubUtil.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
|
|
78
|
-
const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
|
|
79
|
-
try {
|
|
80
|
-
const response = await axios.get(gitHubApiSshURL, authHeader);
|
|
81
|
-
const stringified = JSON.stringify(response.data);
|
|
82
|
-
const arrayOfPublicKeys = JSON.parse(stringified);
|
|
83
|
-
for (let entry of arrayOfPublicKeys) {
|
|
84
|
-
if (entry.title === keyName) {
|
|
85
|
-
await this.removePublicSshKey(authToken, entry.id);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
} catch (error) {
|
|
90
|
-
console.error('Cannot delete the ' + keyName + ' public key from the GitHub account');
|
|
91
|
-
console.error(error);
|
|
92
|
-
throw error;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async removeAllPublicSshKeys(authToken: string) {
|
|
97
|
-
try {
|
|
98
|
-
const idList: string[] = await this.getPublicSshKeys(authToken);
|
|
99
|
-
for (let id of idList) {
|
|
100
|
-
await this.removePublicSshKey(authToken, id);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
} catch (error) {
|
|
104
|
-
console.error('Cannot delete the public key from the GitHub account: ');
|
|
105
|
-
console.error(error);
|
|
106
|
-
throw error;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
}
|