@eclipse-che/che-e2e 7.43.0 → 7.44.1-dev-bc873f3

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 (85) hide show
  1. package/README.md +16 -1
  2. package/dist/driver/CheReporter.js +4 -4
  3. package/dist/driver/CheReporter.js.map +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/pageobjects/dashboard/Dashboard.js +4 -0
  7. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  8. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +1 -1
  9. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
  10. package/dist/pageobjects/ide/Ide.js +31 -7
  11. package/dist/pageobjects/ide/Ide.js.map +1 -1
  12. package/dist/pageobjects/ide/PreviewWidget.js +6 -2
  13. package/dist/pageobjects/ide/PreviewWidget.js.map +1 -1
  14. package/dist/pageobjects/ide/ProjectTree.js +12 -11
  15. package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
  16. package/dist/tests/devfiles/DotNetCore.spec.js +1 -1
  17. package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
  18. package/dist/tests/devfiles/Go.spec.js +15 -15
  19. package/dist/tests/devfiles/Go.spec.js.map +1 -1
  20. package/dist/tests/e2e/OpenshiftConnector.spec.js +2 -2
  21. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +10 -9
  22. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
  23. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +10 -9
  24. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
  25. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +15 -14
  26. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
  27. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +17 -16
  28. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
  29. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +3 -2
  30. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
  31. package/dist/tests/plugins/JavaPlugin.spec.js +27 -23
  32. package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
  33. package/dist/tests/plugins/PythonPlugin.spec.js +10 -14
  34. package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
  35. package/dist/tests/plugins/TypescriptPlugin.spec.js +14 -22
  36. package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -1
  37. package/dist/tests/plugins/VscodeYamlPlugin.spec.js +11 -20
  38. package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
  39. package/dist/testsLibrary/CodeExecutionTests.js +1 -2
  40. package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
  41. package/dist/testsLibrary/LanguageServerTests.js +5 -12
  42. package/dist/testsLibrary/LanguageServerTests.js.map +1 -1
  43. package/dist/testsLibrary/ProjectAndFileTests.js +0 -5
  44. package/dist/testsLibrary/ProjectAndFileTests.js.map +1 -1
  45. package/dist/testsLibrary/WorkspaceHandlingTests.js +11 -7
  46. package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
  47. package/dist/utils/PreferencesHandler.js +3 -0
  48. package/dist/utils/PreferencesHandler.js.map +1 -1
  49. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +3 -15
  50. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  51. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js +3 -3
  52. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js.map +1 -1
  53. package/driver/CheReporter.ts +4 -4
  54. package/index.ts +1 -1
  55. package/mocha-all-factories.json +2 -1
  56. package/package.json +3 -3
  57. package/pageobjects/dashboard/Dashboard.ts +6 -1
  58. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +1 -1
  59. package/pageobjects/ide/Ide.ts +30 -7
  60. package/pageobjects/ide/PreviewWidget.ts +6 -2
  61. package/pageobjects/ide/ProjectTree.ts +9 -11
  62. package/tests/devfiles/DotNetCore.spec.ts +1 -1
  63. package/tests/devfiles/Go.spec.ts +15 -17
  64. package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
  65. package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +15 -13
  66. package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +15 -14
  67. package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +19 -20
  68. package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +123 -124
  69. package/tests/plugins/GitHubPullRequestPlugin.spec.ts +3 -2
  70. package/tests/plugins/JavaPlugin.spec.ts +20 -26
  71. package/tests/plugins/PythonPlugin.spec.ts +13 -17
  72. package/tests/plugins/TypescriptPlugin.spec.ts +18 -27
  73. package/tests/plugins/VscodeYamlPlugin.spec.ts +14 -24
  74. package/testsLibrary/CodeExecutionTests.ts +1 -2
  75. package/testsLibrary/LanguageServerTests.ts +4 -9
  76. package/testsLibrary/ProjectAndFileTests.ts +3 -6
  77. package/testsLibrary/WorkspaceHandlingTests.ts +8 -4
  78. package/tsconfig.json +1 -0
  79. package/tslint.json +119 -115
  80. package/utils/PreferencesHandler.ts +3 -0
  81. package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +3 -9
  82. package/utils/requestHandlers/tokens/CheMultiuserTokenHandler.ts +20 -18
  83. package/dist/utils/KeycloackUrlHandler.js +0 -30
  84. package/dist/utils/KeycloackUrlHandler.js.map +0 -1
  85. package/utils/KeycloackUrlHandler.ts +0 -32
