@eclipse-che/che-e2e 7.44.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.
- package/README.md +16 -1
- package/dist/driver/CheReporter.js +4 -4
- package/dist/driver/CheReporter.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +4 -0
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/ide/Ide.js +31 -7
- package/dist/pageobjects/ide/Ide.js.map +1 -1
- package/dist/pageobjects/ide/PreviewWidget.js +6 -2
- package/dist/pageobjects/ide/PreviewWidget.js.map +1 -1
- package/dist/pageobjects/ide/ProjectTree.js +12 -11
- package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
- package/dist/tests/devfiles/DotNetCore.spec.js +1 -1
- package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
- package/dist/tests/devfiles/Go.spec.js +15 -15
- package/dist/tests/devfiles/Go.spec.js.map +1 -1
- package/dist/tests/e2e/OpenshiftConnector.spec.js +2 -2
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +10 -9
- package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +10 -9
- package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +15 -14
- package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +9 -8
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +3 -2
- package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/JavaPlugin.spec.js +27 -23
- package/dist/tests/plugins/JavaPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/PythonPlugin.spec.js +10 -14
- package/dist/tests/plugins/PythonPlugin.spec.js.map +1 -1
- package/dist/testsLibrary/CodeExecutionTests.js +1 -2
- package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
- package/dist/testsLibrary/LanguageServerTests.js +5 -12
- package/dist/testsLibrary/LanguageServerTests.js.map +1 -1
- package/dist/testsLibrary/ProjectAndFileTests.js +0 -1
- package/dist/testsLibrary/ProjectAndFileTests.js.map +1 -1
- package/dist/testsLibrary/WorkspaceHandlingTests.js +11 -7
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +3 -15
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js +3 -3
- package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js.map +1 -1
- package/driver/CheReporter.ts +4 -4
- package/index.ts +1 -1
- package/mocha-all-factories.json +2 -1
- package/package.json +2 -2
- package/pageobjects/dashboard/Dashboard.ts +6 -1
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +1 -1
- package/pageobjects/ide/Ide.ts +30 -7
- package/pageobjects/ide/PreviewWidget.ts +6 -2
- package/pageobjects/ide/ProjectTree.ts +9 -11
- package/tests/devfiles/DotNetCore.spec.ts +1 -1
- package/tests/devfiles/Go.spec.ts +15 -17
- package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
- package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +15 -13
- package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +15 -14
- package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +19 -20
- package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +123 -122
- package/tests/plugins/GitHubPullRequestPlugin.spec.ts +3 -2
- package/tests/plugins/JavaPlugin.spec.ts +20 -26
- package/tests/plugins/PythonPlugin.spec.ts +13 -17
- package/testsLibrary/CodeExecutionTests.ts +1 -2
- package/testsLibrary/LanguageServerTests.ts +4 -9
- package/testsLibrary/ProjectAndFileTests.ts +0 -1
- package/testsLibrary/WorkspaceHandlingTests.ts +8 -4
- package/tsconfig.json +1 -0
- package/tslint.json +119 -115
- package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +3 -9
- package/utils/requestHandlers/tokens/CheMultiuserTokenHandler.ts +20 -18
- package/dist/utils/KeycloackUrlHandler.js +0 -30
- package/dist/utils/KeycloackUrlHandler.js.map +0 -1
- package/utils/KeycloackUrlHandler.ts +0 -32
|
@@ -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
|
|
30
|
+
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
33
31
|
|
|
34
|
-
const
|
|
35
|
-
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${
|
|
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
|
|
38
|
-
const subRootFolder: string = '
|
|
35
|
+
const projectName: string = 'java-guestbook';
|
|
36
|
+
const subRootFolder: string = 'backend';
|
|
39
37
|
|
|
40
|
-
const fileFolderPath: string = `${
|
|
41
|
-
const tabTitle: string = '
|
|
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
|
|
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
|
|
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,
|
|
69
|
+
await editor.moveCursorToLineAndChar(tabTitle, 15, 1);
|
|
76
70
|
await editor.pressControlSpaceCombination(tabTitle);
|
|
77
71
|
await editor.waitSuggestionContainer();
|
|
78
|
-
await editor.waitSuggestion(tabTitle, '
|
|
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,
|
|
84
|
-
await editor.waitErrorInLine(
|
|
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(
|
|
80
|
+
await editor.waitErrorInLineDisappearance(15, tabTitle);
|
|
87
81
|
});
|
|
88
82
|
|
|
89
|
-
test('
|
|
90
|
-
await editor.moveCursorToLineAndChar(tabTitle, 9,
|
|
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 {
|
|
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
|
|
30
|
+
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${
|
|
34
|
-
const
|
|
35
|
-
const
|
|
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 = `${
|
|
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
|
|
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
|
|
|
@@ -140,8 +140,7 @@ export class CodeExecutionTests {
|
|
|
140
140
|
// https://issues.redhat.com/browse/CRW-2175
|
|
141
141
|
if (err instanceof error.TimeoutError) {
|
|
142
142
|
Logger.warn(`CodeExecutionTests.verifyRunningApplication application not located, probably blocked by preloader or content not available. Retrying.`);
|
|
143
|
-
await this.
|
|
144
|
-
await this.ide.waitAndSwitchToIdeFrame();
|
|
143
|
+
await this.ide.waitIde();
|
|
145
144
|
await this.previewWidget.refreshPage();
|
|
146
145
|
await this.previewWidget.waitContentAvailable(locator, applicationCheckTimeout, polling);
|
|
147
146
|
}
|
|
@@ -19,7 +19,6 @@ import { DebugView } from '../pageobjects/ide/DebugView';
|
|
|
19
19
|
import { Key, error } from 'selenium-webdriver';
|
|
20
20
|
import { Logger } from '../utils/Logger';
|
|
21
21
|
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
22
|
-
import { DriverHelper } from '../utils/DriverHelper';
|
|
23
22
|
|
|
24
23
|
@injectable()
|
|
25
24
|
export class LanguageServerTests {
|
|
@@ -29,8 +28,7 @@ export class LanguageServerTests {
|
|
|
29
28
|
@inject(CLASSES.Ide) private readonly ide: Ide,
|
|
30
29
|
@inject(CLASSES.TopMenu) private readonly topMenu: TopMenu,
|
|
31
30
|
@inject(CLASSES.DebugView) private readonly debugView: DebugView,
|
|
32
|
-
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil
|
|
33
|
-
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
31
|
+
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) { }
|
|
34
32
|
|
|
35
33
|
public errorHighlighting(openedTab: string, textToWrite: string, line: number) {
|
|
36
34
|
test('Error highlighting', async () => {
|
|
@@ -68,6 +66,7 @@ export class LanguageServerTests {
|
|
|
68
66
|
await this.editor.pressControlSpaceCombination(openedTab);
|
|
69
67
|
await this.editor.waitSuggestionContainer();
|
|
70
68
|
await this.editor.waitSuggestionWithScrolling(openedTab, expectedText);
|
|
69
|
+
await this.editor.waitTabWithSavedStatus(openedTab);
|
|
71
70
|
});
|
|
72
71
|
}
|
|
73
72
|
|
|
@@ -163,9 +162,7 @@ export class LanguageServerTests {
|
|
|
163
162
|
} catch (err) {
|
|
164
163
|
// debug config is probably missing, refresh IDE and try again https://github.com/eclipse/che/issues/19887
|
|
165
164
|
await this.browserTabsUtil.refreshPage();
|
|
166
|
-
await this.
|
|
167
|
-
await this.ide.waitAndSwitchToIdeFrame();
|
|
168
|
-
await this.driverHelper.wait(TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
|
|
165
|
+
await this.ide.waitIde();
|
|
169
166
|
await this.debugView.clickOnRunDebugButton();
|
|
170
167
|
}
|
|
171
168
|
});
|
|
@@ -186,9 +183,7 @@ export class LanguageServerTests {
|
|
|
186
183
|
} catch (err) {
|
|
187
184
|
// debug config is probably missing, refresh IDE and try again https://github.com/eclipse/che/issues/19887
|
|
188
185
|
await this.browserTabsUtil.refreshPage();
|
|
189
|
-
await this.
|
|
190
|
-
await this.ide.waitAndSwitchToIdeFrame();
|
|
191
|
-
await this.driverHelper.wait(TimeoutConstants.TS_SELENIUM_CLICK_ON_VISIBLE_ITEM);
|
|
186
|
+
await this.ide.waitIde();
|
|
192
187
|
await this.debugView.clickOnDebugConfigurationDropDown();
|
|
193
188
|
await this.debugView.clickOnDebugConfigurationItem(configurationName);
|
|
194
189
|
await this.debugView.clickOnRunDebugButton();
|
|
@@ -48,7 +48,6 @@ export class ProjectAndFileTests {
|
|
|
48
48
|
|
|
49
49
|
public waitWorkspaceReadinessNoSubfolder(sampleName : string, checkNotification: boolean = true) {
|
|
50
50
|
test('Wait for workspace readiness', async () => {
|
|
51
|
-
await this.ide.waitAndSwitchToIdeFrame();
|
|
52
51
|
await this.ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
|
|
53
52
|
if (checkNotification) {
|
|
54
53
|
await this.ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
|
|
@@ -14,7 +14,8 @@ import { CLASSES } from '../inversify.types';
|
|
|
14
14
|
import { Dashboard } from '../pageobjects/dashboard/Dashboard';
|
|
15
15
|
import { CreateWorkspace } from '../pageobjects/dashboard/CreateWorkspace';
|
|
16
16
|
import { Workspaces } from '../pageobjects/dashboard/Workspaces';
|
|
17
|
-
import {
|
|
17
|
+
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
18
|
+
import { Logger } from '..';
|
|
18
19
|
|
|
19
20
|
@injectable()
|
|
20
21
|
export class WorkspaceHandlingTests {
|
|
@@ -29,16 +30,19 @@ export class WorkspaceHandlingTests {
|
|
|
29
30
|
@inject(CLASSES.Dashboard) private readonly dashboard: Dashboard,
|
|
30
31
|
@inject(CLASSES.CreateWorkspace) private readonly createWorkspace: CreateWorkspace,
|
|
31
32
|
@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
|
|
32
|
-
@inject(CLASSES.
|
|
33
|
+
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil) {}
|
|
33
34
|
|
|
34
35
|
public createAndOpenWorkspace(stack: string) {
|
|
35
36
|
test(`Open 'New Workspace' page`, async () => {
|
|
36
37
|
await this.dashboard.waitPage();
|
|
37
38
|
await this.dashboard.clickCreateWorkspaceButton();
|
|
38
39
|
await this.createWorkspace.waitPage();
|
|
40
|
+
const parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
39
41
|
await this.createWorkspace.clickOnSample(stack);
|
|
40
|
-
await this.
|
|
41
|
-
WorkspaceHandlingTests.workspaceName = await this.
|
|
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);
|
|
42
46
|
});
|
|
43
47
|
}
|
|
44
48
|
|
package/tsconfig.json
CHANGED
package/tslint.json
CHANGED
|
@@ -1,123 +1,127 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
],
|
|
9
|
-
[
|
|
10
|
-
"_",
|
|
11
|
-
"isNull"
|
|
12
|
-
],
|
|
13
|
-
[
|
|
14
|
-
"_",
|
|
15
|
-
"isDefined"
|
|
16
|
-
]
|
|
2
|
+
"rules": {
|
|
3
|
+
"ban": [
|
|
4
|
+
true,
|
|
5
|
+
[
|
|
6
|
+
"_",
|
|
7
|
+
"extend"
|
|
17
8
|
],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"check-space",
|
|
22
|
-
"check-lowercase"
|
|
9
|
+
[
|
|
10
|
+
"_",
|
|
11
|
+
"isNull"
|
|
23
12
|
],
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
"
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
13
|
+
[
|
|
14
|
+
"_",
|
|
15
|
+
"isDefined"
|
|
16
|
+
]
|
|
17
|
+
],
|
|
18
|
+
"class-name": true,
|
|
19
|
+
"comment-format": [
|
|
20
|
+
true,
|
|
21
|
+
"check-space",
|
|
22
|
+
"check-lowercase"
|
|
23
|
+
],
|
|
24
|
+
"curly": true,
|
|
25
|
+
"eofline": true,
|
|
26
|
+
"forin": true,
|
|
27
|
+
"indent": [
|
|
28
|
+
true,
|
|
29
|
+
2
|
|
30
|
+
],
|
|
31
|
+
"interface-name": true,
|
|
32
|
+
"jsdoc-format": true,
|
|
33
|
+
"label-position": true,
|
|
34
|
+
"max-line-length": [
|
|
35
|
+
false,
|
|
36
|
+
140
|
|
37
|
+
],
|
|
38
|
+
"member-ordering": [
|
|
39
|
+
true,
|
|
40
|
+
"public-before-private",
|
|
41
|
+
"static-before-instance",
|
|
42
|
+
"variables-before-functions"
|
|
43
|
+
],
|
|
44
|
+
"no-arg": true,
|
|
45
|
+
"no-bitwise": true,
|
|
46
|
+
"no-console": [
|
|
47
|
+
true,
|
|
48
|
+
"debug",
|
|
49
|
+
"info",
|
|
50
|
+
"time",
|
|
51
|
+
"timeEnd",
|
|
52
|
+
"trace"
|
|
53
|
+
],
|
|
54
|
+
"no-construct": true,
|
|
55
|
+
"no-parameter-properties": false,
|
|
56
|
+
"no-debugger": true,
|
|
57
|
+
"no-duplicate-variable": true,
|
|
58
|
+
"no-empty": true,
|
|
59
|
+
"no-eval": true,
|
|
60
|
+
"no-string-literal": true,
|
|
61
|
+
"no-switch-case-fall-through": true,
|
|
62
|
+
"trailing-comma": [true, {
|
|
63
|
+
"singleline": "never",
|
|
64
|
+
"multiline": {
|
|
65
|
+
"objects": "ignore",
|
|
66
|
+
"arrays": "always",
|
|
67
|
+
"functions": "never",
|
|
68
|
+
"typeLiterals": "ignore"
|
|
69
|
+
}
|
|
70
|
+
}],
|
|
71
|
+
"no-trailing-whitespace": true,
|
|
72
|
+
"no-unused-expression": true,
|
|
73
|
+
"no-unused-variable": true,
|
|
74
|
+
"no-use-before-declare": true,
|
|
75
|
+
"no-var-requires": false,
|
|
76
|
+
"one-line": [
|
|
77
|
+
true,
|
|
78
|
+
"check-open-brace",
|
|
79
|
+
"check-catch",
|
|
80
|
+
"check-else",
|
|
81
|
+
"check-whitespace"
|
|
82
|
+
],
|
|
83
|
+
"quotemark": [
|
|
84
|
+
true,
|
|
85
|
+
"single"
|
|
86
|
+
],
|
|
87
|
+
"radix": true,
|
|
88
|
+
"semicolon": true,
|
|
89
|
+
"triple-equals": [
|
|
90
|
+
true,
|
|
91
|
+
"allow-null-check"
|
|
92
|
+
],
|
|
93
|
+
"typedef": [
|
|
94
|
+
true,
|
|
95
|
+
"callSignature",
|
|
96
|
+
"indexSignature",
|
|
97
|
+
"parameter",
|
|
98
|
+
"propertySignature",
|
|
99
|
+
"variableDeclarator"
|
|
100
|
+
],
|
|
101
|
+
"typedef-whitespace": [
|
|
102
|
+
true,
|
|
103
|
+
[
|
|
90
104
|
"callSignature",
|
|
91
|
-
"
|
|
92
|
-
"parameter",
|
|
93
|
-
"propertySignature",
|
|
94
|
-
"variableDeclarator"
|
|
105
|
+
"noSpace"
|
|
95
106
|
],
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"callSignature",
|
|
100
|
-
"noSpace"
|
|
101
|
-
],
|
|
102
|
-
[
|
|
103
|
-
"catchClause",
|
|
104
|
-
"noSpace"
|
|
105
|
-
],
|
|
106
|
-
[
|
|
107
|
-
"indexSignature",
|
|
108
|
-
"space"
|
|
109
|
-
]
|
|
107
|
+
[
|
|
108
|
+
"catchClause",
|
|
109
|
+
"noSpace"
|
|
110
110
|
],
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
true,
|
|
115
|
-
"check-branch",
|
|
116
|
-
"check-decl",
|
|
117
|
-
"check-operator",
|
|
118
|
-
"check-separator",
|
|
119
|
-
"check-type"
|
|
111
|
+
[
|
|
112
|
+
"indexSignature",
|
|
113
|
+
"space"
|
|
120
114
|
]
|
|
121
|
-
|
|
115
|
+
],
|
|
116
|
+
"use-strict": false,
|
|
117
|
+
"variable-name": false,
|
|
118
|
+
"whitespace": [
|
|
119
|
+
true,
|
|
120
|
+
"check-branch",
|
|
121
|
+
"check-decl",
|
|
122
|
+
"check-operator",
|
|
123
|
+
"check-separator",
|
|
124
|
+
"check-type"
|
|
125
|
+
]
|
|
122
126
|
}
|
|
123
|
-
|
|
127
|
+
}
|
|
@@ -8,20 +8,14 @@
|
|
|
8
8
|
* SPDX-License-Identifier: EPL-2.0
|
|
9
9
|
**********************************************************************/
|
|
10
10
|
import { AxiosRequestConfig } from 'axios';
|
|
11
|
-
|
|
12
|
-
import { TYPES } from '../../../inversify.types';
|
|
13
11
|
import { IAuthorizationHeaderHandler } from './IAuthorizationHeaderHandler';
|
|
14
|
-
import { injectable
|
|
15
|
-
import { ITokenHandler } from '../tokens/ITokenHandler';
|
|
12
|
+
import { injectable } from 'inversify';
|
|
16
13
|
|
|
17
14
|
@injectable()
|
|
18
15
|
export class CheMultiuserAuthorizationHeaderHandler implements IAuthorizationHeaderHandler {
|
|
19
16
|
|
|
20
|
-
constructor(@inject(TYPES.ITokenHandler) private readonly tokenHandler: ITokenHandler) {
|
|
21
|
-
}
|
|
22
|
-
|
|
23
17
|
async get(): Promise<AxiosRequestConfig> {
|
|
24
|
-
|
|
25
|
-
return { headers: { '
|
|
18
|
+
// to-do : Fetch the cookies from user api and pass it here
|
|
19
|
+
return { headers: { 'cookie': `` } };
|
|
26
20
|
}
|
|
27
21
|
}
|
|
@@ -12,28 +12,30 @@ import querystring from 'querystring';
|
|
|
12
12
|
import { injectable } from 'inversify';
|
|
13
13
|
import { TestConstants } from '../../../TestConstants';
|
|
14
14
|
import { ITokenHandler } from './ITokenHandler';
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
|
|
17
17
|
@injectable()
|
|
18
18
|
export class CheMultiuserTokenHandler implements ITokenHandler {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const params = {
|
|
23
|
-
client_id: 'che-public',
|
|
24
|
-
username: TestConstants.TS_SELENIUM_USERNAME,
|
|
25
|
-
password: TestConstants.TS_SELENIUM_PASSWORD,
|
|
26
|
-
grant_type: 'password'
|
|
27
|
-
};
|
|
19
|
+
async get(): Promise<string> {
|
|
20
|
+
// to-do: Login to the che-dashboard and fetch the authorization related info
|
|
21
|
+
const keycloakUrl = '';
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
23
|
+
const params = {
|
|
24
|
+
client_id: 'che-public',
|
|
25
|
+
username: TestConstants.TS_SELENIUM_USERNAME,
|
|
26
|
+
password: TestConstants.TS_SELENIUM_PASSWORD,
|
|
27
|
+
grant_type: 'password',
|
|
28
|
+
};
|
|
36
29
|
|
|
30
|
+
try {
|
|
31
|
+
const responseToObtainBearerToken = await axios.post(
|
|
32
|
+
keycloakUrl,
|
|
33
|
+
querystring.stringify(params)
|
|
34
|
+
);
|
|
35
|
+
return responseToObtainBearerToken.data.access_token;
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.log(`Can not get bearer token. URL used: ${keycloakUrl}`);
|
|
38
|
+
throw err;
|
|
37
39
|
}
|
|
38
|
-
|
|
40
|
+
}
|
|
39
41
|
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*********************************************************************
|
|
3
|
-
* Copyright (c) 2019 Red Hat, Inc.
|
|
4
|
-
*
|
|
5
|
-
* This program and the accompanying materials are made
|
|
6
|
-
* available under the terms of the Eclipse Public License 2.0
|
|
7
|
-
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
8
|
-
*
|
|
9
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
10
|
-
**********************************************************************/
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.KeycloackUrlHandler = void 0;
|
|
13
|
-
const TestConstants_1 = require("../TestConstants");
|
|
14
|
-
class KeycloackUrlHandler {
|
|
15
|
-
static getBaseKeycloakUrl() {
|
|
16
|
-
let baseKeycloakUrl = TestConstants_1.TestConstants.TS_SELENIUM_BASE_URL;
|
|
17
|
-
if (!TestConstants_1.TestConstants.TS_SELENIUM_SINGLE_HOST) {
|
|
18
|
-
baseKeycloakUrl = baseKeycloakUrl.replace('che', 'keycloak');
|
|
19
|
-
}
|
|
20
|
-
return baseKeycloakUrl;
|
|
21
|
-
}
|
|
22
|
-
static getTokenEndpointUrl() {
|
|
23
|
-
return `${this.getBaseKeycloakUrl()}/auth/realms/che/protocol/openid-connect/token`;
|
|
24
|
-
}
|
|
25
|
-
static getIdentityCallbackUrl() {
|
|
26
|
-
return `${this.getBaseKeycloakUrl()}/auth/realms/che/broker/github/endpoint`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.KeycloackUrlHandler = KeycloackUrlHandler;
|
|
30
|
-
//# sourceMappingURL=KeycloackUrlHandler.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KeycloackUrlHandler.js","sourceRoot":"","sources":["../../utils/KeycloackUrlHandler.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;AAExE,oDAAiD;AAEjD,MAAa,mBAAmB;IACrB,MAAM,CAAC,kBAAkB;QAC5B,IAAI,eAAe,GAAW,6BAAa,CAAC,oBAAoB,CAAC;QAEjE,IAAI,CAAC,6BAAa,CAAC,uBAAuB,EAAE;YACxC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;SAChE;QAED,OAAO,eAAe,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,mBAAmB;QAC7B,OAAO,GAAG,IAAI,CAAC,kBAAkB,EAAE,gDAAgD,CAAC;IACxF,CAAC;IAEM,MAAM,CAAC,sBAAsB;QAChC,OAAO,GAAG,IAAI,CAAC,kBAAkB,EAAE,yCAAyC,CAAC;IACjF,CAAC;CAEJ;AAnBD,kDAmBC"}
|