@eclipse-che/che-e2e 7.45.0 → 7.46.1-dev-5e33fd3

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 (127) hide show
  1. package/dist/driver/CheReporter.js +2 -5
  2. package/dist/driver/CheReporter.js.map +1 -1
  3. package/dist/pageobjects/dashboard/Dashboard.js +2 -11
  4. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  5. package/dist/pageobjects/ide/ProjectTree.js +12 -6
  6. package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
  7. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +2 -10
  8. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -1
  9. package/dist/tests/devfiles/DevfileSmoke.spec.js +2 -10
  10. package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -1
  11. package/dist/tests/devfiles/DotNetCore.spec.js +2 -10
  12. package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
  13. package/dist/tests/devfiles/Go.spec.js +2 -10
  14. package/dist/tests/devfiles/Go.spec.js.map +1 -1
  15. package/dist/tests/devfiles/JavaMaven.spec.js +2 -10
  16. package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -1
  17. package/dist/tests/devfiles/JavaSpringBoot.spec.js +2 -10
  18. package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -1
  19. package/dist/tests/devfiles/JavaVertx.spec.js +2 -10
  20. package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -1
  21. package/dist/tests/devfiles/NodeJS.spec.js +2 -10
  22. package/dist/tests/devfiles/NodeJS.spec.js.map +1 -1
  23. package/dist/tests/devfiles/PHPSimple.spec.js +2 -10
  24. package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -1
  25. package/dist/tests/devfiles/Python.spec.js +2 -10
  26. package/dist/tests/devfiles/Python.spec.js.map +1 -1
  27. package/dist/tests/devfiles/PythonDjango.spec.js +2 -10
  28. package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -1
  29. package/dist/tests/devfiles/Quarkus.spec.js +2 -10
  30. package/dist/tests/devfiles/Quarkus.spec.js.map +1 -1
  31. package/dist/tests/devfiles/Scala.spec.js +2 -10
  32. package/dist/tests/devfiles/Scala.spec.js.map +1 -1
  33. package/dist/tests/e2e/FactoryUrl.spec.js +4 -9
  34. package/dist/tests/e2e/FactoryUrl.spec.js.map +1 -1
  35. package/dist/tests/e2e/GitPublishBranch.spec.js +2 -5
  36. package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -1
  37. package/dist/tests/e2e/GitSelfSignCert.spec.js +2 -0
  38. package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -1
  39. package/dist/tests/e2e/GitSsh.spec.js +3 -6
  40. package/dist/tests/e2e/GitSsh.spec.js.map +1 -1
  41. package/dist/tests/e2e/OpenshiftConnector.spec.js +2 -5
  42. package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -1
  43. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +3 -7
  44. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
  45. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +3 -7
  46. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
  47. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +3 -7
  48. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
  49. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +2 -2
  50. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
  51. package/dist/tests/e2e_happy_path/HappyPath.spec.js +13 -13
  52. package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +1 -1
  53. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js +2 -6
  54. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +1 -1
  55. package/dist/tests/load_test/LoadTest.spec.js +2 -5
  56. package/dist/tests/load_test/LoadTest.spec.js.map +1 -1
  57. package/dist/tests/login/LinkCheAndOcpUsers.spec.js +2 -2
  58. package/dist/tests/login/LinkCheAndOcpUsers.spec.js.map +1 -1
  59. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +4 -9
  60. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
  61. package/dist/tests/plugins/InstallPluginUsingUI.spec.js +4 -10
  62. package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +1 -1
  63. package/dist/tests/plugins/JavaPlugin.spec.js +4 -8
  64. package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
  65. package/dist/tests/plugins/PhpPlugin.spec.js +12 -10
  66. package/dist/tests/plugins/PhpPlugin.spec.js.map +1 -1
  67. package/dist/tests/plugins/PythonPlugin.spec.js +4 -8
  68. package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
  69. package/dist/tests/plugins/TypescriptPlugin.spec.js +4 -8
  70. package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -1
  71. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +3 -10
  72. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +1 -1
  73. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +3 -10
  74. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +1 -1
  75. package/dist/tests/plugins/VscodeValePlugin.spec.js +3 -10
  76. package/dist/tests/plugins/VscodeValePlugin.spec.js.map +1 -1
  77. package/dist/tests/plugins/VscodeXmlPlugin.spec.js +3 -10
  78. package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -1
  79. package/dist/tests/plugins/VscodeYamlPlugin.spec.js +4 -8
  80. package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
  81. package/dist/testsLibrary/CodeExecutionTests.js +14 -2
  82. package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
  83. package/dist/testsLibrary/WorkspaceHandlingTests.js +68 -11
  84. package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
  85. package/driver/CheReporter.ts +2 -8
  86. package/package.json +2 -2
  87. package/pageobjects/dashboard/Dashboard.ts +1 -8
  88. package/pageobjects/ide/ProjectTree.ts +13 -8
  89. package/tests/devfiles/CSlashCPlusPlus.spec.ts +2 -9
  90. package/tests/devfiles/DevfileSmoke.spec.ts +2 -9
  91. package/tests/devfiles/DotNetCore.spec.ts +2 -9
  92. package/tests/devfiles/Go.spec.ts +2 -7
  93. package/tests/devfiles/JavaMaven.spec.ts +2 -9
  94. package/tests/devfiles/JavaSpringBoot.spec.ts +2 -9
  95. package/tests/devfiles/JavaVertx.spec.ts +2 -9
  96. package/tests/devfiles/NodeJS.spec.ts +2 -9
  97. package/tests/devfiles/PHPSimple.spec.ts +2 -9
  98. package/tests/devfiles/Python.spec.ts +2 -9
  99. package/tests/devfiles/PythonDjango.spec.ts +2 -9
  100. package/tests/devfiles/Quarkus.spec.ts +2 -9
  101. package/tests/devfiles/Scala.spec.ts +2 -10
  102. package/tests/e2e/FactoryUrl.spec.ts +4 -8
  103. package/tests/e2e/GitPublishBranch.spec.ts +2 -2
  104. package/tests/e2e/GitSelfSignCert.spec.ts +66 -65
  105. package/tests/e2e/GitSsh.spec.ts +3 -3
  106. package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
  107. package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +2 -5
  108. package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +2 -5
  109. package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +2 -5
  110. package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +2 -2
  111. package/tests/e2e_happy_path/HappyPath.spec.ts +13 -10
  112. package/tests/intelij/IntelijOpenWorkspace.spec.ts +2 -4
  113. package/tests/load_test/LoadTest.spec.ts +2 -2
  114. package/tests/login/LinkCheAndOcpUsers.spec.ts +4 -3
  115. package/tests/plugins/GitHubPullRequestPlugin.spec.ts +4 -7
  116. package/tests/plugins/InstallPluginUsingUI.spec.ts +4 -9
  117. package/tests/plugins/JavaPlugin.spec.ts +4 -6
  118. package/tests/plugins/PhpPlugin.spec.ts +3 -9
  119. package/tests/plugins/PythonPlugin.spec.ts +4 -6
  120. package/tests/plugins/TypescriptPlugin.spec.ts +4 -6
  121. package/tests/plugins/VscodeKubernetesPlugin.spec.ts +3 -9
  122. package/tests/plugins/VscodeShellcheckPlugin.spec.ts +3 -9
  123. package/tests/plugins/VscodeValePlugin.spec.ts +3 -9
  124. package/tests/plugins/VscodeXmlPlugin.spec.ts +3 -9
  125. package/tests/plugins/VscodeYamlPlugin.spec.ts +4 -7
  126. package/testsLibrary/CodeExecutionTests.ts +9 -1
  127. package/testsLibrary/WorkspaceHandlingTests.ts +66 -9