@@ -44,7 +44,6 @@ const warningDialog: DialogWindow = e2eContainer.get(CLASSES.DialogWindow);
44
44
  const debugView: DebugView = e2eContainer.get(CLASSES.DebugView);
45
45
  const welcomeControllerJavaFileName: string = 'WelcomeController.java';
46
46
 
47
-
48
47
  const SpringAppLocators = {
49
48
  springTitleLocator: By.xpath('//div[@class=\'container-fluid\']//h2[text()=\'Welcome\']'),
50
49
  springMenuButtonLocator: By.css('button[data-target=\'#main-navbar\']'),
@@ -56,6 +55,7 @@ const SpringAppLocators = {
56
55
  // this test checks only workspace created from "web-nodejs-sample" https://github.com/devfile/devworkspace-operator/blob/main/samples/flattened_theia-next.yaml.
57
56
  suite('Workspace creation via factory url', async () => {
58
57
  let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
58
+
59
59
  const workspaceRootFolderName: string = 'src';
60
60
 
61
61
  suite('Open factory URL', async () => {
@@ -76,139 +76,138 @@ suite('Workspace creation via factory url', async () => {
76
76
  await projectTree.waitProjectImported(projectName, workspaceRootFolderName);
77
77
  });
78
78
  });
79
- });
79
+ });
80
80
 
