|
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 { Logger } from '../../utils/Logger'; |
19 | 17 | import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
20 |
| -import CheReporter from '../../driver/CheReporter'; |
21 | 18 | import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
22 |
| -import { PreferencesHandler } from '../../utils/PreferencesHandler'; |
23 | 19 | import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
24 |
| -import { TimeoutConstants } from '../../TimeoutConstants'; |
25 | 20 |
|
26 | 21 | const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
27 | 22 | const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
28 | 23 | const editor: Editor = e2eContainer.get(CLASSES.Editor);
|
29 |
| -const ide: Ide = e2eContainer.get(CLASSES.Ide); |
30 | 24 | const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
31 | 25 | const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
32 |
| -const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler); |
33 |
| - |
34 |
| -const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin'; |
| 26 | +const devfileUrl: string = TestConstants.TS_TEST_WORKSPACE_DEVFILE_REPO || 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin'; |
35 | 27 | const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
|
36 | 28 | const projectName: string = 'web-nodejs-sample';
|
37 | 29 | const pathToFile: string = `${projectName}`;
|
38 | 30 | const xmlFileName: string = 'hello.xml';
|
39 | 31 | const subRootFolder: string = 'app';
|
40 |
| -let workspaceName: string = 'xml-plugin'; |
41 | 32 |
|
42 | 33 | suite('The "VscodeXmlPlugin" userstory', async () => {
|
43 | 34 | suite('Create workspace', async () => {
|
44 | 35 | test('Create workspace using factory', async () => {
|
45 | 36 | await browserTabsUtil.navigateTo(factoryUrl);
|
46 | 37 | });
|
47 | 38 |
|
48 |
| - projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder); |
49 |
| - |
50 |
| - test('Wait until created workspace is started', async () => { |
51 |
| - WorkspaceHandlingTests.setWorkspaceName(workspaceName); |
52 |
| - CheReporter.registerRunningWorkspace(workspaceName); |
| 39 | + workspaceHandlingTests.obtainWorkspaceNameFromStartingPage(); |
53 | 40 |
|
54 |
| - await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never'); |
55 |
| - }); |
56 |
| - |
57 |
| - test('Wait until created workspace is started', async () => { |
58 |
| - await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT); |
59 |
| - await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000); |
60 |
| - }); |
61 |
| - }); |
62 |
| - |
63 |
| - suite('Check workspace readiness to work', async () => { |
64 |
| - test('Wait until project is imported', async () => { |
65 |
| - await projectTree.openProjectTreeContainer(); |
66 |
| - await projectTree.waitProjectImported(projectName, 'app'); |
67 |
| - }); |
| 41 | + projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder); |
68 | 42 | });
|
69 | 43 |
|
70 | 44 | suite('Check the "vscode-xml" plugin', async () => {
|
@@ -114,14 +88,9 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
114 | 88 |
|
115 | 89 | });
|
116 | 90 |
|
117 |
| - suite('Delete workspace', async () => { |
| 91 | + suite ('Stopping and deleting the workspace', async () => { |
118 | 92 | test('Stop and remove workspace', async () => {
|
119 |
| - if (TestConstants.TS_DELETE_PLUGINS_TEST_WORKSPACE === 'true') { |
120 |
| - await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName()); |
121 |
| - return; |
122 |
| - } |
123 |
| - |
124 |
| - Logger.info(`As far as the "TS_DELETE_PLUGINS_TEST_WORKSPACE" value is "false the workspace deletion is skipped"`); |
| 93 | + await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName()); |
125 | 94 | });
|
126 | 95 | });
|
127 | 96 |
|
|
0 commit comments