@@ -10,7 +10,6 @@
10
10
 
11
11
  import { Key } from 'selenium-webdriver';
12
12
  import { e2eContainer } from '../../inversify.config';
13
- import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
14
13
  import { Ide } from '../../pageobjects/ide/Ide';
15
14
  import { CLASSES } from '../../inversify.types';
16
15
  import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
@@ -19,7 +18,6 @@ import { TestConstants } from '../../TestConstants';
19
18
  import { TimeoutConstants } from '../../TimeoutConstants';
20
19
  import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
21
20
  import { Logger } from '../../utils/Logger';
22
- import CheReporter from '../../driver/CheReporter';
23
21
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
24
22
 
25
23
  const ide: Ide = e2eContainer.get(CLASSES.Ide);
@@ -27,14 +25,12 @@ const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
27
25
  const editor: Editor = e2eContainer.get(CLASSES.Editor);
28
26
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
29
27
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
30
- const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
31
28
 
32
29
  const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/VscodeXmlPlugin.yaml';
33
30
  const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
34
31
  const projectName: string = 'nodejs-web-app';
35
32
  const pathToFile: string = `${projectName}`;
36
33
  const xmlFileName: string = 'hello.xml';
37
- let workspaceName: string = '';
38
34
 
39
35
  suite('The "VscodeXmlPlugin" userstory', async () => {
40
36
  suite('Create workspace', async () => {
@@ -42,11 +38,9 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
42
38
  await browserTabsUtil.navigateTo(factoryUrl);
43
39
  });
44
40
 
45
- test('Wait until created workspace is started', async () => {
46
- await ide.waitAndSwitchToIdeFrame();
47
- workspaceName = await workspaceNameHandler.getNameFromUrl();
48
- CheReporter.registerRunningWorkspace(workspaceName);
41
+ workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
49
42
 
43
+ test('Wait until created workspace is started', async () => {
50
44
  await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
51
45
  await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
52
46
  });
@@ -109,7 +103,7 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
109
103
  suite('Delete workspace', async () => {
110
104
  test('Stop and remove workspace', async () => {
111
105
  if (TestConstants.TS_DELETE_PLUGINS_TEST_WORKSPACE === 'true') {
112
- await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
106
+ await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
113
107
  return;
114
108
  }
115
109
 
@@ -16,7 +16,6 @@ import { Editor } from '../../pageobjects/ide/Editor';
16
16
  import { TestConstants } from '../../TestConstants';
17
17
  import { Logger } from '../../utils/Logger';
18
18
  import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
19
- import CheReporter from '../../driver/CheReporter';
20
19
  import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
21
20
  import { PreferencesHandler } from '../../utils/PreferencesHandler';
22
21
  import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
@@ -36,19 +35,17 @@ const pathToFile: string = `${projectName}`;
36
35
  const yamlFileName: string = 'routes.yaml';
37
36
  const yamlSchema = { 'yaml-schema.json': '*.yaml' };
38
37
 
39
- let workspaceName: string = 'yaml-plugin';
40
-
41
38
  suite('The "VscodeYamlPlugin" userstory', async () => {
42
39
  suite('Create workspace', async () => {
43
40
  test('Create workspace using factory', async () => {
44
41
  await browserTabsUtil.navigateTo(factoryUrl);
45
42
  });
46
43
 
47
- projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
44
+ workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
48
45
 
49
- test('Wait until created workspace is started', async () => {
50
- CheReporter.registerRunningWorkspace(workspaceName);
46
+ projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
51
47
 
48
+ test('Set confirmExit preference to never', async () => {
52
49
  await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
53
50
  });
54
51
  });
@@ -97,7 +94,7 @@ suite('The "VscodeYamlPlugin" userstory', async () => {
97
94
  suite('Delete workspace', async () => {
98
95
  test('Stop and remove workspace', async () => {
99
96
  if (TestConstants.TS_DELETE_PLUGINS_TEST_WORKSPACE === 'true') {
100
- await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
97
+ await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
101
98
  return;
102
99
  }
103
100
 
@@ -22,6 +22,8 @@ import { PreviewWidget } from '../pageobjects/ide/PreviewWidget';
22
22
  import { RightToolBar } from '../pageobjects/ide/RightToolBar';
23
23
  import { Logger } from '../utils/Logger';
24
24
  import { QuickOpenContainer } from '../pageobjects/ide/QuickOpenContainer';
25
+ import { WorkspaceHandlingTests } from './WorkspaceHandlingTests';
26
+ import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
25
27
 
26
28
  @injectable()
27
29
  export class CodeExecutionTests {
@@ -36,7 +38,9 @@ export class CodeExecutionTests {
36
38
  @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
37
39
  @inject(CLASSES.PreviewWidget) private readonly previewWidget: PreviewWidget,
38
40
  @inject(CLASSES.RightToolBar) private readonly rightToolBar: RightToolBar,
39
- @inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer) {}
41
+ @inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer,
42
+ @inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
43
+ @inject(CLASSES.WorkspaceHandlingTests) private readonly workspaceHandlingTests: WorkspaceHandlingTests) {}
40
44
 
41
45
  public runTask(taskName: string, timeout: number) {
42
46
  test(`Run command '${taskName}'`, async () => {
@@ -66,6 +70,7 @@ export class CodeExecutionTests {
66
70
  public runTaskWithDialogShellAndOpenLink(taskName: string, expectedDialogText: string, timeout: number) {
67
71
  test(`Run command '${taskName}' expecting dialog shell`, async () => {
68
72
  await this.runTaskUsingQuickOpenContainer(taskName);
73
+ this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
69
74
  await this.dialogWindow.waitDialogAndOpenLink(expectedDialogText, timeout);
70
75
  });
71
76
  }
@@ -107,6 +112,7 @@ export class CodeExecutionTests {
107
112
  test(`Run command '${taskName}' expecting notification`, async () => {
108
113
  await this.runTaskUsingQuickOpenContainer(taskName);
109
114
  await this.ide.waitNotification(notificationText, timeout);
115
+ this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
110
116
  await this.ide.clickOnNotificationButton(notificationText, buttonText);
111
117
  CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
112
118
  });
@@ -116,6 +122,7 @@ export class CodeExecutionTests {
116
122
  test(`Run command '${taskName}' expecting notification`, async () => {
117
123
  await this.runTaskUsingQuickOpenContainer(taskName);
118
124
  await this.ide.waitNotification(notificationText, timeout);
125
+ this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
119
126
  await this.ide.clickOnNotificationButton(notificationText, 'Open In Preview');
120
127
  CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
121
128
  });
@@ -125,6 +132,7 @@ export class CodeExecutionTests {
125
132
  test(`Run command '${taskName}' expecting notification with unexposed port`, async () => {
126
133
  await this.runTaskUsingQuickOpenContainer(taskName);
127
134
  await this.ide.waitNotificationAndConfirm(notificationText, timeout);
135
+ this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
128
136
  await this.ide.waitNotificationAndOpenLink(portOpenText, timeout);
129
137
  CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
130
138
  });
@@ -15,39 +15,56 @@ import { Dashboard } from '../pageobjects/dashboard/Dashboard';
15
15
  import { CreateWorkspace } from '../pageobjects/dashboard/CreateWorkspace';
16
16
  import { Workspaces } from '../pageobjects/dashboard/Workspaces';
17
17
  import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
18
- import { Logger } from '..';
18
+ import { Logger } from '../utils/Logger';
19
+ import { TimeoutConstants } from '../TimeoutConstants';
20
+ import { DriverHelper } from '../utils/DriverHelper';
21
+ import { Ide } from '../pageobjects/ide/Ide';
22
+ import { By, error } from 'selenium-webdriver';
19
23
 
20
24
  @injectable()
21
25
  export class WorkspaceHandlingTests {
22
26
 
27
+ private static START_WORKSPACE_PAGE_NAME_LOCATOR: By = By.xpath(`//div[@class="ui-container"]/div[@class="pf-c-page"]//div[@class="pf-c-content"]/h1`);
23
28
  private static workspaceName: string = 'undefined';
29
+ private static parentGUID: string;
24
30
 
25
31
  public static getWorkspaceName(): string {
26
32
  return WorkspaceHandlingTests.workspaceName;
27
33
  }
28
34
 
35
+ public static setWorkspaceName(workspaceName: string) {
36
+ WorkspaceHandlingTests.workspaceName = workspaceName;
37
+ }
38
+
39
+ public setWindowHandle(guid: string) {
40
+ WorkspaceHandlingTests.parentGUID = guid;
41
+ }
42
+
43
+ public getWindowHandle(): string {
44
+ return WorkspaceHandlingTests.parentGUID;
45
+ }
46
+
29
47
  constructor(
30
48
  @inject(CLASSES.Dashboard) private readonly dashboard: Dashboard,
31
49
  @inject(CLASSES.CreateWorkspace) private readonly createWorkspace: CreateWorkspace,
32
50
  @inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
33
- @inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {}
51
+ @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
52
+ @inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
53
+ @inject(CLASSES.Ide) private readonly ide: Ide) {}
34
54
 
35
55
  public createAndOpenWorkspace(stack: string) {
36
- test(`Open 'New Workspace' page`, async () => {
56
+ test(`Create and open new workspace, stack:${stack}`, async () => {
37
57
  await this.dashboard.waitPage();
38
58
  await this.dashboard.clickCreateWorkspaceButton();
39
59
  await this.createWorkspace.waitPage();
40
- const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
60
+ WorkspaceHandlingTests.parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
41
61
  await this.createWorkspace.clickOnSample(stack);
42
- await this.browserTabsUtil.switchToWindow(parentGUID);
43
- WorkspaceHandlingTests.workspaceName = await this.dashboard.getRecentWorkspaceName(10000);
44
- Logger.debug(`Workspace Name is: ${WorkspaceHandlingTests.workspaceName}`);
45
- await this.browserTabsUtil.waitAndSwitchToAnotherWindow(parentGUID, 10000);
62
+ await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
46
63
  });
47
64
  }
48
65
 
49
66
  public openExistingWorkspace(workspaceName: string) {
50
- test('Start workspace', async () => {
67
+ test('Open and start existing workspace', async () => {
51
68
  await this.dashboard.waitPage();
52
69
  await this.dashboard.clickWorkspacesButton();
53
70
  await this.workspaces.waitPage();
@@ -55,6 +72,46 @@ export class WorkspaceHandlingTests {
55
72
  });
56
73
  }
57
74
 
75
+ public obtainWorkspaceNameFromStartingPage() {
76
+ test('Obtain workspace name from workspace loader page', async() => {
77
+ try {
78
+ await this.driverHelper.waitVisibility(WorkspaceHandlingTests.START_WORKSPACE_PAGE_NAME_LOCATOR, TimeoutConstants.TS_WAIT_LOADER_PRESENCE_TIMEOUT);
79
+ // it takes a while to update the element with the workspace name
80
+ await this.driverHelper.wait(10_000);
81
+ let startingWorkspaceLineContent = await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.START_WORKSPACE_PAGE_NAME_LOCATOR).getAttribute('innerHTML');
82
+ // cutting away leading text
83
+ WorkspaceHandlingTests.workspaceName = startingWorkspaceLineContent.substring('Starting workspace '.length).trim();
84
+ Logger.info(`Obtained workspace name from workspace loader page: ${WorkspaceHandlingTests.workspaceName}`);
85
+ } catch (err) {
86
+ Logger.error(`Failed to obtain workspace name from workspace loader page: ${err}`);
87
+ throw err;
88
+ }
89
+ });
90
+ }
91
+
92
+ public switchBackToFirstOpenIdeTabFromLeftToRight() {
93
+ test('WorkspaceHandlingTests.switchBackToIdeTab', async () => {
94
+ let tabs = await this.driverHelper.getDriver().getAllWindowHandles();
95
+ Logger.trace(`WorkspaceHandlingTests.switchBackToIdeTab Found ${tabs.length} window handles, iterating...`);
96
+ for (let i = 0; i < tabs.length; i++) {
97
+ await this.browserTabsUtil.switchToWindow(tabs[i]);
98
+ try {
99
+ await this.ide.waitIde(TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
100
+ Logger.info(`WorkspaceHandlingTests.switchBackToIdeTab located and switched to IDE tab`);
101
+ return;
102
+ } catch (err) {
103
+ if (err instanceof error.TimeoutError) {
104
+ Logger.warn(`WorkspaceHandlingTests.switchBackToIdeTab Locator timed out, trying with another window handle.`);
105
+ continue;
106
+ }
107
+ Logger.error(`WorkspaceHandlingTests.switchBackToIdeTab Received unexpected exception while trying to locate IDE tab:${err}`);
108
+ throw err;
109
+ }
110
+ }
111
+ Logger.error(`WorkspaceHandlingTests.switchBackToIdeTab Failed to locate IDE tab, out of window handles.`);
112
+ });
113
+ }
114
+
58
115
  public async stopWorkspace(workspaceName: string) {
59
116
  await this.dashboard.openDashboard();
60
117
  await this.dashboard.stopWorkspaceByUI(workspaceName);