@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
@@ -10,7 +10,6 @@
10
10
  import 'reflect-metadata';
11
11
  import { ICheLoginPage } from './ICheLoginPage';
12
12
  import { OcpLoginPage } from '../openshift/OcpLoginPage';
13
- import { CheLoginPage } from '../openshift/CheLoginPage';
14
13
  import { injectable, inject } from 'inversify';
15
14
  import { CLASSES } from '../../configs/inversify.types';
16
15
  import { TestConstants } from '../../constants/TestConstants';
@@ -27,13 +26,12 @@ export class RegularUserOcpCheLoginPage implements ICheLoginPage {
27
26
 
28
27
  constructor(
29
28
  @inject(CLASSES.OcpLoginPage) private readonly ocpLogin: OcpLoginPage,
30
- @inject(CLASSES.CheLoginPage) private readonly cheLogin: CheLoginPage,
31
29
  @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
32
30
 
33
- async login() {
31
+ async login(): Promise<void> {
34
32
  Logger.debug('RegularUserOcpCheLoginPage.login');
35
33
 
36
- Logger.debug('OcpRedHatLoginPage.login wait for LogInWithOpenShift page and click button');
34
+ Logger.debug('RegularUserOcpCheLoginPage.login wait for LogInWithOpenShift page and click button');
37
35
  await this.driverHelper.waitPresence(By.xpath(this.OPEN_SHIFT_LOGIN_LANDING_PAGE_LOCATOR), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
38
36
  await this.driverHelper.waitAndClick(By.xpath(this.OPEN_SHIFT_LOGIN_LANDING_PAGE_BUTTON_LOCATOR));
39
37
 
@@ -51,22 +49,5 @@ export class RegularUserOcpCheLoginPage implements ICheLoginPage {
51
49
  await this.ocpLogin.waitAuthorizeOpenShiftIdentityProviderPage();
52
50
  await this.ocpLogin.clickOnApproveAuthorizeAccessButton();
53
51
  }
54
-
55
- if (await this.cheLogin.isFirstBrokerLoginPageVisible()) {
56
- await this.cheLogin.waitFirstBrokerLoginPage();
57
- await this.cheLogin.enterEmailFirstBrokerLoginPage(TestConstants.TS_SELENIUM_EMAIL_USER);
58
- await this.cheLogin.enterFirstNameBrokerLoginPage(TestConstants.TS_SELENIUM_FIRST_NAME);
59
- await this.cheLogin.enterLastNameBrokerLoginPage(TestConstants.TS_SELENIUM_LAST_NAME);
60
- await this.cheLogin.clickOnSubmitButton();
61
- await this.cheLogin.waitDisappearanceBrokerLoginPage();
62
- }
63
-
64
- if (await this.ocpLogin.isLinkAccountPageVisible()) {
65
- await this.ocpLogin.clickOnLinkAccountButton();
66
- await this.cheLogin.waitEclipseCheLoginFormPage();
67
- await this.cheLogin.inputPaswordEclipseCheLoginPage(TestConstants.TS_SELENIUM_PASSWORD);
68
- await this.cheLogin.clickEclipseCheLoginButton();
69
- }
70
52
  }
71
-
72
53
  }
@@ -19,73 +19,24 @@ import { TimeoutConstants } from '../../constants/TimeoutConstants';
19
19
  export class CheLoginPage {
20
20
 
21
21
  constructor(
22
- @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
23
-
24
- async waitEclipseCheLoginFormPage() {
25
- Logger.debug('CheLoginPage.waitEclipseCheLoginFormPage');
26
-
27
- await this.driverHelper.waitVisibility(By.id('login'), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
22
+ @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {
28
23
  }
29
24
 
30
- async inputUserNameEclipseCheLoginPage(userName: string) {
31
- Logger.debug(`CheLoginPage.inputUserNameEclipseCheLoginPage username: "${userName}"`);
25
+ async waitEclipseCheLoginFormPage(): Promise<void> {
26
+ Logger.debug('CheLoginPage.waitEclipseCheLoginFormPage');
32
27
 
33
- await this.driverHelper.enterValue(By.id('login'), userName);
28
+ await this.driverHelper.waitVisibility(By.id('login'), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
34
29
  }
35
30
 
36
- async inputPaswordEclipseCheLoginPage(passw: string) {
37
- Logger.debug(`CheLoginPage.inputPaswordEclipseCheLoginPage password: "${passw}"`);
31
+ async inputUserNameEclipseCheLoginPage(userName: string): Promise<void> {
32
+ Logger.debug(`CheLoginPage.inputUserNameEclipseCheLoginPage username: "${userName}"`);
38
33
 
39
- await this.driverHelper.enterValue(By.id('password'), passw);
34
+ await this.driverHelper.enterValue(By.id('login'), userName);
40
35
  }
41
36
 
42
- async clickEclipseCheLoginButton() {
37
+ async clickEclipseCheLoginButton(): Promise<void> {
43
38
  Logger.debug('CheLoginPage.clickEclipseCheLoginButton');
44
39
 
45
40
  await this.driverHelper.waitAndClick(By.id('submit-login'));
46
41
  }
47
-
48
- async isFirstBrokerLoginPageVisible(): Promise<boolean> {
49
- Logger.debug('CheLoginPage.waitFirstBrokerLoginPage');
50
-
51
- return await this.driverHelper.isVisible(By.id('kc-update-profile-form'));
52
- }
53
-
54
- async waitFirstBrokerLoginPage() {
55
- Logger.debug('CheLoginPage.waitFirstBrokerLoginPage');
56
-
57
- await this.driverHelper.waitVisibility(By.id('kc-update-profile-form'), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
58
- }
59
-
60
- async enterEmailFirstBrokerLoginPage(email: string) {
61
- Logger.debug(`CheLoginPage.enterEmailFirstBrokerLoginPage "${email}"`);
62
-
63
- await this.driverHelper.enterValue(By.id('email'), email);
64
- }
65
-
66
- async enterFirstNameBrokerLoginPage(firstName: string) {
67
- Logger.debug(`CheLoginPage.enterFirstNameBrokerLoginPage "${firstName}"`);
68
-
69
- await this.driverHelper.enterValue(By.id('firstName'), firstName);
70
- }
71
-
72
- async enterLastNameBrokerLoginPage(lastName: string) {
73
- Logger.debug(`CheLoginPage.enterLastNameBrokerLoginPage "${lastName}"`);
74
-
75
- await this.driverHelper.enterValue(By.id('lastName'), lastName);
76
- }
77
-
78
- async clickOnSubmitButton() {
79
- Logger.debug('CheLoginPage.clickOnSubmitButton');
80
-
81
- const submitButtonlocator: By = By.css('input[type=submit]');
82
- await this.driverHelper.waitAndClick(submitButtonlocator);
83
- }
84
-
85
- async waitDisappearanceBrokerLoginPage() {
86
- Logger.debug('CheLoginPage.waitDisappearanceBrokerLoginPage');
87
-
88
- await this.driverHelper.waitDisappearance(By.id('kc-update-profile-form'));
89
- }
90
-
91
42
  }
@@ -24,19 +24,13 @@ export class OcpLoginPage {
24
24
  constructor(
25
25
  @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
26
26
 
27
- async openLoginPageOpenShift(url: string) {
28
- Logger.debug('OcpLoginPage.openLoginPageOpenShift');
29
-
30
- await this.driverHelper.navigateToUrl(url);
31
- }
32
-
33
- async waitOpenShiftLoginWelcomePage() {
27
+ async waitOpenShiftLoginWelcomePage(): Promise<void> {
34
28
  Logger.debug('OcpLoginPage.waitOpenShiftLoginWelcomePage');
35
29
 
36
30
  await this.driverHelper.waitVisibility(By.xpath(OcpLoginPage.LOGIN_PAGE_OPENSHIFT_XPATH), TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
37
31
  }
38
32
 
39
- async clickOnLoginProviderTitle() {
33
+ async clickOnLoginProviderTitle(): Promise<void> {
40
34
  Logger.debug('OcpLoginPage.clickOnLoginProviderTitle');
41
35
 
42
36
  const loginProviderTitleLocator: By = By.xpath(`//a[text()=\'${TestConstants.TS_OCP_LOGIN_PAGE_PROVIDER_TITLE}\']`);
@@ -57,57 +51,42 @@ export class OcpLoginPage {
57
51
  return await this.driverHelper.isVisible(authorizeOpenshiftIdentityProviderPageLocator);
58
52
  }
59
53
 
60
- async waitAuthorizeOpenShiftIdentityProviderPage() {
54
+ async waitAuthorizeOpenShiftIdentityProviderPage(): Promise<void> {
61
55
  Logger.debug('OcpLoginPage.waitAuthorizeOpenShiftIdentityProviderPage');
62
56
 
63
57
  const authorizeOpenshiftIdentityProviderPageLocator: By = By.xpath('//h1[text()=\'Authorize Access\']');
64
58
  await this.driverHelper.waitVisibility(authorizeOpenshiftIdentityProviderPageLocator, TimeoutConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT);
65
59
  }
66
60
 
67
- async clickOnApproveAuthorizeAccessButton() {
61
+ async clickOnApproveAuthorizeAccessButton(): Promise<void> {
68
62
  Logger.debug('OcpLoginPage.clickOnApproveAuthorizeAccessOpenshift');
69
63
 
70
64
  const approveAuthorizeAccessOcpLocator: By = By.css('input[name=\'approve\']');
71
65
  await this.driverHelper.waitAndClick(approveAuthorizeAccessOcpLocator);
72
66
  }
73
67
 
74
- async enterUserNameOpenShift(userName: string) {
68
+ async enterUserNameOpenShift(userName: string): Promise<void> {
75
69
  Logger.debug(`OcpLoginPage.enterUserNameOpenShift "${userName}"`);
76
70
 
77
71
  await this.driverHelper.enterValue(By.id('inputUsername'), userName);
78
72
  }
79
73
 
80
- async enterPasswordOpenShift(passw: string) {
74
+ async enterPasswordOpenShift(passw: string): Promise<void> {
81
75
  Logger.debug(`OcpLoginPage.enterPasswordOpenShift"`);
82
76
 
83
77
  await this.driverHelper.enterValue(By.id('inputPassword'), passw);
84
78
  }
85
79
 
86
- async clickOnLoginButton() {
80
+ async clickOnLoginButton(): Promise<void> {
87
81
  Logger.debug('OcpLoginPage.clickOnLoginButton');
88
82
 
89
83
  const loginButtonlocator: By = By.css('button[type=submit]');
90
84
  await this.driverHelper.waitAndClick(loginButtonlocator);
91
85
  }
92
86
 
93
- async waitDisappearanceOpenShiftLoginWelcomePage() {
87
+ async waitDisappearanceOpenShiftLoginWelcomePage(): Promise<void> {
94
88
  Logger.debug('OcpLoginPage.waitDisappearanceOpenShiftLoginWelcomePage');
95
89
 
96
90
  await this.driverHelper.waitDisappearance(By.xpath(OcpLoginPage.LOGIN_PAGE_OPENSHIFT_XPATH));
97
91
  }
98
-
99
- async isLinkAccountPageVisible(): Promise<boolean> {
100
- Logger.debug('OcpLoginPage.isLinkAccountPageVisible');
101
-
102
- const linkAccountLocator: By = By.id(`linkAccount`);
103
- return await this.driverHelper.waitVisibilityBoolean(linkAccountLocator, 3, 5000);
104
- }
105
-
106
- async clickOnLinkAccountButton() {
107
- Logger.debug('OcpLoginPage.clickOnLinkAccountButton');
108
-
109
- const linkAccountLocator: By = By.id(`linkAccount`);
110
- this.driverHelper.waitAndClick(linkAccountLocator);
111
- }
112
-
113
92
  }
@@ -25,31 +25,31 @@ const testWorkspaceUtil: ITestWorkspaceUtil = e2eContainer.get(TYPES.WorkspaceUt
25
25
 
26
26
  let latestWorkspace: string = '';
27
27
 
28
- export function registerRunningWorkspace(workspaceName: string) {
28
+ export function registerRunningWorkspace(workspaceName: string): void {
29
29
  Logger.debug(`MochaHooks.registerRunningWorkspace with workspaceName:${workspaceName}`);
30
30
  latestWorkspace = workspaceName;
31
31
  }
32
32
 
33
33
  exports.mochaHooks = {
34
34
  beforeAll: [
35
- async function enableRequestInterceptor() {
35
+ async function enableRequestInterceptor(): Promise<void> {
36
36
  if (TestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
37
- CheApiRequestHandler.enableRequestInteceptor();
37
+ CheApiRequestHandler.enableRequestInterceptor();
38
38
  }
39
39
  },
40
- async function enableResponseInterceptor() {
40
+ async function enableResponseInterceptor(): Promise<void> {
41
41
  if (TestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
42
42
  CheApiRequestHandler.enableResponseInterceptor();
43
43
  }
44
44
  },
45
- async function initMonacoPageObjects() {
45
+ async function initMonacoPageObjects(): Promise<void> {
46
46
  // init vscode-extension-tester monaco-page-objects
47
47
  monacoPageObjects.initPageObjects(TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driverHelper.getDriver(), 'google-chrome');
48
48
  },
49
- async function prolongTimeoutConstantsInDebugMode() {
50
- if (TestConstants.TS_DEBUG_MODE === 'true') {
49
+ async function prolongTimeoutConstantsInDebugMode(): Promise<void> {
50
+ if (TestConstants.TS_DEBUG_MODE) {
51
51
  for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
52
- Object.defineProperty(TimeoutConstants, timeout, {value: seconds * 100});
52
+ Object.defineProperty(TimeoutConstants, timeout, {value: seconds as number * 100});
53
53
  }
54
54
  }
55
55
  },
@@ -62,7 +62,7 @@ exports.mochaHooks = {
62
62
  testWorkspaceUtil.stopAndDeleteWorkspaceByName(latestWorkspace);
63
63
  }
64
64
  },
65
- async function stopTheDriver() {
65
+ async function stopTheDriver(): Promise<void> {
66
66
  if (!TestConstants.TS_DEBUG_MODE) {
67
67
  await driverHelper.getDriver().quit();
68
68
  Logger.info('Chrome driver session stopped.');
@@ -0,0 +1,50 @@
1
+ /*********************************************************************
2
+ * Copyright (c) 2023 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
+ import { SideBarView, ViewSection } from 'monaco-page-objects';
11
+ import { ProjectAndFileTests } from '../tests-library/ProjectAndFileTests';
12
+ import { CLASSES } from '../configs/inversify.types';
13
+ import { e2eContainer } from '../configs/inversify.config';
14
+ import { WorkspaceHandlingTests } from '../tests-library/WorkspaceHandlingTests';
15
+ import { registerRunningWorkspace } from './MochaHooks';
16
+ import { Logger } from '../utils/Logger';
17
+ import { LoginTests } from '../tests-library/LoginTests';
18
+
19
+ const factoryUrl: string = 'https://github.com/che-incubator/quarkus-api-example.git';
20
+ const projectName: string = 'quarkus-api-example';
21
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
22
+ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
23
+ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
24
+
25
+ suite(`The SmokeTest userstory`, async function (): Promise<void> {
26
+ let projectSection: ViewSection;
27
+ suite(`Create workspace from factory:${factoryUrl}`, async function (): Promise<void> {
28
+ loginTests.loginIntoChe();
29
+ workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
30
+ workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
31
+ test('Register running workspace', async () => {
32
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
33
+ });
34
+ test('Wait workspace readiness', async function (): Promise<void> {
35
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
36
+ });
37
+ test('Check a project folder has been created', async function (): Promise<void> {
38
+ projectSection = await new SideBarView().getContent().getSection(projectName);
39
+ Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
40
+ });
41
+ test('Check the project files was imported', async function (): Promise<void> {
42
+ const label: string = 'devfile.yaml';
43
+ await projectSection.findItem(label);
44
+ Logger.debug(`projectSection.findItem: find ${label}`);
45
+ });
46
+ test('Stopping and deleting the workspace', async function (): Promise<void> {
47
+ await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
48
+ });
49
+ });
50
+ });
@@ -47,5 +47,6 @@ suite(`${stackName} test`, async () => {
47
47
  test(`Stop and remove workspace`, async () => {
48
48
  await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
49
49
  });
50
+ loginTests.logoutFromChe();
50
51
  });
51
52
  });
@@ -0,0 +1,52 @@
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 { SideBarView, ViewSection } from 'monaco-page-objects';
12
+ import { registerRunningWorkspace } from '../MochaHooks';
13
+ import { LoginTests } from '../../tests-library/LoginTests';
14
+ import { e2eContainer } from '../../configs/inversify.config';
15
+ import { CLASSES } from '../../configs/inversify.types';
16
+ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
17
+ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
18
+ import { Logger } from '../../utils/Logger';
19
+
20
+ const stackName: string = 'Java 11 with Quarkus';
21
+ const projectName: string = 'quarkus-quickstarts';
22
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
23
+ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
24
+ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
25
+
26
+ suite(`The ${stackName} userstory`, async function (): Promise<void> {
27
+ let projectSection: ViewSection;
28
+ suite(`Create workspace from ${stackName} simple`, async function (): Promise<void> {
29
+ loginTests.loginIntoChe();
30
+ workspaceHandlingTests.createAndOpenWorkspace(stackName);
31
+ workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
32
+ test('Register running workspace', async () => {
33
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
34
+ });
35
+ test('Wait workspace readiness', async function (): Promise<void> {
36
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
37
+ });
38
+ test('Check a project folder has been created', async function (): Promise<void> {
39
+ projectSection = await new SideBarView().getContent().getSection(projectName);
40
+ Logger.debug(`new SideBarView().getContent().getSection: get ${projectName}`);
41
+ });
42
+ test('Check the project files was imported', async function (): Promise<void> {
43
+ const label: string = 'devfile.yaml';
44
+ await projectSection.findItem(label);
45
+ Logger.debug(`projectSection.findItem: find ${label}`);
46
+ });
47
+ test('Stopping and deleting the workspace', async function (): Promise<void> {
48
+ await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
49
+ });
50
+ loginTests.logoutFromChe();
51
+ });
52
+ });
@@ -0,0 +1,199 @@
1
+ /*********************************************************************
2
+ * Copyright (c) 2021 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 'reflect-metadata';
12
+
13
+ import { e2eContainer } from '../../configs/inversify.config';
14
+ import {
15
+ ActivityBar,
16
+ ContextMenu,
17
+ EditorView,
18
+ Locators,
19
+ ModalDialog,
20
+ NewScmView,
21
+ SideBarView,
22
+ SingleScmProvider,
23
+ TextEditor,
24
+ ViewControl,
25
+ ViewItem,
26
+ ViewSection
27
+ } from 'monaco-page-objects';
28
+ import { TestConstants } from '../../constants/TestConstants';
29
+ import { expect } from 'chai';
30
+ import { OauthPage } from '../../pageobjects/git-providers/OauthPage';
31
+ import { GitUtil } from '../../utils/vsc/GitUtil';
32
+ import { CheCodeLocatorLoader } from '../../pageobjects/ide/CheCodeLocatorLoader';
33
+ import { registerRunningWorkspace } from '../MochaHooks';
34
+ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
35
+ import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests';
36
+ import { CLASSES } from '../../configs/inversify.types';
37
+ import { DriverHelper } from '../../utils/DriverHelper';
38
+ import { ProjectAndFileTests } from '../../tests-library/ProjectAndFileTests';
39
+ import { Logger } from '../../utils/Logger';
40
+ import { LoginTests } from '../../tests-library/LoginTests';
41
+
42
+ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
43
+ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
44
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
45
+ const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
46
+ const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
47
+
48
+ const webCheCodeLocators: Locators = new CheCodeLocatorLoader().webCheCodeLocators;
49
+
50
+ suite(`Create a workspace via launching a factory from the ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} repository`, async function (): Promise<void> {
51
+ const oauthPage: OauthPage = new OauthPage(driverHelper);
52
+
53
+ let projectSection: ViewSection;
54
+ let scmProvider: SingleScmProvider;
55
+ let rest: SingleScmProvider[];
56
+ let scmContextMenu: ContextMenu;
57
+ const gitUtilCheCode: GitUtil = new GitUtil();
58
+
59
+ // test specific data
60
+ const timeToRefresh: number = 1500;
61
+ const changesToCommit: string = (new Date()).getTime().toString();
62
+ const fileToChange: string = 'Date.txt';
63
+ const commitChangesButtonLabel: string = `Commit Changes on "${TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}"`;
64
+ const refreshButtonLabel: string = 'Refresh';
65
+ const pushItemLabel: string = 'Push';
66
+ const testRepoProjectName: string = gitUtilCheCode.getProjectNameFromGitUrl(TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_URL);
67
+
68
+ loginTests.loginIntoChe();
69
+ test(`Navigate to the factory URL`, async function (): Promise<void> {
70
+ await browserTabsUtil.navigateTo(TestConstants.TS_SELENIUM_FACTORY_URL());
71
+ });
72
+
73
+ if (TestConstants.TS_SELENIUM_GIT_PROVIDER_OAUTH) {
74
+ test(`Authorize with a ${TestConstants.TS_SELENIUM_FACTORY_GIT_PROVIDER} OAuth`, async function (): Promise<void> {
75
+ await oauthPage.login();
76
+ await oauthPage.waitOauthPage();
77
+ await oauthPage.confirmAccess();
78
+ });
79
+ }
80
+
81
+ workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
82
+
83
+ test('Registering the running workspace', async function (): Promise<void> {
84
+ registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
85
+ });
86
+
87
+ test('Wait the workspace readiness', async function (): Promise<void> {
88
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
89
+ });
90
+
91
+ test('Check if a project folder has been created', async function (): Promise<void> {
92
+ Logger.debug(`new SideBarView().getContent().getSection: get ${testRepoProjectName}`);
93
+ projectSection = await new SideBarView().getContent().getSection(testRepoProjectName as unknown as string);
94
+ });
95
+
96
+ test('Check if the project files were imported', async function (): Promise<void> {
97
+ const label: string = TestConstants.TS_SELENIUM_PROJECT_ROOT_FILE_NAME;
98
+ Logger.debug(`projectSection.findItem: find ${label}`);
99
+ const isFileImported: ViewItem | undefined = await projectSection.findItem(label);
100
+ expect(isFileImported).not.eqls(undefined);
101
+ });
102
+
103
+ test('Accept the project as a trusted one', async function (): Promise<void> {
104
+ const buttonYesITrustTheAuthors: string = `Yes, I trust the authors`;
105
+ const trustedProjectDialog: ModalDialog = new ModalDialog();
106
+ await driverHelper.waitVisibility(webCheCodeLocators.WelcomeContent.button);
107
+ Logger.debug(`trustedProjectDialog.pushButton: "${buttonYesITrustTheAuthors}"`);
108
+ await trustedProjectDialog.pushButton(buttonYesITrustTheAuthors);
109
+ });
110
+
111
+ test('Make changes to the file', async function (): Promise<void> {
112
+ Logger.debug(`projectSection.openItem: "${fileToChange}"`);
113
+ await projectSection.openItem(fileToChange);
114
+ const editor: TextEditor = await new EditorView().openEditor(fileToChange) as TextEditor;
115
+ await driverHelper.waitVisibility(webCheCodeLocators.Editor.inputArea);
116
+ Logger.debug(`editor.clearText`);
117
+ await editor.clearText();
118
+ Logger.debug(`editor.typeTextAt: "${changesToCommit}"`);
119
+ await editor.typeTextAt(1, 1, changesToCommit);
120
+ });
121
+
122
+ test('Open a source control manager', async function (): Promise<void> {
123
+ const viewSourceControl: string = `Source Control`;
124
+ const sourceControl: ViewControl = await new ActivityBar().getViewControl(viewSourceControl) as ViewControl;
125
+ Logger.debug(`sourceControl.openView: "${viewSourceControl}"`);
126
+ await sourceControl.openView();
127
+ const scmView: NewScmView = new NewScmView();
128
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
129
+ [scmProvider, ...rest] = await scmView.getProviders();
130
+ Logger.debug(`scmView.getProviders: "${scmProvider}, ${scmProvider}"`);
131
+ });
132
+
133
+ test('Check if the changes is displayed in the source control manager', async function (): Promise<void> {
134
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
135
+ await driverHelper.wait(timeToRefresh);
136
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
137
+ await scmProvider.takeAction(refreshButtonLabel);
138
+ // wait while changes counter will be refreshed
139
+ await driverHelper.wait(timeToRefresh);
140
+ const changes: number = await scmProvider.getChangeCount();
141
+ Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
142
+ expect(changes).eql(1);
143
+ });
144
+
145
+ test('Stage the changes', async function (): Promise<void> {
146
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
147
+ Logger.debug(`scmProvider.openMoreActions`);
148
+ scmContextMenu = await scmProvider.openMoreActions();
149
+ await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.contextView);
150
+ Logger.debug(`scmContextMenu.select: "Changes" -> "Stage All Changes"`);
151
+ await scmContextMenu.select('Changes', 'Stage All Changes');
152
+ });
153
+
154
+ test('Commit the changes', async function (): Promise<void> {
155
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel));
156
+ Logger.debug(`scmProvider.commitChanges: commit name "Commit ${changesToCommit}"`);
157
+ await scmProvider.commitChanges('Commit ' + changesToCommit);
158
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
159
+ await driverHelper.wait(timeToRefresh);
160
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
161
+ await scmProvider.takeAction(refreshButtonLabel);
162
+ // wait while changes counter will be refreshed
163
+ await driverHelper.wait(timeToRefresh);
164
+ const changes: number = await scmProvider.getChangeCount();
165
+ Logger.debug(`scmProvider.getChangeCount: number of changes is "${changes}"`);
166
+ expect(changes).eql(0);
167
+ });
168
+
169
+ test('Push the changes', async function (): Promise<void> {
170
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.actionConstructor(`Push 1 commits to origin/${TestConstants.TS_SELENIUM_FACTORY_GIT_REPO_BRANCH}`));
171
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
172
+ Logger.debug(`scmProvider.openMoreActions`);
173
+ scmContextMenu = await scmProvider.openMoreActions();
174
+ await driverHelper.waitVisibility(webCheCodeLocators.ContextMenu.itemConstructor(pushItemLabel));
175
+ Logger.debug(`scmContextMenu.select: "${pushItemLabel}"`);
176
+ await scmContextMenu.select(pushItemLabel);
177
+ });
178
+
179
+ test('Check if the changes were pushed', async function (): Promise<void> {
180
+ await driverHelper.waitVisibility(webCheCodeLocators.ScmView.more);
181
+ await driverHelper.wait(timeToRefresh);
182
+ Logger.debug(`scmProvider.takeAction: "${refreshButtonLabel}"`);
183
+ await scmProvider.takeAction(refreshButtonLabel);
184
+ const isCommitButtonDisabled: string = await driverHelper.waitAndGetElementAttribute(webCheCodeLocators.ScmView.actionConstructor(commitChangesButtonLabel), 'aria-disabled');
185
+ expect(isCommitButtonDisabled).eql('true');
186
+ });
187
+
188
+ test(`Stop and remove the workspace`, async function (): Promise<void> {
189
+ await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
190
+ });
191
+
192
+ loginTests.logoutFromChe();
193
+
194
+ suiteTeardown('Close the browser', async function (): Promise<void> {
195
+ if (!TestConstants.TS_DEBUG_MODE) {
196
+ await driverHelper.getDriver().close();
197
+ }
198
+ });
199
+ });