81
- suite('Language server validation', async () => {
82
- test('Java LS initialization', async () => {
83
- await projectTree.expandPathAndOpenFile(pathToJavaFolder, javaFileName);
84
- await editor.selectTab(javaFileName);
85
- try {
86
- await ide.checkLsInitializationStart('Activating Language Support for Java');
87
- await ide.waitStatusBarTextAbsence('Activating Language Support for Java', 900_000);
88
- } catch (err) {
89
- if (!(err instanceof error.TimeoutError)) {
90
- throw err;
91
- }
92
-
93
- console.log('Known flakiness has occurred https://github.com/eclipse/che/issues/17864');
94
- await ide.waitStatusBarContains('Activating Java Test Runner');
95
- await ide.waitStatusBarTextAbsence('Activating Java Test Runner', 900_000);
81
+ suite('Language server validation', async () => {
82
+ test('Java LS initialization', async () => {
83
+ await projectTree.expandPathAndOpenFile(pathToJavaFolder, javaFileName);
84
+ await editor.selectTab(javaFileName);
85
+ try {
86
+ await ide.checkLsInitializationStart('Activating Language Support for Java');
87
+ await ide.waitStatusBarTextAbsence('Activating Language Support for Java', 900_000);
88
+ } catch (err) {
89
+ if (!(err instanceof error.TimeoutError)) {
90
+ throw err;
96
91
  }
97
92
 
98
- await checkJavaPathCompletion();
99
- });
93
+ console.log('Known flakiness has occurred https://github.com/eclipse/che/issues/17864');
94
+ await ide.waitStatusBarContains('Activating Java Test Runner');
95
+ await ide.waitStatusBarTextAbsence('Activating Java Test Runner', 900_000);
96
+ }
100
97
 
101
- test('Autocomplete', async () => {
102
- await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
103
- await editor.pressControlSpaceCombination(javaFileName);
104
- await editor.waitSuggestionContainer();
105
- await editor.waitSuggestion(javaFileName, 'SpringApplication - org.springframework.boot');
106
- });
98
+ await checkJavaPathCompletion();
99
+ });
107
100
 
108
- test('Error highlighting', async () => {
109
- await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
101
+ test('Autocomplete', async () => {
102
+ await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
103
+ await editor.pressControlSpaceCombination(javaFileName);
104
+ await editor.waitSuggestionContainer();
105
+ await editor.waitSuggestion(javaFileName, 'SpringApplication - org.springframework.boot');
106
+ });
110
107
 
111
- const textForErrorDisplaying: string = '$';
112
- await editor.type(javaFileName, textForErrorDisplaying, 30);
108
+ test('Error highlighting', async () => {
109
+ await driverHelper.getDriver().sleep(TimeoutConstants.TS_SUGGESTION_TIMEOUT); // workaround https://github.com/eclipse/che/issues/19004
113
110
 
114
- try {
115
- await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
116
- } catch (err) {
117
- Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.');
118
- await browserTabsUtil.refreshPage();
119
- await ide.waitAndSwitchToIdeFrame();
120
- await ide.waitIde();
121
- await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);
122
- }
123
- await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE));
124
- await editor.waitErrorInLineDisappearance(30, javaFileName);
125
- });
111
+ const textForErrorDisplaying: string = '$';
112
+ await editor.type(javaFileName, textForErrorDisplaying, 30);
126
113
 
127
- test('Suggestion', async () => {
128
- await editor.moveCursorToLineAndChar(javaFileName, 32, 21);
129
- await editor.pressControlSpaceCombination(javaFileName);
130
- await editor.waitSuggestionWithScrolling(javaFileName, 'run(Class<?> primarySource, String... args) : ConfigurableApplicationContext', 120_000);
131
- });
114
+ try {
115
+ await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
116
+ } catch (err) {
117
+ Logger.debug('Workaround for the https://github.com/eclipse/che/issues/18974.');
118
+ await browserTabsUtil.refreshPage();
119
+ await ide.waitIde();
120
+ await editor.waitErrorInLine(30, javaFileName, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT * 2);
121
+ }
122
+ await editor.performKeyCombination(javaFileName, Key.chord(Key.BACK_SPACE));
123
+ await editor.waitErrorInLineDisappearance(30, javaFileName);
124
+ });
132
125
 
133
- test('Codenavigation', async () => {
134
- await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
135
- await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12));
136
- await editor.waitEditorAvailable(codeNavigationClassName, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT * 4);
137
- });
138
- });
139
- suite('Validation of workspace build and run', async () => {
140
- test('Build application', async () => {
141
- const taskName: string = 'build';
142
- await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
143
- await terminal.waitIconSuccess(taskName, 500_000);
144
- });
126
+ test('Suggestion', async () => {
127
+ await editor.moveCursorToLineAndChar(javaFileName, 32, 21);
128
+ await editor.pressControlSpaceCombination(javaFileName);
129
+ await editor.waitSuggestionWithScrolling(javaFileName, 'run(Class<?> primarySource, String... args) : ConfigurableApplicationContext', 120_000);
130
+ });
145
131
 
146
- test('Run application', async () => {
147
- const taskName: string = 'run-with-hsqldb';
148
- await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
149
- await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000);
150
- // devWs specific. After running test application we can open it just in the new window.
151
- // the preview widget is not available yet.
152
- await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
153
- });
154
- // this is DevWorkspace test specific since Theia does not provide yet preview as a widget
155
- test('Check the running application', async () => {
156
- await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator);
157
- });
158
-
159
- test('Close the terminal running tasks', async () => {
160
- await terminal.rejectTerminalProcess('run-with-hsqldb');
161
- await terminal.closeTerminalTab('run-with-hsqldb');
162
- await warningDialog.waitAndCloseIfAppear();
163
- await terminal.closeTerminalTab('build');
164
- });
132
+ test('CodeNavigation', async () => {
133
+ await editor.moveCursorToLineAndChar(javaFileName, 32, 17);
134
+ await editor.performKeyCombination(javaFileName, Key.chord(Key.CONTROL, Key.F12));
135
+ await editor.waitEditorAvailable(codeNavigationClassName, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT * 4);
136
+ });
165
137
  });
166
138
 
