@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.
Files changed (165) hide show
  1. package/README.md +11 -37
  2. package/build/dockerfiles/entrypoint.sh +1 -1
  3. package/configs/inversify.config.ts +11 -26
  4. package/configs/inversify.types.ts +5 -35
  5. package/configs/mocharc.ts +9 -3
  6. package/configs/sh-scripts/initDefaultValues.sh +0 -5
  7. package/constants/TestConstants.ts +35 -97
  8. package/constants/TimeoutConstants.ts +1 -1
  9. package/dist/configs/inversify.config.js +8 -23
  10. package/dist/configs/inversify.config.js.map +1 -1
  11. package/dist/configs/inversify.types.js +3 -33
  12. package/dist/configs/inversify.types.js.map +1 -1
  13. package/dist/configs/mocharc.js +11 -4
  14. package/dist/configs/mocharc.js.map +1 -1
  15. package/dist/constants/TestConstants.js +31 -86
  16. package/dist/constants/TestConstants.js.map +1 -1
  17. package/dist/constants/TimeoutConstants.js.map +1 -1
  18. package/dist/driver/ChromeDriver.js +1 -1
  19. package/dist/driver/ChromeDriver.js.map +1 -1
  20. package/dist/index.js +63 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/pageobjects/dashboard/CreateWorkspace.js +8 -16
  23. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +1 -1
  24. package/dist/pageobjects/dashboard/Dashboard.js +16 -1
  25. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  26. package/dist/pageobjects/dashboard/Workspaces.js +1 -3
  27. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  28. package/dist/pageobjects/git-providers/OauthPage.js +150 -0
  29. package/dist/pageobjects/git-providers/OauthPage.js.map +1 -0
  30. package/dist/pageobjects/ide/CheCodeLocatorLoader.js +65 -0
  31. package/dist/pageobjects/ide/CheCodeLocatorLoader.js.map +1 -0
  32. package/dist/pageobjects/login/OcpRedHatLoginPage.js +67 -0
  33. package/dist/pageobjects/login/OcpRedHatLoginPage.js.map +1 -0
  34. package/dist/pageobjects/login/RedHatLoginPage.js +78 -0
  35. package/dist/pageobjects/login/RedHatLoginPage.js.map +1 -0
  36. package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js +3 -21
  37. package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +1 -1
  38. package/dist/pageobjects/openshift/CheLoginPage.js +0 -33
  39. package/dist/pageobjects/openshift/CheLoginPage.js.map +1 -1
  40. package/dist/pageobjects/openshift/OcpLoginPage.js +0 -14
  41. package/dist/pageobjects/openshift/OcpLoginPage.js.map +1 -1
  42. package/dist/specs/MochaHooks.js +2 -2
  43. package/dist/specs/MochaHooks.js.map +1 -1
  44. package/dist/specs/SmokeTest.spec.js +49 -0
  45. package/dist/specs/SmokeTest.spec.js.map +1 -0
  46. package/dist/specs/devfiles/EmptyWorkspace.spec.js +1 -0
  47. package/dist/specs/devfiles/EmptyWorkspace.spec.js.map +1 -1
  48. package/dist/specs/devfiles/Quarkus.spec.js +50 -0
  49. package/dist/specs/devfiles/Quarkus.spec.js.map +1 -0
  50. package/dist/specs/factory/Factory.spec.js +160 -0
  51. package/dist/specs/factory/Factory.spec.js.map +1 -0
  52. package/dist/specs/factory/NoSetupRepoFactory.spec.js +228 -0
  53. package/dist/specs/factory/NoSetupRepoFactory.spec.js.map +1 -0
  54. package/dist/specs/factory/RefusedOAuthFactory.spec.js +220 -0
  55. package/dist/specs/factory/RefusedOAuthFactory.spec.js.map +1 -0
  56. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js +66 -0
  57. package/dist/specs/miscellaneous/PredefinedNamespace.spec.js.map +1 -0
  58. package/dist/tests-library/LoginTests.js +10 -2
  59. package/dist/tests-library/LoginTests.js.map +1 -1
  60. package/dist/tests-library/WorkspaceHandlingTests.js +15 -6
  61. package/dist/tests-library/WorkspaceHandlingTests.js.map +1 -1
  62. package/dist/utils/BrowserTabsUtil.js +2 -21
  63. package/dist/utils/BrowserTabsUtil.js.map +1 -1
  64. package/dist/utils/CheReporter.js +5 -2
  65. package/dist/utils/CheReporter.js.map +1 -1
  66. package/dist/utils/DriverHelper.js +11 -73
  67. package/dist/utils/DriverHelper.js.map +1 -1
  68. package/dist/utils/Logger.js +5 -0
  69. package/dist/utils/Logger.js.map +1 -1
  70. package/dist/utils/Sanitizer.js.map +1 -1
  71. package/dist/utils/ScreenCatcher.js.map +1 -1
  72. package/dist/utils/request-handlers/CheApiRequestHandler.js +1 -1
  73. package/dist/utils/request-handlers/CheApiRequestHandler.js.map +1 -1
  74. package/dist/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  75. package/dist/utils/vsc/GitUtil.js +36 -0
  76. package/dist/utils/vsc/GitUtil.js.map +1 -0
  77. package/dist/utils/workspace/ApiUrlResolver.js +0 -3
  78. package/dist/utils/workspace/ApiUrlResolver.js.map +1 -1
  79. package/dist/utils/workspace/TestWorkspaceUtil.js +3 -193
  80. package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
  81. package/driver/ChromeDriver.ts +3 -3
  82. package/index.ts +37 -0
  83. package/package.json +9 -5
  84. package/pageobjects/dashboard/CreateWorkspace.ts +10 -21
  85. package/pageobjects/dashboard/Dashboard.ts +37 -16
  86. package/pageobjects/dashboard/Workspaces.ts +21 -23
  87. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +16 -16
  88. package/pageobjects/git-providers/OauthPage.ts +156 -0
  89. package/pageobjects/ide/CheCodeLocatorLoader.ts +69 -0
  90. package/pageobjects/login/OcpRedHatLoginPage.ts +49 -0
  91. package/pageobjects/login/OcpUserLoginPage.ts +1 -1
  92. package/pageobjects/login/RedHatLoginPage.ts +62 -0
  93. package/pageobjects/login/RegularUserOcpCheLoginPage.ts +2 -21
  94. package/pageobjects/openshift/CheLoginPage.ts +8 -57
  95. package/pageobjects/openshift/OcpLoginPage.ts +8 -29
  96. package/specs/MochaHooks.ts +9 -9
  97. package/specs/SmokeTest.spec.ts +50 -0
  98. package/specs/devfiles/EmptyWorkspace.spec.ts +1 -0
  99. package/specs/devfiles/Quarkus.spec.ts +52 -0
  100. package/specs/factory/Factory.spec.ts +199 -0
  101. package/specs/factory/NoSetupRepoFactory.spec.ts +272 -0
  102. package/specs/factory/RefusedOAuthFactory.spec.ts +260 -0
  103. package/specs/miscellaneous/PredefinedNamespace.spec.ts +74 -0
  104. package/tests-library/LoginTests.ts +9 -1
  105. package/tests-library/WorkspaceHandlingTests.ts +16 -7
  106. package/tslint.json +4 -4
  107. package/utils/BrowserTabsUtil.ts +9 -31
  108. package/utils/CheReporter.ts +12 -8
  109. package/utils/DriverHelper.ts +40 -115
  110. package/utils/Logger.ts +13 -8
  111. package/utils/Sanitizer.ts +0 -1
  112. package/utils/ScreenCatcher.ts +8 -7
  113. package/utils/request-handlers/CheApiRequestHandler.ts +1 -1
  114. package/utils/request-handlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +2 -1
  115. package/utils/vsc/GitUtil.ts +25 -0
  116. package/utils/workspace/ApiUrlResolver.ts +3 -6
  117. package/utils/workspace/ITestWorkspaceUtil.ts +1 -56
  118. package/utils/workspace/TestWorkspaceUtil.ts +24 -265
  119. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js +0 -97
  120. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +0 -1
  121. package/dist/pageobjects/login/MultiUserLoginPage.js +0 -49
  122. package/dist/pageobjects/login/MultiUserLoginPage.js.map +0 -1
  123. package/dist/pageobjects/login/UpdateAccountInformationPage.js +0 -74
  124. package/dist/pageobjects/login/UpdateAccountInformationPage.js.map +0 -1
  125. package/dist/pageobjects/third-parties/GitLoginPage.js +0 -85
  126. package/dist/pageobjects/third-parties/GitLoginPage.js.map +0 -1
  127. package/dist/pageobjects/third-parties/GitOauthAppsSettings.js +0 -110
  128. package/dist/pageobjects/third-parties/GitOauthAppsSettings.js.map +0 -1
  129. package/dist/specs/login/LinkCheAndOcpUsers.spec.js +0 -40
  130. package/dist/specs/login/LinkCheAndOcpUsers.spec.js.map +0 -1
  131. package/dist/utils/WorkspaceNameHandler.js +0 -60
  132. package/dist/utils/WorkspaceNameHandler.js.map +0 -1
  133. package/dist/utils/request-handlers/tokens/CheMultiuserTokenHandler.js +0 -50
  134. package/dist/utils/request-handlers/tokens/CheMultiuserTokenHandler.js.map +0 -1
  135. package/dist/utils/request-handlers/tokens/ITokenHandler.js +0 -12
  136. package/dist/utils/request-handlers/tokens/ITokenHandler.js.map +0 -1
  137. package/dist/utils/vsc/CheGitApi.js +0 -42
  138. package/dist/utils/vsc/CheGitApi.js.map +0 -1
  139. package/dist/utils/vsc/github/GitHubUtil.js +0 -126
  140. package/dist/utils/vsc/github/GitHubUtil.js.map +0 -1
  141. package/files/devfiles/plugins/GitHubPullRequestPlugin.yaml +0 -11
  142. package/files/devfiles/plugins/InstallPluginUsingUI.yaml +0 -3
  143. package/files/devfiles/plugins/Java11PluginTest.yaml +0 -17
  144. package/files/devfiles/plugins/PhpPluginTest.yaml +0 -47
  145. package/files/devfiles/plugins/PythonPluginTest.yaml +0 -14
  146. package/files/devfiles/plugins/TypescriptNodeDebug2PluginTest.yaml +0 -49
  147. package/files/devfiles/plugins/VscodeKubernetesPlugin.yaml +0 -12
  148. package/files/devfiles/plugins/VscodeShellcheckPlugin.yaml +0 -12
  149. package/files/devfiles/plugins/VscodeValePlugin.yaml +0 -42
  150. package/files/devfiles/plugins/VscodeXmlPlugin.yaml +0 -12
  151. package/files/devfiles/plugins/VscodeYamlPlugin.yaml +0 -12
  152. package/files/happy-path/containers-happy-path.yaml +0 -127
  153. package/files/happy-path/happy-path-workspace.yaml +0 -95
  154. package/files/happy-path/petclinic-classpath.txt +0 -49
  155. package/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts +0 -95
  156. package/pageobjects/login/MultiUserLoginPage.ts +0 -33
  157. package/pageobjects/login/UpdateAccountInformationPage.ts +0 -70
  158. package/pageobjects/third-parties/GitLoginPage.ts +0 -81
  159. package/pageobjects/third-parties/GitOauthAppsSettings.ts +0 -110
  160. package/specs/login/LinkCheAndOcpUsers.spec.ts +0 -49
  161. package/utils/WorkspaceNameHandler.ts +0 -48
  162. package/utils/request-handlers/tokens/CheMultiuserTokenHandler.ts +0 -41
  163. package/utils/request-handlers/tokens/ITokenHandler.ts +0 -14
  164. package/utils/vsc/CheGitApi.ts +0 -22
  165. 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
- }