@eclipse-che/che-e2e 7.46.0 → 7.46.1-dev-8a64d75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/driver/CheReporter.js +2 -5
- package/dist/driver/CheReporter.js.map +1 -1
- package/dist/pageobjects/ide/ProjectTree.js +12 -6
- package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +2 -10
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -1
- package/dist/tests/devfiles/DevfileSmoke.spec.js +2 -10
- package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -1
- package/dist/tests/devfiles/DotNetCore.spec.js +2 -10
- package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
- package/dist/tests/devfiles/Go.spec.js +2 -10
- package/dist/tests/devfiles/Go.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaMaven.spec.js +2 -10
- package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaSpringBoot.spec.js +2 -10
- package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaVertx.spec.js +2 -10
- package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -1
- package/dist/tests/devfiles/NodeJS.spec.js +2 -10
- package/dist/tests/devfiles/NodeJS.spec.js.map +1 -1
- package/dist/tests/devfiles/PHPSimple.spec.js +2 -10
- package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -1
- package/dist/tests/devfiles/Python.spec.js +2 -10
- package/dist/tests/devfiles/Python.spec.js.map +1 -1
- package/dist/tests/devfiles/PythonDjango.spec.js +2 -10
- package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -1
- package/dist/tests/devfiles/Quarkus.spec.js +2 -10
- package/dist/tests/devfiles/Quarkus.spec.js.map +1 -1
- package/dist/tests/devfiles/Scala.spec.js +2 -10
- package/dist/tests/devfiles/Scala.spec.js.map +1 -1
- package/dist/tests/e2e/FactoryUrl.spec.js +4 -9
- package/dist/tests/e2e/FactoryUrl.spec.js.map +1 -1
- package/dist/tests/e2e/GitPublishBranch.spec.js +2 -5
- package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -1
- package/dist/tests/e2e/GitSelfSignCert.spec.js +2 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -1
- package/dist/tests/e2e/GitSsh.spec.js +3 -6
- package/dist/tests/e2e/GitSsh.spec.js.map +1 -1
- package/dist/tests/e2e/OpenshiftConnector.spec.js +2 -5
- package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +3 -7
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +3 -7
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +3 -7
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +2 -2
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/HappyPath.spec.js +13 -13
- package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +1 -1
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.js +2 -6
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +1 -1
- package/dist/tests/load_test/LoadTest.spec.js +2 -5
- package/dist/tests/load_test/LoadTest.spec.js.map +1 -1
- package/dist/tests/login/LinkCheAndOcpUsers.spec.js +2 -2
- package/dist/tests/login/LinkCheAndOcpUsers.spec.js.map +1 -1
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +4 -9
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js +4 -10
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +1 -1
- package/dist/tests/plugins/JavaPlugin.spec.js +4 -8
- package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/PhpPlugin.spec.js +12 -10
- package/dist/tests/plugins/PhpPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/PythonPlugin.spec.js +4 -8
- package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/TypescriptPlugin.spec.js +4 -8
- package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +3 -10
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +3 -10
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeValePlugin.spec.js +3 -10
- package/dist/tests/plugins/VscodeValePlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js +10 -22
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js +4 -8
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
- package/dist/testsLibrary/CodeExecutionTests.js +14 -2
- package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
- package/dist/testsLibrary/WorkspaceHandlingTests.js +68 -11
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
- package/driver/CheReporter.ts +2 -8
- package/package.json +2 -2
- package/pageobjects/ide/ProjectTree.ts +13 -8
- package/tests/devfiles/CSlashCPlusPlus.spec.ts +2 -9
- package/tests/devfiles/DevfileSmoke.spec.ts +2 -9
- package/tests/devfiles/DotNetCore.spec.ts +2 -9
- package/tests/devfiles/Go.spec.ts +2 -7
- package/tests/devfiles/JavaMaven.spec.ts +2 -9
- package/tests/devfiles/JavaSpringBoot.spec.ts +2 -9
- package/tests/devfiles/JavaVertx.spec.ts +2 -9
- package/tests/devfiles/NodeJS.spec.ts +2 -9
- package/tests/devfiles/PHPSimple.spec.ts +2 -9
- package/tests/devfiles/Python.spec.ts +2 -9
- package/tests/devfiles/PythonDjango.spec.ts +2 -9
- package/tests/devfiles/Quarkus.spec.ts +2 -9
- package/tests/devfiles/Scala.spec.ts +2 -10
- package/tests/e2e/FactoryUrl.spec.ts +4 -8
- package/tests/e2e/GitPublishBranch.spec.ts +2 -2
- package/tests/e2e/GitSelfSignCert.spec.ts +66 -65
- package/tests/e2e/GitSsh.spec.ts +3 -3
- package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
- package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +2 -5
- package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +2 -5
- package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +2 -5
- package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +2 -2
- package/tests/e2e_happy_path/HappyPath.spec.ts +13 -10
- package/tests/intelij/IntelijOpenWorkspace.spec.ts +2 -4
- package/tests/load_test/LoadTest.spec.ts +2 -2
- package/tests/login/LinkCheAndOcpUsers.spec.ts +4 -3
- package/tests/plugins/GitHubPullRequestPlugin.spec.ts +4 -7
- package/tests/plugins/InstallPluginUsingUI.spec.ts +4 -9
- package/tests/plugins/JavaPlugin.spec.ts +4 -6
- package/tests/plugins/PhpPlugin.spec.ts +3 -9
- package/tests/plugins/PythonPlugin.spec.ts +4 -6
- package/tests/plugins/TypescriptPlugin.spec.ts +4 -6
- package/tests/plugins/VscodeKubernetesPlugin.spec.ts +3 -9
- package/tests/plugins/VscodeShellcheckPlugin.spec.ts +3 -9
- package/tests/plugins/VscodeValePlugin.spec.ts +3 -9
- package/tests/plugins/VscodeXmlPlugin.spec.ts +14 -23
- package/tests/plugins/VscodeYamlPlugin.spec.ts +4 -7
- package/testsLibrary/CodeExecutionTests.ts +9 -1
- package/testsLibrary/WorkspaceHandlingTests.ts +66 -9
|
@@ -10,31 +10,31 @@
|
|
|
10
10
|
|
|
11
11
|
import { Key } from 'selenium-webdriver';
|
|
12
12
|
import { e2eContainer } from '../../inversify.config';
|
|
13
|
-
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
|
|
14
|
-
import { Ide } from '../../pageobjects/ide/Ide';
|
|
15
13
|
import { CLASSES } from '../../inversify.types';
|
|
16
14
|
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
|
|
17
15
|
import { Editor } from '../../pageobjects/ide/Editor';
|
|
18
16
|
import { TestConstants } from '../../TestConstants';
|
|
19
|
-
import { TimeoutConstants } from '../../TimeoutConstants';
|
|
20
|
-
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
21
17
|
import { Logger } from '../../utils/Logger';
|
|
22
|
-
import
|
|
18
|
+
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
19
|
+
|
|
23
20
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
21
|
+
import { PreferencesHandler } from '../../utils/PreferencesHandler';
|
|
22
|
+
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
24
23
|
|
|
25
|
-
const
|
|
24
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
26
25
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
27
26
|
const editor: Editor = e2eContainer.get(CLASSES.Editor);
|
|
28
27
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
29
28
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
30
|
-
const
|
|
29
|
+
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
31
30
|
|
|
32
|
-
const devfileUrl: string = 'https://
|
|
31
|
+
const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin';
|
|
33
32
|
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
|
|
34
|
-
const projectName: string = 'nodejs-
|
|
33
|
+
const projectName: string = 'web-nodejs-sample';
|
|
35
34
|
const pathToFile: string = `${projectName}`;
|
|
36
35
|
const xmlFileName: string = 'hello.xml';
|
|
37
|
-
|
|
36
|
+
const subRootFolder: string = 'app';
|
|
37
|
+
let workspaceName: string = 'xml-plugin';
|
|
38
38
|
|
|
39
39
|
suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
40
40
|
suite('Create workspace', async () => {
|
|
@@ -42,20 +42,12 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
42
42
|
await browserTabsUtil.navigateTo(factoryUrl);
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
await ide.waitAndSwitchToIdeFrame();
|
|
47
|
-
workspaceName = await workspaceNameHandler.getNameFromUrl();
|
|
48
|
-
CheReporter.registerRunningWorkspace(workspaceName);
|
|
45
|
+
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
49
46
|
|
|
50
|
-
|
|
51
|
-
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
47
|
+
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
|
|
54
48
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
await projectTree.openProjectTreeContainer();
|
|
58
|
-
await projectTree.waitProjectImported(projectName, 'app');
|
|
49
|
+
test('Set confirmExit preference to never', async () => {
|
|
50
|
+
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
|
|
59
51
|
});
|
|
60
52
|
});
|
|
61
53
|
|
|
@@ -116,5 +108,4 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
116
108
|
Logger.info(`As far as the "TS_DELETE_PLUGINS_TEST_WORKSPACE" value is "false the workspace deletion is skipped"`);
|
|
117
109
|
});
|
|
118
110
|
});
|
|
119
|
-
|
|
120
111
|
});
|
|
@@ -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
|
-
|
|
44
|
+
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
48
45
|
|
|
49
|
-
|
|
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(
|
|
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.
|
|
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(`
|
|
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
|
-
|
|
60
|
+
WorkspaceHandlingTests.parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
41
61
|
await this.createWorkspace.clickOnSample(stack);
|
|
42
|
-
await this.browserTabsUtil.
|
|
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('
|
|
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);
|