@eclipse-che/che-e2e 7.46.1-dev-5e33fd3 → 7.48.0-dev-29d4f0d
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 +5 -2
- package/dist/driver/CheReporter.js.map +1 -1
- package/dist/pageobjects/ide/ProjectTree.js +6 -12
- package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +10 -2
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -1
- package/dist/tests/devfiles/DevfileSmoke.spec.js +10 -2
- package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -1
- package/dist/tests/devfiles/DotNetCore.spec.js +10 -2
- package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
- package/dist/tests/devfiles/Go.spec.js +10 -2
- package/dist/tests/devfiles/Go.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaMaven.spec.js +10 -2
- package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaSpringBoot.spec.js +10 -2
- package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaVertx.spec.js +10 -2
- package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -1
- package/dist/tests/devfiles/NodeJS.spec.js +10 -2
- package/dist/tests/devfiles/NodeJS.spec.js.map +1 -1
- package/dist/tests/devfiles/PHPSimple.spec.js +10 -2
- package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -1
- package/dist/tests/devfiles/Python.spec.js +10 -2
- package/dist/tests/devfiles/Python.spec.js.map +1 -1
- package/dist/tests/devfiles/PythonDjango.spec.js +10 -2
- package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -1
- package/dist/tests/devfiles/Quarkus.spec.js +10 -2
- package/dist/tests/devfiles/Quarkus.spec.js.map +1 -1
- package/dist/tests/devfiles/Scala.spec.js +10 -2
- package/dist/tests/devfiles/Scala.spec.js.map +1 -1
- package/dist/tests/e2e/FactoryUrl.spec.js +9 -4
- package/dist/tests/e2e/FactoryUrl.spec.js.map +1 -1
- package/dist/tests/e2e/GitPublishBranch.spec.js +5 -2
- package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -1
- package/dist/tests/e2e/GitSelfSignCert.spec.js +0 -2
- package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -1
- package/dist/tests/e2e/GitSsh.spec.js +6 -3
- package/dist/tests/e2e/GitSsh.spec.js.map +1 -1
- package/dist/tests/e2e/OpenshiftConnector.spec.js +5 -2
- package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +7 -3
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +7 -3
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +7 -3
- 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 +6 -2
- package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +1 -1
- package/dist/tests/load_test/LoadTest.spec.js +5 -2
- 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 +9 -4
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js +10 -4
- package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +1 -1
- package/dist/tests/plugins/JavaPlugin.spec.js +8 -4
- package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/PhpPlugin.spec.js +10 -12
- package/dist/tests/plugins/PhpPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/PythonPlugin.spec.js +8 -4
- package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/TypescriptPlugin.spec.js +8 -4
- package/dist/tests/plugins/TypescriptPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +10 -3
- package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +10 -3
- package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeValePlugin.spec.js +10 -3
- package/dist/tests/plugins/VscodeValePlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js +14 -15
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js +8 -4
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
- package/dist/testsLibrary/CodeExecutionTests.js +2 -14
- package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
- package/dist/testsLibrary/WorkspaceHandlingTests.js +11 -68
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
- package/driver/CheReporter.ts +8 -2
- package/package.json +2 -2
- package/pageobjects/ide/ProjectTree.ts +8 -13
- package/tests/devfiles/CSlashCPlusPlus.spec.ts +9 -2
- package/tests/devfiles/DevfileSmoke.spec.ts +9 -2
- package/tests/devfiles/DotNetCore.spec.ts +9 -2
- package/tests/devfiles/Go.spec.ts +7 -2
- package/tests/devfiles/JavaMaven.spec.ts +9 -2
- package/tests/devfiles/JavaSpringBoot.spec.ts +9 -2
- package/tests/devfiles/JavaVertx.spec.ts +9 -2
- package/tests/devfiles/NodeJS.spec.ts +9 -2
- package/tests/devfiles/PHPSimple.spec.ts +9 -2
- package/tests/devfiles/Python.spec.ts +9 -2
- package/tests/devfiles/PythonDjango.spec.ts +9 -2
- package/tests/devfiles/Quarkus.spec.ts +9 -2
- package/tests/devfiles/Scala.spec.ts +10 -2
- package/tests/e2e/FactoryUrl.spec.ts +8 -4
- package/tests/e2e/GitPublishBranch.spec.ts +2 -2
- package/tests/e2e/GitSelfSignCert.spec.ts +65 -66
- package/tests/e2e/GitSsh.spec.ts +3 -3
- package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
- package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +5 -2
- package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +5 -2
- package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +5 -2
- package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +2 -2
- package/tests/e2e_happy_path/HappyPath.spec.ts +10 -13
- package/tests/intelij/IntelijOpenWorkspace.spec.ts +4 -2
- package/tests/load_test/LoadTest.spec.ts +2 -2
- package/tests/login/LinkCheAndOcpUsers.spec.ts +3 -4
- package/tests/plugins/GitHubPullRequestPlugin.spec.ts +7 -4
- package/tests/plugins/InstallPluginUsingUI.spec.ts +9 -4
- package/tests/plugins/JavaPlugin.spec.ts +6 -4
- package/tests/plugins/PhpPlugin.spec.ts +9 -3
- package/tests/plugins/PythonPlugin.spec.ts +6 -4
- package/tests/plugins/TypescriptPlugin.spec.ts +6 -4
- package/tests/plugins/VscodeKubernetesPlugin.spec.ts +9 -3
- package/tests/plugins/VscodeShellcheckPlugin.spec.ts +9 -3
- package/tests/plugins/VscodeValePlugin.spec.ts +9 -3
- package/tests/plugins/VscodeXmlPlugin.spec.ts +14 -16
- package/tests/plugins/VscodeYamlPlugin.spec.ts +7 -4
- package/testsLibrary/CodeExecutionTests.ts +1 -9
- package/testsLibrary/WorkspaceHandlingTests.ts +9 -66
|
@@ -10,27 +10,31 @@
|
|
|
10
10
|
|
|
11
11
|
import { Key } from 'selenium-webdriver';
|
|
12
12
|
import { e2eContainer } from '../../inversify.config';
|
|
13
|
-
import { Ide } from '../../pageobjects/ide/Ide';
|
|
14
13
|
import { CLASSES } from '../../inversify.types';
|
|
15
14
|
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
|
|
16
15
|
import { Editor } from '../../pageobjects/ide/Editor';
|
|
17
16
|
import { TestConstants } from '../../TestConstants';
|
|
18
|
-
import { TimeoutConstants } from '../../TimeoutConstants';
|
|
19
|
-
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
20
17
|
import { Logger } from '../../utils/Logger';
|
|
18
|
+
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
19
|
+
import CheReporter from '../../driver/CheReporter';
|
|
21
20
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
21
|
+
import { PreferencesHandler } from '../../utils/PreferencesHandler';
|
|
22
|
+
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
22
23
|
|
|
23
|
-
const
|
|
24
|
+
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
24
25
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
25
26
|
const editor: Editor = e2eContainer.get(CLASSES.Editor);
|
|
26
27
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
27
28
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
29
|
+
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
28
30
|
|
|
29
|
-
const devfileUrl: string = 'https://
|
|
31
|
+
const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin';
|
|
30
32
|
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
|
|
31
|
-
const projectName: string = 'nodejs-
|
|
33
|
+
const projectName: string = 'web-nodejs-sample';
|
|
32
34
|
const pathToFile: string = `${projectName}`;
|
|
33
35
|
const xmlFileName: string = 'hello.xml';
|
|
36
|
+
const subRootFolder: string = 'app';
|
|
37
|
+
let workspaceName: string = 'xml-plugin';
|
|
34
38
|
|
|
35
39
|
suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
36
40
|
suite('Create workspace', async () => {
|
|
@@ -38,18 +42,12 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
38
42
|
await browserTabsUtil.navigateTo(factoryUrl);
|
|
39
43
|
});
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
|
|
42
46
|
|
|
43
47
|
test('Wait until created workspace is started', async () => {
|
|
44
|
-
|
|
45
|
-
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
+
CheReporter.registerRunningWorkspace(workspaceName);
|
|
48
49
|
|
|
49
|
-
|
|
50
|
-
test('Wait until project is imported', async () => {
|
|
51
|
-
await projectTree.openProjectTreeContainer();
|
|
52
|
-
await projectTree.waitProjectImported(projectName, 'app');
|
|
50
|
+
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
|
|
53
51
|
});
|
|
54
52
|
});
|
|
55
53
|
|
|
@@ -103,7 +101,7 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
103
101
|
suite('Delete workspace', async () => {
|
|
104
102
|
test('Stop and remove workspace', async () => {
|
|
105
103
|
if (TestConstants.TS_DELETE_PLUGINS_TEST_WORKSPACE === 'true') {
|
|
106
|
-
await workspaceHandlingTests.stopAndRemoveWorkspace(
|
|
104
|
+
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
|
|
107
105
|
return;
|
|
108
106
|
}
|
|
109
107
|
|
|
@@ -16,6 +16,7 @@ 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';
|
|
19
20
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
20
21
|
import { PreferencesHandler } from '../../utils/PreferencesHandler';
|
|
21
22
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
@@ -35,17 +36,19 @@ const pathToFile: string = `${projectName}`;
|
|
|
35
36
|
const yamlFileName: string = 'routes.yaml';
|
|
36
37
|
const yamlSchema = { 'yaml-schema.json': '*.yaml' };
|
|
37
38
|
|
|
39
|
+
let workspaceName: string = 'yaml-plugin';
|
|
40
|
+
|
|
38
41
|
suite('The "VscodeYamlPlugin" userstory', async () => {
|
|
39
42
|
suite('Create workspace', async () => {
|
|
40
43
|
test('Create workspace using factory', async () => {
|
|
41
44
|
await browserTabsUtil.navigateTo(factoryUrl);
|
|
42
45
|
});
|
|
43
46
|
|
|
44
|
-
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
45
|
-
|
|
46
47
|
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
|
|
47
48
|
|
|
48
|
-
test('
|
|
49
|
+
test('Wait until created workspace is started', async () => {
|
|
50
|
+
CheReporter.registerRunningWorkspace(workspaceName);
|
|
51
|
+
|
|
49
52
|
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
|
|
50
53
|
});
|
|
51
54
|
});
|
|
@@ -94,7 +97,7 @@ suite('The "VscodeYamlPlugin" userstory', async () => {
|
|
|
94
97
|
suite('Delete workspace', async () => {
|
|
95
98
|
test('Stop and remove workspace', async () => {
|
|
96
99
|
if (TestConstants.TS_DELETE_PLUGINS_TEST_WORKSPACE === 'true') {
|
|
97
|
-
await workspaceHandlingTests.stopAndRemoveWorkspace(
|
|
100
|
+
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
|
|
98
101
|
return;
|
|
99
102
|
}
|
|
100
103
|
|
|
@@ -22,8 +22,6 @@ 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';
|
|
27
25
|
|
|
28
26
|
@injectable()
|
|
29
27
|
export class CodeExecutionTests {
|
|
@@ -38,9 +36,7 @@ export class CodeExecutionTests {
|
|
|
38
36
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
|
|
39
37
|
@inject(CLASSES.PreviewWidget) private readonly previewWidget: PreviewWidget,
|
|
40
38
|
@inject(CLASSES.RightToolBar) private readonly rightToolBar: RightToolBar,
|
|
41
|
-
@inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer
|
|
42
|
-
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
43
|
-
@inject(CLASSES.WorkspaceHandlingTests) private readonly workspaceHandlingTests: WorkspaceHandlingTests) {}
|
|
39
|
+
@inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer) {}
|
|
44
40
|
|
|
45
41
|
public runTask(taskName: string, timeout: number) {
|
|
46
42
|
test(`Run command '${taskName}'`, async () => {
|
|
@@ -70,7 +66,6 @@ export class CodeExecutionTests {
|
|
|
70
66
|
public runTaskWithDialogShellAndOpenLink(taskName: string, expectedDialogText: string, timeout: number) {
|
|
71
67
|
test(`Run command '${taskName}' expecting dialog shell`, async () => {
|
|
72
68
|
await this.runTaskUsingQuickOpenContainer(taskName);
|
|
73
|
-
this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
|
|
74
69
|
await this.dialogWindow.waitDialogAndOpenLink(expectedDialogText, timeout);
|
|
75
70
|
});
|
|
76
71
|
}
|
|
@@ -112,7 +107,6 @@ export class CodeExecutionTests {
|
|
|
112
107
|
test(`Run command '${taskName}' expecting notification`, async () => {
|
|
113
108
|
await this.runTaskUsingQuickOpenContainer(taskName);
|
|
114
109
|
await this.ide.waitNotification(notificationText, timeout);
|
|
115
|
-
this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
|
|
116
110
|
await this.ide.clickOnNotificationButton(notificationText, buttonText);
|
|
117
111
|
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
|
|
118
112
|
});
|
|
@@ -122,7 +116,6 @@ export class CodeExecutionTests {
|
|
|
122
116
|
test(`Run command '${taskName}' expecting notification`, async () => {
|
|
123
117
|
await this.runTaskUsingQuickOpenContainer(taskName);
|
|
124
118
|
await this.ide.waitNotification(notificationText, timeout);
|
|
125
|
-
this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
|
|
126
119
|
await this.ide.clickOnNotificationButton(notificationText, 'Open In Preview');
|
|
127
120
|
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
|
|
128
121
|
});
|
|
@@ -132,7 +125,6 @@ export class CodeExecutionTests {
|
|
|
132
125
|
test(`Run command '${taskName}' expecting notification with unexposed port`, async () => {
|
|
133
126
|
await this.runTaskUsingQuickOpenContainer(taskName);
|
|
134
127
|
await this.ide.waitNotificationAndConfirm(notificationText, timeout);
|
|
135
|
-
this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
|
|
136
128
|
await this.ide.waitNotificationAndOpenLink(portOpenText, timeout);
|
|
137
129
|
CodeExecutionTests.lastApplicationUrl = await this.previewWidget.getUrl();
|
|
138
130
|
});
|
|
@@ -15,56 +15,39 @@ 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 '
|
|
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';
|
|
18
|
+
import { Logger } from '..';
|
|
23
19
|
|
|
24
20
|
@injectable()
|
|
25
21
|
export class WorkspaceHandlingTests {
|
|
26
22
|
|
|
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`);
|
|
28
23
|
private static workspaceName: string = 'undefined';
|
|
29
|
-
private static parentGUID: string;
|
|
30
24
|
|
|
31
25
|
public static getWorkspaceName(): string {
|
|
32
26
|
return WorkspaceHandlingTests.workspaceName;
|
|
33
27
|
}
|
|
34
28
|
|
|
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
|
-
|
|
47
29
|
constructor(
|
|
48
30
|
@inject(CLASSES.Dashboard) private readonly dashboard: Dashboard,
|
|
49
31
|
@inject(CLASSES.CreateWorkspace) private readonly createWorkspace: CreateWorkspace,
|
|
50
32
|
@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
|
|
51
|
-
@inject(CLASSES.
|
|
52
|
-
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
53
|
-
@inject(CLASSES.Ide) private readonly ide: Ide) {}
|
|
33
|
+
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {}
|
|
54
34
|
|
|
55
35
|
public createAndOpenWorkspace(stack: string) {
|
|
56
|
-
test(`
|
|
36
|
+
test(`Open 'New Workspace' page`, async () => {
|
|
57
37
|
await this.dashboard.waitPage();
|
|
58
38
|
await this.dashboard.clickCreateWorkspaceButton();
|
|
59
39
|
await this.createWorkspace.waitPage();
|
|
60
|
-
|
|
40
|
+
const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
61
41
|
await this.createWorkspace.clickOnSample(stack);
|
|
62
|
-
await this.browserTabsUtil.
|
|
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);
|
|
63
46
|
});
|
|
64
47
|
}
|
|
65
48
|
|
|
66
49
|
public openExistingWorkspace(workspaceName: string) {
|
|
67
|
-
test('
|
|
50
|
+
test('Start workspace', async () => {
|
|
68
51
|
await this.dashboard.waitPage();
|
|
69
52
|
await this.dashboard.clickWorkspacesButton();
|
|
70
53
|
await this.workspaces.waitPage();
|
|
@@ -72,46 +55,6 @@ export class WorkspaceHandlingTests {
|
|
|
72
55
|
});
|
|
73
56
|
}
|
|
74
57
|
|
|
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
|
-
|
|
115
58
|
public async stopWorkspace(workspaceName: string) {
|
|
116
59
|
await this.dashboard.openDashboard();
|
|
117
60
|
await this.dashboard.stopWorkspaceByUI(workspaceName);
|