167
- suite('Validation of debug functionality', async () => {
168
- let urlToPetClinicApp = '';
169
- test('Launch debug', async () => {
170
- const taskName: string = 'run-debug';
171
- await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
172
- await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 180_000);
173
- await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
174
- });
139
+ suite('Validation of workspace build and run', async () => {
140
+ const mavenBuildTaskName: string = 'maven-build';
141
+ const runAppTaskName: string = 'run-with-hsqldb';
142
+ test('Build application', async () => {
143
+ await topMenu.runTask(`${mavenBuildTaskName}, ${globalTaskScope}`);
144
+ await terminal.waitIconSuccess(mavenBuildTaskName, 500_000);
145
+ });
175
146
 
176
- test('Check content of the launched application', async () => {
177
- const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle();
178
- await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
179
- urlToPetClinicApp = await browserTabsUtil.getCurrentUrl();
180
- await browserTabsUtil.switchToWindow(mainWindowHandle);
181
- });
147
+ test('Run application', async () => {
148
+ await topMenu.runTask(`${runAppTaskName}, ${globalTaskScope}`);
149
+ await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 120_000);
150
+ // devWs specific. After running test application we can open it just in the new window.
151
+ // the preview widget is not available yet.
152
+ await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
153
+ });
154
+ // this is DevWorkspace test specific since Theia does not provide yet preview as a widget
155
+ test('Check the running application', async () => {
156
+ await switchAppWindowAndCheck(SpringAppLocators.springTitleLocator);
157
+ });
182
158
 
183
- test('Open debug view', async () => {
184
- await projectTree.expandPathAndOpenFile(pathToJavaFolder + '/system', welcomeControllerJavaFileName);
185
- await editor.selectTab(welcomeControllerJavaFileName);
186
- await topMenu.selectOption('View', 'Debug');
187
- await ide.waitLeftToolbarButton(LeftToolbarButton.Debug);
188
- });
159
+ test('Close the terminal running tasks', async () => {
160
+ await terminal.rejectTerminalProcess(runAppTaskName);
161
+ await terminal.closeTerminalTab(runAppTaskName);
162
+ await warningDialog.waitAndCloseIfAppear();
163
+ await terminal.closeTerminalTab(mavenBuildTaskName);
164
+ });
165
+ });
189
166
 
190
- test('Choose debug configuration', async () => {
191
- await debugView.clickOnDebugConfigurationDropDown();
192
- await debugView.clickOnDebugConfigurationItem('Debug (Attach) - Remote (java-spring-petclinic)');
193
- });
167
+ suite('Validation of debug functionality', async () => {
168
+ let urlToPetClinicApp = '';
169
+ test('Launch debug', async () => {
170
+ const taskName: string = 'run-debug';
171
+ await topMenu.runTask(`${taskName}, ${globalTaskScope}`);
172
+ await ide.waitNotification('Process 8080-tcp is now listening on port 8080. Open it ?', 180_000);
173
+ await ide.clickOnNotificationButton('Process 8080-tcp is now listening on port 8080. Open it ?', 'Open In New Tab');
174
+ });
194
175
 
195
- test('Run debug', async () => {
196
- await debugView.clickOnRunDebugButton();
197
- await waitDebugToConnect();
198
- });
176
+ test('Check content of the launched application', async () => {
177
+ const mainWindowHandle: string = await browserTabsUtil.getCurrentWindowHandle();
178
+ await browserTabsUtil.waitAndSwitchToAnotherWindow(mainWindowHandle, TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT);
179
+ urlToPetClinicApp = await browserTabsUtil.getCurrentUrl();
180
+ await browserTabsUtil.switchToWindow(mainWindowHandle);
181
+ });
199
182
 
200
- test('Activate breakpoint', async () => {
201
- await editor.selectTab(welcomeControllerJavaFileName);
202
- await editor.activateBreakpoint(welcomeControllerJavaFileName, 27);
203
- });
183
+ test('Open debug view', async () => {
184
+ await projectTree.expandPathAndOpenFile(pathToJavaFolder + '/system', welcomeControllerJavaFileName);
185
+ await editor.selectTab(welcomeControllerJavaFileName);
186
+ await topMenu.selectOption('View', 'Debug');
187
+ await ide.waitLeftToolbarButton(LeftToolbarButton.Debug);
188
+ });
204
189
 
205
- test('Check debugger stop at the breakpoint', async () => {
206
- await sendRequestToDebugApp(urlToPetClinicApp);
207
- await waitStoppedBreakpoint(27);
208
- });
190
+ test('Choose debug configuration', async () => {
191
+ await debugView.clickOnDebugConfigurationDropDown();
192
+ await debugView.clickOnDebugConfigurationItem('Debug (Attach) - Remote (java-spring-petclinic)');
193
+ });
194
+
195
+ test('Run debug', async () => {
196
+ await debugView.clickOnRunDebugButton();
197
+ await waitDebugToConnect();
198
+ });
209
199
 
200
+ test('Activate breakpoint', async () => {
201
+ await editor.selectTab(welcomeControllerJavaFileName);
202
+ await editor.activateBreakpoint(welcomeControllerJavaFileName, 27);
210
203
  });
211
204
 
205
+ test('Check debugger stop at the breakpoint', async () => {
206
+ await sendRequestToDebugApp(urlToPetClinicApp);
207
+ await waitStoppedBreakpoint(27);
208
+ });
209
+ });
210
+
212
211
  async function checkJavaPathCompletion() {
213
212
  if (await ide.isNotificationPresent('Classpath is incomplete. Only syntax errors will be reported')) {
214
213
  const classpathText: string = fs.readFileSync('./files/happy-path/petclinic-classpath.txt', 'utf8');
@@ -268,19 +267,20 @@ async function waitStoppedBreakpoint(lineNumber: number) {
268
267
  // for avoiding this problem we send http request with axios and set the request timeout. We expect that request will fail with
269
268
  // timeout error, we check it in the catch block and wait breakpoint activating in the WebDriver after this.
270
269
  async function sendRequestToDebugApp(urlToApp: string) {
271
- const httpClient = axios.create();
272
- httpClient.defaults.timeout = 1000;
270
+ const httpClient = axios.create();
271
+ httpClient.defaults.timeout = 1000;
273
272
  try {
274
273
  await httpClient.get(urlToApp);
275
274
  } catch (error) {
276
- if (error.message === 'timeout of 1000ms exceeded') {
277
- console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
278
- }
279
- else {
280
- const {data} = await httpClient.get(urlToApp);
281
- console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>'+ data)
282
- }
283
- }
275
+ if (error instanceof Error) {
276
+ if (error.message === 'timeout of 1000ms exceeded') {
277
+ console.log('>>>>The debugger is set >>>>>>>>>>>>>>>>>>> ' + error.message);
278
+ } else {
279
+ const {data} = await httpClient.get(urlToApp);
280
+ console.log('>>>>>>>seems the app. is not set under debug properly: >>>>>>>>>>>>>>' + data);
281
+ }
282
+ }
283
+ }
284
284
  }
285
285
 
286
286
  async function waitDebugToConnect() {
@@ -292,4 +292,3 @@ async function waitDebugToConnect() {
292
292
  await debugView.waitForDebuggerToConnect();
293
293
  }
294
294
  }
295
-
@@ -20,7 +20,6 @@ import { GitHubPullRequestPlugin } from '../../pageobjects/ide/plugins/GitHubPul
20
20
  import { GitLoginPage } from '../../pageobjects/third-parties/GitLoginPage';
21
21
  import { GitOauthAppsSettings } from '../../pageobjects/third-parties/GitOauthAppsSettings';
22
22
  import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
23
- import { KeycloackUrlHandler } from '../../utils/KeycloackUrlHandler';
24
23
  import { GitPlugin } from '../../pageobjects/ide/plugins/GitPlugin';
25
24
  import { TopMenu } from '../../pageobjects/ide/TopMenu';
26
25
  import { QuickOpenContainer } from '../../pageobjects/ide/QuickOpenContainer';
@@ -48,6 +47,8 @@ const branchName: string = workspaceNameHandler.generateWorkspaceName('ghPrPlug
48
47
  const projectName: string = 'Spoon-Knife';
49
48
  const oAuthAppName: string = 'eclipse-che';
50
49
  const changedFile: string = 'README.md';
50
+ // added call back url, but needs to be re-verified
51
+ const identityCallbackUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/api/oauth/callback`;
51
52
  const currentDate: string = Date.now().toString();
52
53
  let workspaceName: string;
53
54
 
@@ -66,7 +67,7 @@ suite(`The 'GitHubPullRequestPlugin' test`, async () => {
66
67
  await gitOauthAppsSettings.scrollToUpdateApplicationButton();
67
68
 
68
69
  await gitOauthAppsSettings.typeHomePageUrl(TestConstants.TS_SELENIUM_BASE_URL);
69
- await gitOauthAppsSettings.typeCallbackUrl(KeycloackUrlHandler.getIdentityCallbackUrl());
70
+ await gitOauthAppsSettings.typeCallbackUrl(identityCallbackUrl);
70
71
  await gitOauthAppsSettings.clickUpdateApplicationButton();
71
72
  });
72
73
  });
@@ -7,14 +7,12 @@
7
7
  *
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  **********************************************************************/
10
- import { WorkspaceNameHandler } from '../..';
11
10
  import 'reflect-metadata';
12
11
  import { e2eContainer } from '../../inversify.config';
13
12
  import { CLASSES } from '../../inversify.types';
14
13
  import { Ide } from '../../pageobjects/ide/Ide';
15
14
  import { TimeoutConstants } from '../../TimeoutConstants';
16
15
  import { TestConstants } from '../../TestConstants';
17
- import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
18
16
  import { Key } from 'selenium-webdriver';
19
17
  import { Editor } from '../../pageobjects/ide/Editor';
20
18
  import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
@@ -22,24 +20,24 @@ import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTest
22
20
  import { Logger } from '../../utils/Logger';
23
21
  import CheReporter from '../../driver/CheReporter';
24
22
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
23
+ import { PreferencesHandler } from '../../utils/PreferencesHandler';
25
24
 
26
25
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
27
26
  const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
28
27
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
29
28
  const ide: Ide = e2eContainer.get(CLASSES.Ide);
30
- const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
31
29
  const editor: Editor = e2eContainer.get(CLASSES.Editor);
32
- const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
30
+ const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
33
31
 
34
- const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/Java11PluginTest.yaml';
35
- const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
32
+ const devFileUrl: string = 'https://github.com/che-samples/java-guestbook/tree/devfilev2';
33
+ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
36
34
  const codeNavigationClassName: string = 'String.class';
37
- const sampleName: string = 'console-java-simple';
38
- const subRootFolder: string = 'src';
35
+ const projectName: string = 'java-guestbook';
36
+ const subRootFolder: string = 'backend';
39
37
 
40
- const fileFolderPath: string = `${sampleName}/src/main/java/org/eclipse/che/examples`;
41
- const tabTitle: string = 'HelloWorld.java';
42
- let workspaceName: string;
38
+ const fileFolderPath: string = `${projectName}/backend/src/main/java/cloudcode/guestbook/backend`;
39
+ const tabTitle: string = 'GuestBookEntry.java';
40
+ let workspaceName: string = 'java-guestbook';
43
41
 
44
42
  suite(`The 'JavaPlugin' test`, async () => {
45
43
  suite('Create workspace', async () => {
@@ -47,16 +45,12 @@ suite(`The 'JavaPlugin' test`, async () => {
47
45
  await browserTabsUtil.navigateTo(factoryUrl);
48
46
  });
49
47
 
48
+ projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
49
+
50
50
  test('Wait until created workspace is started', async () => {
51
- await ide.waitAndSwitchToIdeFrame();
52
- workspaceName = await workspaceNameHandler.getNameFromUrl();
53
51
  CheReporter.registerRunningWorkspace(workspaceName);
54
52
 
55
- await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
56
- await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
57
-
58
- await projectTree.openProjectTreeContainer();
59
- await projectTree.waitProjectImported(sampleName, subRootFolder);
53
+ await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
60
54
  });
61
55
  });
62
56
 
@@ -66,28 +60,28 @@ suite(`The 'JavaPlugin' test`, async () => {
66
60
  });
67
61
 
68
62
  suite('Language server validation', async () => {
69
- test('Wait until Java LS is initialised', async () => {
63
+ test('Wait until Java LS is initialized', async () => {
70
64
  await ide.checkLsInitializationStart('Activating');
71
65
  await ide.waitStatusBarTextAbsence('Activating', 900_000);
72
66
  });
73
67
 
74
68
  test('Autocomplete', async () => {
75
- await editor.moveCursorToLineAndChar(tabTitle, 10, 20);
69
+ await editor.moveCursorToLineAndChar(tabTitle, 15, 1);
76
70
  await editor.pressControlSpaceCombination(tabTitle);
77
71
  await editor.waitSuggestionContainer();
78
- await editor.waitSuggestion(tabTitle, 'close() : void');
72
+ await editor.waitSuggestion(tabTitle, 'clone() : Object');
79
73
  });
80
74
 
81
75
  test('Error highlighting', async () => {
82
76
  const textForErrorDisplaying: string = '$';
83
- await editor.type(tabTitle, textForErrorDisplaying, 10);
84
- await editor.waitErrorInLine(10, tabTitle, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
77
+ await editor.type(tabTitle, textForErrorDisplaying, 15);
78
+ await editor.waitErrorInLine(15, tabTitle, TimeoutConstants.TS_ERROR_HIGHLIGHTING_TIMEOUT);
85
79
  await editor.performKeyCombination(tabTitle, Key.chord(Key.BACK_SPACE));
86
- await editor.waitErrorInLineDisappearance(10, tabTitle);
80
+ await editor.waitErrorInLineDisappearance(15, tabTitle);
87
81
  });
88
82
 
89
- test('Codenavigation', async () => {
90
- await editor.moveCursorToLineAndChar(tabTitle, 9, 12);
83
+ test('CodeNavigation', async () => {
84
+ await editor.moveCursorToLineAndChar(tabTitle, 9, 14);
91
85
  await editor.performKeyCombination(tabTitle, Key.chord(Key.CONTROL, Key.F12));
92
86
  await editor.waitEditorAvailable(codeNavigationClassName, 60_000);
93
87
  });
@@ -10,7 +10,6 @@
10
10
  import 'reflect-metadata';
11
11
  import { e2eContainer } from '../../inversify.config';
12
12
  import { CLASSES } from '../../inversify.types';
13
- import { Ide } from '../../pageobjects/ide/Ide';
14
13
  import { TimeoutConstants } from '../../TimeoutConstants';
15
14
  import { TestConstants } from '../../TestConstants';
16
15
  import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
@@ -20,23 +19,24 @@ import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTest
20
19
  import { Logger } from '../../utils/Logger';
21
20
  import CheReporter from '../../driver/CheReporter';
22
21
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
23
- import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
22
+ import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
23
+ import { PreferencesHandler } from '../../utils/PreferencesHandler';
24
24
 
25
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
25
26
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
26
27
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
27
- const ide: Ide = e2eContainer.get(CLASSES.Ide);
28
28
  const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
29
29
  const editor: Editor = e2eContainer.get(CLASSES.Editor);
30
- const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
30
+ const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
31
31
 
32
- const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/PythonPluginTest.yaml';
33
- const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
34
- const sampleName: string = 'python-hello-world';
35
- const subRootFile: string = 'README.md';
32
+ const devFileUrl: string = 'https://github.com/che-samples/python-hello-world/tree/devfilev2';
33
+ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devFileUrl}`;
34
+ const projectName: string = 'python-hello-world';
35
+ const subRootFolder: string = '.vscode';
36
36
 
37
- const fileFolderPath: string = `${sampleName}`;
37
+ const fileFolderPath: string = `${projectName}`;
38
38
  const tabTitle: string = 'hello-world.py';
39
- let workspaceName: string;
39
+ let workspaceName: string = 'python-hello-world';
40
40
 
41
41
  suite(`The 'PythonPlugin' test`, async () => {
42
42
  suite('Create workspace', async () => {
@@ -44,16 +44,12 @@ suite(`The 'PythonPlugin' test`, async () => {
44
44
  await browserTabsUtil.navigateTo(factoryUrl);
45
45
  });
46
46
 
47
+ projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
48
+
47
49
  test('Wait until created workspace is started', async () => {
48
- await ide.waitAndSwitchToIdeFrame();
49
- workspaceName = await workspaceNameHandler.getNameFromUrl();
50
50
  CheReporter.registerRunningWorkspace(workspaceName);
51
51
 
52
- await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
53
- await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
54
-
55
- await projectTree.openProjectTreeContainer();
56
- await projectTree.waitProjectImported(sampleName, subRootFile);
52
+ await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
57
53
  });
58
54
  });
59
55
 
@@ -24,8 +24,10 @@ import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
24
24
  import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
25
25
  import { Logger } from '../../utils/Logger';
26
26
  import CheReporter from '../../driver/CheReporter';
27
- import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
27
+ import { PreferencesHandler } from '../../utils/PreferencesHandler';
28
+ import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
28
29
 
30
+ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
29
31
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
30
32
  const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
31
33
  const ide: Ide = e2eContainer.get(CLASSES.Ide);
@@ -35,20 +37,19 @@ const topMenu: TopMenu = e2eContainer.get(CLASSES.TopMenu);
35
37
  const debugView: DebugView = e2eContainer.get(CLASSES.DebugView);
36
38
  const terminal: Terminal = e2eContainer.get(CLASSES.Terminal);
37
39
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
38
- const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
40
+ const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
39
41
 
40
- const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/TypescriptNodeDebug2PluginTest.yaml';
42
+ const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/typescript-plugin';
41
43
  const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
42
44
  const codeNavigationClassName: string = 'OpenDefinition.ts';
43
- const projectName: string = 'nodejs-web-app';
45
+ const projectName: string = 'web-nodejs-sample';
44
46
  const subRootFolder: string = 'app';
45
47
  const sampleBodyLocator: By = By.xpath(`//body[text()='Hello World!']`);
46
-
47
48
  const fileFolderPath: string = `${projectName}`;
48
49
  const debugFileFolderPath: string = `${projectName}/app`;
49
50
  const debugFile: string = 'app.js';
50
51
  const tabTitle: string = 'typescript-node-debug.ts';
51
- let workspaceName: string;
52
+ let workspaceName: string = 'typescript-plugin';
52
53
 
53
54
  suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
54
55
  suite('Create workspace', async () => {
@@ -56,16 +57,12 @@ suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
56
57
  await browserTabsUtil.navigateTo(factoryUrl);
57
58
  });
58
59
 
60
+ projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
61
+
59
62
  test('Wait until created workspace is started', async () => {
60
- await ide.waitAndSwitchToIdeFrame();
61
- workspaceName = await workspaceNameHandler.getNameFromUrl();
62
63
  CheReporter.registerRunningWorkspace(workspaceName);
63
64
 
64
- await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
65
- await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
66
-
67
- await projectTree.openProjectTreeContainer();
68
- await projectTree.waitProjectImported(projectName, subRootFolder);
65
+ await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
69
66
  });
70
67
  });
71
68
 
@@ -106,15 +103,15 @@ suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
106
103
  let currentWindow: string = '';
107
104
  let applicationPreviewWindow: string = '';
108
105
 
109
- test('Run application in debug mode', async () => {
110
- await topMenu.runTask('run the web app (debugging enabled), Global');
111
- await ide.waitNotification('Process nodejs is now listening on port 3000.');
112
-
106
+ test('Open application in the new editor window', async () => {
113
107
  currentWindow = await browserTabsUtil.getCurrentWindowHandle();
114
- });
115
108
 
116
- test('Open application in the new editor window', async () => {
117
- await ide.clickOnNotificationButton('Process nodejs is now listening on port 3000.', 'Open In New Tab');
109
+ await topMenu.runTask('run-the-web-app, Global');
110
+ await ide.waitNotification('A new process is now listening on port 3000', TimeoutConstants.TS_DEBUGGER_CONNECTION_TIMEOUT);
111
+ await ide.clickOnNotificationButton('A new process is now listening on port 3000', 'yes');
112
+
113
+ await ide.waitNotification('Redirect is now enabled on port 3000.', TimeoutConstants.TS_DEBUGGER_CONNECTION_TIMEOUT);
114
+ await ide.clickOnNotificationButton('Redirect is now enabled on port 3000.', 'Open In New Tab');
118
115
  await browserTabsUtil.waitAndSwitchToAnotherWindow(currentWindow, 60_000);
119
116
  await browserTabsUtil.waitContentAvailableInTheNewTab(sampleBodyLocator, 60_000);
120
117
 
@@ -123,7 +120,6 @@ suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
123
120
 
124
121
  test('Switch back to the IDE window', async () => {
125
122
  await browserTabsUtil.switchToWindow(currentWindow);
126
- await ide.waitAndSwitchToIdeFrame(60_000);
127
123
  });
128
124
 
129
125
  test('Activate breakpoint', async () => {
@@ -135,12 +131,8 @@ suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
135
131
  await topMenu.selectOption('View', 'Debug');
136
132
  await ide.waitLeftToolbarButton(LeftToolbarButton.Debug);
137
133
 
138
- // workaround for the issue: https://github.com/eclipse/che/issues/20067
139
- await debugView.clickOnDebugConfigurationDropDown();
140
- await debugView.clickOnDebugConfigurationItem('Add Configuration...');
141
-
142
134
  await debugView.clickOnDebugConfigurationDropDown();
143
- await debugView.clickOnDebugConfigurationItem('Attach to Remote (nodejs-web-app)');
135
+ await debugView.clickOnDebugConfigurationItem('Attach (web-nodejs-sample)');
144
136
  await debugView.clickOnRunDebugButton();
145
137
  });
146
138
 
@@ -160,7 +152,6 @@ suite(`The 'TypescriptPlugin and Node-debug' tests`, async () => {
160
152
 
161
153
  test('Check breakpoint stopped', async () => {
162
154
  await browserTabsUtil.switchToWindow(currentWindow);
163
- await ide.waitAndSwitchToIdeFrame(60000);
164
155
 
165
156
  await editor.waitStoppedDebugBreakpoint(debugFile, 19, 60_000);
166
157
  });