@eclipse-che/che-e2e 7.46.1-dev-409a251 → 7.46.1-dev-7eff412
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/TestConstants.ts +6 -1
- package/dist/TestConstants.js +5 -1
- package/dist/TestConstants.js.map +1 -1
- package/dist/driver/CheReporter.js +6 -2
- package/dist/driver/CheReporter.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/inversify.config.js +2 -0
- package/dist/inversify.config.js.map +1 -1
- package/dist/inversify.types.js +2 -1
- package/dist/inversify.types.js.map +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js +1 -1
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +1 -1
- package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +1 -1
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +7 -0
- package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +1 -1
- package/dist/tests/devfiles/DevfileSmoke.spec.js +7 -0
- package/dist/tests/devfiles/DevfileSmoke.spec.js.map +1 -1
- package/dist/tests/devfiles/DotNetCore.spec.js +7 -0
- package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
- package/dist/tests/devfiles/Go.spec.js +7 -0
- package/dist/tests/devfiles/Go.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaMaven.spec.js +7 -0
- package/dist/tests/devfiles/JavaMaven.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaSpringBoot.spec.js +7 -0
- package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +1 -1
- package/dist/tests/devfiles/JavaVertx.spec.js +7 -0
- package/dist/tests/devfiles/JavaVertx.spec.js.map +1 -1
- package/dist/tests/devfiles/NodeJS.spec.js +7 -0
- package/dist/tests/devfiles/NodeJS.spec.js.map +1 -1
- package/dist/tests/devfiles/PHPSimple.spec.js +7 -0
- package/dist/tests/devfiles/PHPSimple.spec.js.map +1 -1
- package/dist/tests/devfiles/Python.spec.js +7 -0
- package/dist/tests/devfiles/Python.spec.js.map +1 -1
- package/dist/tests/devfiles/PythonDjango.spec.js +7 -0
- package/dist/tests/devfiles/PythonDjango.spec.js.map +1 -1
- package/dist/tests/devfiles/Quarkus.spec.js +7 -0
- package/dist/tests/devfiles/Quarkus.spec.js.map +1 -1
- package/dist/tests/devfiles/Scala.spec.js +7 -0
- package/dist/tests/devfiles/Scala.spec.js.map +1 -1
- package/dist/tests/e2e/GitPublishBranch.spec.js +5 -0
- package/dist/tests/e2e/GitPublishBranch.spec.js.map +1 -1
- package/dist/tests/e2e/GitSelfSignCert.spec.js +5 -0
- package/dist/tests/e2e/GitSelfSignCert.spec.js.map +1 -1
- package/dist/tests/e2e/GitSsh.spec.js +6 -0
- package/dist/tests/e2e/GitSsh.spec.js.map +1 -1
- package/dist/tests/e2e/OpenshiftConnector.spec.js +5 -0
- package/dist/tests/e2e/OpenshiftConnector.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +2 -0
- package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
- package/dist/tests/e2e_happy_path/HappyPath.spec.js +5 -0
- package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js +6 -11
- package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +1 -1
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js +5 -10
- package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +1 -1
- package/dist/testsLibrary/CodeExecutionTests.js.map +1 -1
- package/dist/testsLibrary/WorkspaceHandlingTests.js +13 -5
- package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
- package/dist/utils/requestHandlers/CheApiRequestHandler.js.map +1 -1
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +17 -2
- package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
- package/dist/utils/workspace/ApiUrlResolver.js +67 -0
- package/dist/utils/workspace/ApiUrlResolver.js.map +1 -0
- package/dist/utils/workspace/TestWorkspaceUtil.js +60 -30
- package/dist/utils/workspace/TestWorkspaceUtil.js.map +1 -1
- package/dist/utils/workspace/WorkspaceStatus.js.map +1 -1
- package/driver/CheReporter.ts +8 -2
- package/index.ts +1 -0
- package/inversify.config.ts +4 -2
- package/inversify.types.ts +2 -1
- package/mocha-all-plugins.json +2 -1
- package/package.json +1 -1
- package/pageobjects/dashboard/Dashboard.ts +10 -11
- package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +2 -2
- package/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.ts +3 -3
- package/tests/devfiles/CSlashCPlusPlus.spec.ts +4 -0
- package/tests/devfiles/DevfileSmoke.spec.ts +4 -0
- package/tests/devfiles/DotNetCore.spec.ts +4 -0
- package/tests/devfiles/Go.spec.ts +4 -0
- package/tests/devfiles/JavaMaven.spec.ts +4 -0
- package/tests/devfiles/JavaSpringBoot.spec.ts +4 -0
- package/tests/devfiles/JavaVertx.spec.ts +4 -0
- package/tests/devfiles/NodeJS.spec.ts +4 -0
- package/tests/devfiles/PHPSimple.spec.ts +4 -0
- package/tests/devfiles/Python.spec.ts +4 -0
- package/tests/devfiles/PythonDjango.spec.ts +4 -0
- package/tests/devfiles/Quarkus.spec.ts +4 -0
- package/tests/devfiles/Scala.spec.ts +4 -0
- package/tests/e2e/GitPublishBranch.spec.ts +4 -2
- package/tests/e2e/GitSelfSignCert.spec.ts +4 -2
- package/tests/e2e/GitSsh.spec.ts +5 -2
- package/tests/e2e/OpenshiftConnector.spec.ts +4 -2
- package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +2 -0
- package/tests/e2e_happy_path/HappyPath.spec.ts +2 -0
- package/tests/plugins/VscodeXmlPlugin.spec.ts +6 -13
- package/tests/plugins/VscodeYamlPlugin.spec.ts +6 -11
- package/testsLibrary/CodeExecutionTests.ts +1 -3
- package/testsLibrary/WorkspaceHandlingTests.ts +10 -4
- package/utils/requestHandlers/CheApiRequestHandler.ts +1 -1
- package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +17 -2
- package/utils/workspace/ApiUrlResolver.ts +50 -0
- package/utils/workspace/ITestWorkspaceUtil.ts +73 -1
- package/utils/workspace/TestWorkspaceUtil.ts +65 -33
- package/utils/workspace/WorkspaceStatus.ts +1 -1
|
@@ -14,6 +14,7 @@ import { e2eContainer } from '../../inversify.config';
|
|
|
14
14
|
import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
15
15
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
17
|
+
import CheReporter from '../../driver/CheReporter';
|
|
17
18
|
|
|
18
19
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
19
20
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -35,6 +36,9 @@ suite(`${workspaceStack} test`, async () => {
|
|
|
35
36
|
suite(`Create ${workspaceStack}`, async () => {
|
|
36
37
|
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);
|
|
37
38
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
39
|
+
test('Register running workspace', async () => {
|
|
40
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
41
|
+
});
|
|
38
42
|
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
|
|
39
43
|
});
|
|
40
44
|
|
|
@@ -15,6 +15,7 @@ import { LanguageServerTests } from '../../testsLibrary/LanguageServerTests';
|
|
|
15
15
|
import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
16
16
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
17
17
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
18
|
+
import CheReporter from '../../driver/CheReporter';
|
|
18
19
|
|
|
19
20
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
20
21
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -34,6 +35,9 @@ suite(`${stack} test`, async () => {
|
|
|
34
35
|
suite (`Create ${stack} workspace`, async () => {
|
|
35
36
|
workspaceHandlingTests.createAndOpenWorkspace(stack);
|
|
36
37
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
38
|
+
test('Register running workspace', async () => {
|
|
39
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
40
|
+
});
|
|
37
41
|
projectAndFileTests.waitWorkspaceReadinessNoSubfolder(workspaceSampleName, false);
|
|
38
42
|
});
|
|
39
43
|
|
|
@@ -14,6 +14,7 @@ import { e2eContainer } from '../../inversify.config';
|
|
|
14
14
|
import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
15
15
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
17
|
+
import CheReporter from '../../driver/CheReporter';
|
|
17
18
|
|
|
18
19
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
19
20
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -32,6 +33,9 @@ suite(`${workspaceStack} test`, async () => {
|
|
|
32
33
|
suite(`Create ${workspaceStack} workspace`, async () => {
|
|
33
34
|
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);
|
|
34
35
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
36
|
+
test('Register running workspace', async () => {
|
|
37
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
38
|
+
});
|
|
35
39
|
projectAndFileTests.waitWorkspaceReadinessNoSubfolder(workspaceSampleName, false);
|
|
36
40
|
});
|
|
37
41
|
|
|
@@ -13,6 +13,7 @@ import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
|
13
13
|
import { e2eContainer } from '../../inversify.config';
|
|
14
14
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
15
15
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
16
|
+
import CheReporter from '../../driver/CheReporter';
|
|
16
17
|
|
|
17
18
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
18
19
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -34,6 +35,9 @@ suite(`${workspaceStack} test`, async () => {
|
|
|
34
35
|
suite(`Create ${workspaceStack} workspace`, async () => {
|
|
35
36
|
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);
|
|
36
37
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
38
|
+
test('Register running workspace', async () => {
|
|
39
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
40
|
+
});
|
|
37
41
|
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
|
|
38
42
|
});
|
|
39
43
|
|
|
@@ -14,6 +14,7 @@ import { e2eContainer } from '../../inversify.config';
|
|
|
14
14
|
import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
15
15
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
17
|
+
import CheReporter from '../../driver/CheReporter';
|
|
17
18
|
|
|
18
19
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
19
20
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -34,6 +35,9 @@ suite(`${workspaceStack} test`, async () => {
|
|
|
34
35
|
suite(`Create ${workspaceStack}`, async () => {
|
|
35
36
|
workspaceHandlingTests.createAndOpenWorkspace(workspaceStack);
|
|
36
37
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
38
|
+
test('Register running workspace', async () => {
|
|
39
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
40
|
+
});
|
|
37
41
|
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
|
|
38
42
|
});
|
|
39
43
|
|
|
@@ -14,6 +14,7 @@ import { e2eContainer } from '../../inversify.config';
|
|
|
14
14
|
import { CodeExecutionTests } from '../../testsLibrary/CodeExecutionTests';
|
|
15
15
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
16
16
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
17
|
+
import CheReporter from '../../driver/CheReporter';
|
|
17
18
|
|
|
18
19
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
19
20
|
const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
|
|
@@ -34,6 +35,9 @@ suite.skip(`${stack} test`, async () => {
|
|
|
34
35
|
suite (`Create ${stack} workspace`, async () => {
|
|
35
36
|
workspaceHandlingTests.createAndOpenWorkspace(stack);
|
|
36
37
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
38
|
+
test('Register running workspace', async () => {
|
|
39
|
+
CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
40
|
+
});
|
|
37
41
|
projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
|
|
38
42
|
});
|
|
39
43
|
|
|
@@ -18,12 +18,13 @@ import { QuickOpenContainer } from '../../pageobjects/ide/QuickOpenContainer';
|
|
|
18
18
|
import { ICheLoginPage } from '../../pageobjects/login/ICheLoginPage';
|
|
19
19
|
import { TestConstants } from '../../TestConstants';
|
|
20
20
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
21
|
-
import { TestWorkspaceUtil } from '../../utils/workspace/TestWorkspaceUtil';
|
|
22
21
|
import { TopMenu } from '../../pageobjects/ide/TopMenu';
|
|
23
22
|
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
|
|
24
23
|
import { By } from 'selenium-webdriver';
|
|
25
24
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
26
25
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
26
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
27
|
+
import CheReporter from '../../driver/CheReporter';
|
|
27
28
|
|
|
28
29
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
29
30
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
@@ -34,7 +35,7 @@ const topMenu: TopMenu = e2eContainer.get(CLASSES.TopMenu);
|
|
|
34
35
|
const loginPage: ICheLoginPage = e2eContainer.get<ICheLoginPage>(TYPES.CheLogin);
|
|
35
36
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
36
37
|
const gitPlugin: GitPlugin = e2eContainer.get(CLASSES.GitPlugin);
|
|
37
|
-
const testWorkspaceUtils:
|
|
38
|
+
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
|
|
38
39
|
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
|
|
39
40
|
|
|
40
41
|
const workspacePrefixUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/dashboard/#/ide/${TestConstants.TS_SELENIUM_USERNAME}/`;
|
|
@@ -54,6 +55,7 @@ suite('Publish branch in git extension', async () => {
|
|
|
54
55
|
await browserTabsUtil.navigateTo(workspacePrefixUrl + wsNameGitPublishBranch);
|
|
55
56
|
await loginPage.login();
|
|
56
57
|
WorkspaceHandlingTests.setWorkspaceName(wsNameGitPublishBranch);
|
|
58
|
+
CheReporter.registerRunningWorkspace(wsNameGitPublishBranch);
|
|
57
59
|
await ide.waitWorkspaceAndIde();
|
|
58
60
|
await projectTree.openProjectTreeContainer();
|
|
59
61
|
await driverHelper.wait(15000);
|
|
@@ -17,13 +17,14 @@ import { QuickOpenContainer } from '../../pageobjects/ide/QuickOpenContainer';
|
|
|
17
17
|
import { ICheLoginPage } from '../../pageobjects/login/ICheLoginPage';
|
|
18
18
|
import { TestConstants } from '../../TestConstants';
|
|
19
19
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
20
|
-
import { TestWorkspaceUtil } from '../../utils/workspace/TestWorkspaceUtil';
|
|
21
20
|
import { TopMenu } from '../../pageobjects/ide/TopMenu';
|
|
22
21
|
import { TimeoutConstants } from '../../TimeoutConstants';
|
|
23
22
|
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
|
24
23
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
25
24
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
26
25
|
import { Editor } from '../../pageobjects/ide/Editor';
|
|
26
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
27
|
+
import CheReporter from '../../driver/CheReporter';
|
|
27
28
|
|
|
28
29
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
29
30
|
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
|
@@ -33,7 +34,7 @@ const topMenu: TopMenu = e2eContainer.get(CLASSES.TopMenu);
|
|
|
33
34
|
const loginPage: ICheLoginPage = e2eContainer.get<ICheLoginPage>(TYPES.CheLogin);
|
|
34
35
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
35
36
|
const gitPlugin: GitPlugin = e2eContainer.get(CLASSES.GitPlugin);
|
|
36
|
-
const testWorkspaceUtils:
|
|
37
|
+
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
|
|
37
38
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
38
39
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
39
40
|
const editor: Editor = e2eContainer.get(CLASSES.Editor);
|
|
@@ -49,6 +50,7 @@ suite('Checking git + self sign cert', async () => {
|
|
|
49
50
|
const wsConfig = await testWorkspaceUtils.getBaseDevfile();
|
|
50
51
|
wsConfig.metadata!.name = workspaceName;
|
|
51
52
|
WorkspaceHandlingTests.setWorkspaceName(workspaceName);
|
|
53
|
+
CheReporter.registerRunningWorkspace(workspaceName);
|
|
52
54
|
await browserTabsUtil.navigateTo(TestConstants.TS_SELENIUM_BASE_URL);
|
|
53
55
|
await loginPage.login();
|
|
54
56
|
await testWorkspaceUtils.createWsFromDevFile(wsConfig);
|
package/tests/e2e/GitSsh.spec.ts
CHANGED
|
@@ -22,12 +22,13 @@ import { DriverHelper } from '../../utils/DriverHelper';
|
|
|
22
22
|
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
|
|
23
23
|
import { CheGitApi } from '../../utils/VCS/CheGitApi';
|
|
24
24
|
import { GitHubUtil } from '../../utils/VCS/github/GitHubUtil';
|
|
25
|
-
import { TestWorkspaceUtil } from '../../utils/workspace/TestWorkspaceUtil';
|
|
26
25
|
import { TopMenu } from '../../pageobjects/ide/TopMenu';
|
|
27
26
|
import { TimeoutConstants } from '../../TimeoutConstants';
|
|
28
27
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
29
28
|
import { Dashboard } from '../..';
|
|
30
29
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
30
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
31
|
+
import CheReporter from '../../driver/CheReporter';
|
|
31
32
|
|
|
32
33
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
33
34
|
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
|
@@ -39,7 +40,7 @@ const gitHubUtils: GitHubUtil = e2eContainer.get<GitHubUtil>(CLASSES.GitHubUtil)
|
|
|
39
40
|
const cheGitAPI: CheGitApi = e2eContainer.get(CLASSES.CheGitApi);
|
|
40
41
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
41
42
|
const gitPlugin: GitPlugin = e2eContainer.get(CLASSES.GitPlugin);
|
|
42
|
-
const testWorkspaceUtils:
|
|
43
|
+
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
|
|
43
44
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
44
45
|
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
|
|
45
46
|
const workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
|
|
@@ -62,6 +63,7 @@ suite('Git with ssh workflow', async () => {
|
|
|
62
63
|
await dashboard.openDashboard();
|
|
63
64
|
await browserTabsUtil.navigateTo(workspacePrefixUrl + wsNameCheckGeneratingKeys);
|
|
64
65
|
WorkspaceHandlingTests.setWorkspaceName(wsNameCheckGeneratingKeys);
|
|
66
|
+
CheReporter.registerRunningWorkspace(wsNameCheckGeneratingKeys);
|
|
65
67
|
await ide.waitWorkspaceAndIde();
|
|
66
68
|
await projectTree.openProjectTreeContainer();
|
|
67
69
|
await driverHelper.wait(TimeoutConstants.TS_PROJECT_TREE_TIMEOUT);
|
|
@@ -112,6 +114,7 @@ suite('Git with ssh workflow', async () => {
|
|
|
112
114
|
await dashboard.openDashboard();
|
|
113
115
|
await browserTabsUtil.navigateTo(workspacePrefixUrl + wsNameCheckPropagatingKeys);
|
|
114
116
|
WorkspaceHandlingTests.setWorkspaceName(wsNameCheckPropagatingKeys);
|
|
117
|
+
CheReporter.registerRunningWorkspace(wsNameCheckGeneratingKeys);
|
|
115
118
|
await ide.waitWorkspaceAndIde();
|
|
116
119
|
await projectTree.openProjectTreeContainer();
|
|
117
120
|
await driverHelper.wait(TimeoutConstants.TS_PROJECT_TREE_TIMEOUT);
|
|
@@ -23,15 +23,16 @@ import { ICheLoginPage } from '../../pageobjects/login/ICheLoginPage';
|
|
|
23
23
|
import { TestConstants } from '../../TestConstants';
|
|
24
24
|
import { DriverHelper } from '../../utils/DriverHelper';
|
|
25
25
|
import { PreferencesHandler, TerminalRendererType } from '../../utils/PreferencesHandler';
|
|
26
|
-
import { TestWorkspaceUtil } from '../../utils/workspace/TestWorkspaceUtil';
|
|
27
26
|
import { TimeoutConstants } from '../../TimeoutConstants';
|
|
28
27
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
29
28
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
29
|
+
import { ITestWorkspaceUtil } from '../../utils/workspace/ITestWorkspaceUtil';
|
|
30
|
+
import CheReporter from '../../driver/CheReporter';
|
|
30
31
|
|
|
31
32
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
32
33
|
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
|
33
34
|
const loginPage: ICheLoginPage = e2eContainer.get<ICheLoginPage>(TYPES.CheLogin);
|
|
34
|
-
const testWorkspaceUtils:
|
|
35
|
+
const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
|
|
35
36
|
const openshiftPlugin: OpenshiftPlugin = e2eContainer.get(CLASSES.OpenshiftPlugin);
|
|
36
37
|
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
|
37
38
|
const quickOpenContainer: QuickOpenContainer = e2eContainer.get(CLASSES.QuickOpenContainer);
|
|
@@ -78,6 +79,7 @@ suite('Openshift connector user story', async () => {
|
|
|
78
79
|
await dashboard.openDashboard();
|
|
79
80
|
await browserTabsUtil.navigateTo(workspacePrefixUrl + wsName);
|
|
80
81
|
WorkspaceHandlingTests.setWorkspaceName(wsName);
|
|
82
|
+
CheReporter.registerRunningWorkspace(wsName);
|
|
81
83
|
await ide.waitWorkspaceAndIde();
|
|
82
84
|
await projectTree.openProjectTreeContainer();
|
|
83
85
|
await projectTree.waitProjectImported(projectName, 'index.js');
|
|
@@ -25,6 +25,7 @@ import { TopMenu } from '../../pageobjects/ide/TopMenu';
|
|
|
25
25
|
import * as fs from 'fs';
|
|
26
26
|
import axios from 'axios';
|
|
27
27
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
28
|
+
import CheReporter from '../../driver/CheReporter';
|
|
28
29
|
|
|
29
30
|
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
|
30
31
|
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
|
@@ -66,6 +67,7 @@ suite('Workspace creation via factory url', async () => {
|
|
|
66
67
|
|
|
67
68
|
test('Register running workspace', async () => {
|
|
68
69
|
WorkspaceHandlingTests.setWorkspaceName(projectName);
|
|
70
|
+
CheReporter.registerRunningWorkspace(projectName);
|
|
69
71
|
});
|
|
70
72
|
|
|
71
73
|
test('Register running workspace', async () => {
|
|
@@ -29,6 +29,7 @@ import { Logger } from '../../utils/Logger';
|
|
|
29
29
|
import { RightToolBar } from '../../pageobjects/ide/RightToolBar';
|
|
30
30
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
31
31
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
32
|
+
import CheReporter from '../../driver/CheReporter';
|
|
32
33
|
|
|
33
34
|
const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
|
|
34
35
|
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
|
@@ -76,6 +77,7 @@ suite('Validation of workspace start', async () => {
|
|
|
76
77
|
|
|
77
78
|
test('Register running workspace', async () => {
|
|
78
79
|
WorkspaceHandlingTests.setWorkspaceName(workspaceName);
|
|
80
|
+
CheReporter.registerRunningWorkspace(workspaceName);
|
|
79
81
|
});
|
|
80
82
|
|
|
81
83
|
test('Wait for workspace readiness', async () => {
|
|
@@ -14,9 +14,7 @@ import { CLASSES } from '../../inversify.types';
|
|
|
14
14
|
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
|
|
15
15
|
import { Editor } from '../../pageobjects/ide/Editor';
|
|
16
16
|
import { TestConstants } from '../../TestConstants';
|
|
17
|
-
import { Logger } from '../../utils/Logger';
|
|
18
17
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
19
|
-
|
|
20
18
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
21
19
|
import { PreferencesHandler } from '../../utils/PreferencesHandler';
|
|
22
20
|
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';
|
|
@@ -28,13 +26,12 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
|
|
|
28
26
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
29
27
|
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
30
28
|
|
|
31
|
-
const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin';
|
|
29
|
+
const devfileUrl: string = TestConstants.TS_TEST_WORKSPACE_DEVFILE_REPO || 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin';
|
|
32
30
|
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
|
|
33
31
|
const projectName: string = 'web-nodejs-sample';
|
|
34
32
|
const pathToFile: string = `${projectName}`;
|
|
35
33
|
const xmlFileName: string = 'hello.xml';
|
|
36
34
|
const subRootFolder: string = 'app';
|
|
37
|
-
let workspaceName: string = 'xml-plugin';
|
|
38
35
|
|
|
39
36
|
suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
40
37
|
suite('Create workspace', async () => {
|
|
@@ -45,13 +42,13 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
45
42
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
46
43
|
|
|
47
44
|
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
|
|
45
|
+
});
|
|
48
46
|
|
|
47
|
+
suite('Check the "vscode-xml" plugin', async () => {
|
|
49
48
|
test('Set confirmExit preference to never', async () => {
|
|
50
49
|
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
|
|
51
50
|
});
|
|
52
|
-
});
|
|
53
51
|
|
|
54
|
-
suite('Check the "vscode-xml" plugin', async () => {
|
|
55
52
|
test('Check autocomplete', async () => {
|
|
56
53
|
await projectTree.expandPathAndOpenFile(pathToFile, xmlFileName);
|
|
57
54
|
await editor.waitSuggestion(xmlFileName, 'rollback', 60000, 16, 4);
|
|
@@ -98,14 +95,10 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
|
|
|
98
95
|
|
|
99
96
|
});
|
|
100
97
|
|
|
101
|
-
suite('
|
|
98
|
+
suite ('Stopping and deleting the workspace', async () => {
|
|
102
99
|
test('Stop and remove workspace', async () => {
|
|
103
|
-
|
|
104
|
-
await workspaceHandlingTests.stopAndRemoveWorkspace(workspaceName);
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
Logger.info(`As far as the "TS_DELETE_PLUGINS_TEST_WORKSPACE" value is "false the workspace deletion is skipped"`);
|
|
100
|
+
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
109
101
|
});
|
|
110
102
|
});
|
|
103
|
+
|
|
111
104
|
});
|
|
@@ -14,7 +14,6 @@ import { CLASSES } from '../../inversify.types';
|
|
|
14
14
|
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
|
|
15
15
|
import { Editor } from '../../pageobjects/ide/Editor';
|
|
16
16
|
import { TestConstants } from '../../TestConstants';
|
|
17
|
-
import { Logger } from '../../utils/Logger';
|
|
18
17
|
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
|
|
19
18
|
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
|
|
20
19
|
import { PreferencesHandler } from '../../utils/PreferencesHandler';
|
|
@@ -27,7 +26,7 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
|
|
|
27
26
|
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
|
|
28
27
|
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);
|
|
29
28
|
|
|
30
|
-
const devfileUrl: string = 'https://github.com/che-samples/web-nodejs-sample/tree/yaml-plugin';
|
|
29
|
+
const devfileUrl: string = TestConstants.TS_TEST_WORKSPACE_DEVFILE_REPO || 'https://github.com/che-samples/web-nodejs-sample/tree/yaml-plugin';
|
|
31
30
|
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
|
|
32
31
|
const projectName: string = 'web-nodejs-sample';
|
|
33
32
|
const subRootFolder: string = 'app';
|
|
@@ -44,13 +43,13 @@ suite('The "VscodeYamlPlugin" userstory', async () => {
|
|
|
44
43
|
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
|
|
45
44
|
|
|
46
45
|
projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);
|
|
46
|
+
});
|
|
47
47
|
|
|
48
|
+
suite('Check the "vscode-yaml" plugin', async () => {
|
|
48
49
|
test('Set confirmExit preference to never', async () => {
|
|
49
50
|
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
|
|
50
51
|
});
|
|
51
|
-
});
|
|
52
52
|
|
|
53
|
-
suite('Check the "vscode-yaml" plugin', async () => {
|
|
54
53
|
test('Set the yaml schema path', async () => {
|
|
55
54
|
await preferencesHandler.setPreferenceUsingUI('yaml.schemas', yamlSchema);
|
|
56
55
|
});
|
|
@@ -91,14 +90,10 @@ suite('The "VscodeYamlPlugin" userstory', async () => {
|
|
|
91
90
|
|
|
92
91
|
});
|
|
93
92
|
|
|
94
|
-
suite('
|
|
93
|
+
suite ('Stopping and deleting the workspace', async () => {
|
|
95
94
|
test('Stop and remove workspace', async () => {
|
|
96
|
-
|
|
97
|
-
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
Logger.info(`As far as the "TS_DELETE_PLUGINS_TEST_WORKSPACE" value is "false the workspace deletion is skipped"`);
|
|
95
|
+
await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
|
|
102
96
|
});
|
|
103
97
|
});
|
|
98
|
+
|
|
104
99
|
});
|
|
@@ -36,9 +36,7 @@ export class CodeExecutionTests {
|
|
|
36
36
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
|
|
37
37
|
@inject(CLASSES.QuickOpenContainer) private readonly quickOpenContainer: QuickOpenContainer,
|
|
38
38
|
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
39
|
-
@inject(CLASSES.WorkspaceHandlingTests) private readonly workspaceHandlingTests:WorkspaceHandlingTests
|
|
40
|
-
|
|
41
|
-
) {}
|
|
39
|
+
@inject(CLASSES.WorkspaceHandlingTests) private readonly workspaceHandlingTests: WorkspaceHandlingTests) {}
|
|
42
40
|
|
|
43
41
|
public runTask(taskName: string, timeout: number) {
|
|
44
42
|
test(`Run command '${taskName}'`, async () => {
|
|
@@ -16,9 +16,10 @@ import { CreateWorkspace } from '../pageobjects/dashboard/CreateWorkspace';
|
|
|
16
16
|
import { Workspaces } from '../pageobjects/dashboard/Workspaces';
|
|
17
17
|
import { BrowserTabsUtil } from '../utils/BrowserTabsUtil';
|
|
18
18
|
import { Logger } from '../utils/Logger';
|
|
19
|
-
import {
|
|
19
|
+
import { ApiUrlResolver } from '../utils/workspace/ApiUrlResolver';
|
|
20
20
|
import { DriverHelper } from '../utils/DriverHelper';
|
|
21
21
|
import { Ide } from '../pageobjects/ide/Ide';
|
|
22
|
+
import { TimeoutConstants } from '../TimeoutConstants';
|
|
22
23
|
import { By, error } from 'selenium-webdriver';
|
|
23
24
|
|
|
24
25
|
@injectable()
|
|
@@ -50,11 +51,14 @@ export class WorkspaceHandlingTests {
|
|
|
50
51
|
@inject(CLASSES.Workspaces) private readonly workspaces: Workspaces,
|
|
51
52
|
@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper,
|
|
52
53
|
@inject(CLASSES.BrowserTabsUtil) private readonly browserTabsUtil: BrowserTabsUtil,
|
|
53
|
-
@inject(CLASSES.Ide) private readonly ide: Ide
|
|
54
|
+
@inject(CLASSES.Ide) private readonly ide: Ide,
|
|
55
|
+
@inject(CLASSES.ApiUrlResolver) private readonly apiUrlResolver: ApiUrlResolver) {}
|
|
54
56
|
|
|
55
57
|
public createAndOpenWorkspace(stack: string) {
|
|
56
58
|
test(`Create and open new workspace, stack:${stack}`, async () => {
|
|
57
59
|
await this.dashboard.waitPage();
|
|
60
|
+
Logger.debug(`Fetching user kubernetes namespace, storing auth token by getting workspaces API URL.`);
|
|
61
|
+
await this.apiUrlResolver.getWorkspacesApiUrl();
|
|
58
62
|
await this.dashboard.clickCreateWorkspaceButton();
|
|
59
63
|
await this.createWorkspace.waitPage();
|
|
60
64
|
WorkspaceHandlingTests.parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
|
|
@@ -66,6 +70,8 @@ export class WorkspaceHandlingTests {
|
|
|
66
70
|
public openExistingWorkspace(workspaceName: string) {
|
|
67
71
|
test('Open and start existing workspace', async () => {
|
|
68
72
|
await this.dashboard.waitPage();
|
|
73
|
+
Logger.debug(`Fetching user kubernetes namespace, storing auth token by getting workspaces API URL.`);
|
|
74
|
+
await this.apiUrlResolver.getWorkspacesApiUrl();
|
|
69
75
|
await this.dashboard.clickWorkspacesButton();
|
|
70
76
|
await this.workspaces.waitPage();
|
|
71
77
|
await this.workspaces.clickOpenButton(workspaceName);
|
|
@@ -77,7 +83,7 @@ export class WorkspaceHandlingTests {
|
|
|
77
83
|
try {
|
|
78
84
|
await this.driverHelper.waitVisibility(WorkspaceHandlingTests.START_WORKSPACE_PAGE_NAME_LOCATOR, TimeoutConstants.TS_WAIT_LOADER_PRESENCE_TIMEOUT);
|
|
79
85
|
// it takes a while to update the element with the workspace name
|
|
80
|
-
await this.driverHelper.wait(
|
|
86
|
+
await this.driverHelper.wait(TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
|
|
81
87
|
let startingWorkspaceLineContent = await this.driverHelper.getDriver().findElement(WorkspaceHandlingTests.START_WORKSPACE_PAGE_NAME_LOCATOR).getAttribute('innerHTML');
|
|
82
88
|
// cutting away leading text
|
|
83
89
|
WorkspaceHandlingTests.workspaceName = startingWorkspaceLineContent.substring('Starting workspace '.length).trim();
|
|
@@ -97,7 +103,7 @@ export class WorkspaceHandlingTests {
|
|
|
97
103
|
await this.browserTabsUtil.switchToWindow(tabs[i]);
|
|
98
104
|
try {
|
|
99
105
|
await this.ide.waitIde(TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
|
|
100
|
-
Logger.
|
|
106
|
+
Logger.debug(`WorkspaceHandlingTests.switchBackToIdeTab located and switched to IDE tab`);
|
|
101
107
|
return;
|
|
102
108
|
} catch (err) {
|
|
103
109
|
if (err instanceof error.TimeoutError) {
|
|
@@ -100,7 +100,7 @@ export class CheApiRequestHandler {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
async patch(relativeUrl: string, patchParams: object): Promise<AxiosResponse> {
|
|
103
|
-
|
|
103
|
+
return await axios.patch(this.assembleUrl(relativeUrl), patchParams, await this.headerHandler.get());
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
private assembleUrl(relativeUrl: string): string {
|
|
@@ -12,13 +12,28 @@ import { IAuthorizationHeaderHandler } from './IAuthorizationHeaderHandler';
|
|
|
12
12
|
import { inject, injectable } from 'inversify';
|
|
13
13
|
import { DriverHelper } from '../../DriverHelper';
|
|
14
14
|
import { CLASSES } from '../../../inversify.types';
|
|
15
|
+
import { Logger } from '../../Logger';
|
|
15
16
|
|
|
16
17
|
@injectable()
|
|
17
18
|
export class CheMultiuserAuthorizationHeaderHandler implements IAuthorizationHeaderHandler {
|
|
19
|
+
private authorizationToken: string = '';
|
|
20
|
+
|
|
18
21
|
constructor(@inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) { }
|
|
19
22
|
|
|
20
23
|
async get(): Promise<AxiosRequestConfig> {
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
try {
|
|
25
|
+
let token = await this.driverHelper.getDriver().manage().getCookie('_oauth_proxy');
|
|
26
|
+
if (this.authorizationToken !== token.value) {
|
|
27
|
+
this.authorizationToken = token.value;
|
|
28
|
+
}
|
|
29
|
+
} catch (err) {
|
|
30
|
+
if (this.authorizationToken.length > 0) {
|
|
31
|
+
Logger.warn(`Could not obtain _oauth_proxy cookie from chromedriver, browser session may have been killed. Using stored value.`);
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error(`Could not obtain _oauth_proxy cookie from chromedriver, browser session may have been killed. No stored token present!`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return { headers: { 'cookie': `_oauth_proxy=${this.authorizationToken}` } };
|
|
23
38
|
}
|
|
24
39
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/*********************************************************************
|
|
2
|
+
* Copyright (c) 2019 Red Hat, Inc.
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made
|
|
5
|
+
* available under the terms of the Eclipse Public License 2.0
|
|
6
|
+
* which is available at https://www.eclipse.org/legal/epl-2.0/
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
**********************************************************************/
|
|
10
|
+
import { inject, injectable } from 'inversify';
|
|
11
|
+
import { CLASSES } from '../../inversify.types';
|
|
12
|
+
import { Logger } from '../Logger';
|
|
13
|
+
import { CheApiRequestHandler } from '../requestHandlers/CheApiRequestHandler';
|
|
14
|
+
|
|
15
|
+
@injectable()
|
|
16
|
+
export class ApiUrlResolver {
|
|
17
|
+
private static readonly DASHBOARD_API_URL: string = 'dashboard/api/namespace';
|
|
18
|
+
private static readonly KUBERNETES_API_URL: string = 'api/kubernetes/namespace';
|
|
19
|
+
|
|
20
|
+
private userNamespace: string = '';
|
|
21
|
+
|
|
22
|
+
constructor(@inject(CLASSES.CheApiRequestHandler) private readonly processRequestHandler: CheApiRequestHandler) {}
|
|
23
|
+
|
|
24
|
+
public async getWorkspaceApiUrl(workspaceName: string): Promise<string> {
|
|
25
|
+
return `${await this.getWorkspacesApiUrl()}/${workspaceName}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
public async getWorkspacesApiUrl(): Promise<string> {
|
|
29
|
+
const namespace = await this.obtainUserNamespace();
|
|
30
|
+
return `${ApiUrlResolver.DASHBOARD_API_URL}/${namespace}/devworkspaces`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public getKubernetesApiUrl(): string {
|
|
34
|
+
return ApiUrlResolver.KUBERNETES_API_URL;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
private async obtainUserNamespace() : Promise<string> {
|
|
38
|
+
Logger.debug(`ApiUrlResolver.obtainUserNamespace ${this.userNamespace}`);
|
|
39
|
+
if (this.userNamespace.length === 0) {
|
|
40
|
+
Logger.trace(`ApiUrlResolver.obtainUserNamespace USER_NAMESPACE.length = 0, calling kubernetes API`);
|
|
41
|
+
const kubernetesResponse = await this.processRequestHandler.get(ApiUrlResolver.KUBERNETES_API_URL);
|
|
42
|
+
if (kubernetesResponse.status !== 200) {
|
|
43
|
+
throw new Error(`Cannot get user namespace from kubernetes API. Code: ${kubernetesResponse.status} Data: ${kubernetesResponse.data}`);
|
|
44
|
+
}
|
|
45
|
+
this.userNamespace = kubernetesResponse.data[0].name;
|
|
46
|
+
Logger.debug(`ApiUrlResolver.obtainUserNamespace kubeapi success: ${this.userNamespace}`);
|
|
47
|
+
}
|
|
48
|
+
return this.userNamespace;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -12,15 +12,87 @@ import { WorkspaceStatus } from './WorkspaceStatus';
|
|
|
12
12
|
import { che } from '@eclipse-che/api';
|
|
13
13
|
|
|
14
14
|
export interface ITestWorkspaceUtil {
|
|
15
|
+
waitWorkspaceStatus(namespace: string, workspaceName: string, expectedWorkspaceStatus: WorkspaceStatus) : void;
|
|
16
|
+
|
|
17
|
+
stopWorkspaceByName(workspaceName: string) : void;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Delete a worksapce without stopping phase (similar with force deleting)
|
|
21
|
+
*/
|
|
22
|
+
deleteWorkspaceByName(workspaceName: string) : void;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Stop workspace before deleting with checking stopping phase
|
|
26
|
+
*/
|
|
27
|
+
stopAndDeleteWorkspaceByName(workspaceName: string) : void;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Stop all run workspaces in the namespace
|
|
31
|
+
*/
|
|
32
|
+
stopAllRunningWorkspaces(namespace: string) : void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Stop all run workspaces, check statused and remove the workspaces
|
|
36
|
+
*/
|
|
37
|
+
stopAndDeleteAllRunningWorkspaces(namespace: string) : void;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Stop all run workspaces without stopping and waiting for of 'Stopped' phase
|
|
41
|
+
* Similar with 'force' deleting
|
|
42
|
+
*/
|
|
43
|
+
deleteAllWorkspaces(namespace: string) : void;
|
|
44
|
+
|
|
45
|
+
/*=====================
|
|
46
|
+
* DEPRECATED METHODS *
|
|
47
|
+
*====================*/
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
51
|
+
*/
|
|
15
52
|
cleanUpAllWorkspaces() : void;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
56
|
+
*/
|
|
16
57
|
cleanUpRunningWorkspace(workspaceName: string) : void;
|
|
17
|
-
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
61
|
+
*/
|
|
18
62
|
waitPluginAdding(namespace: string, workspaceName: string, pluginId: string) : void;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
66
|
+
*/
|
|
19
67
|
removeWorkspaceById(id: string) : void;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
71
|
+
*/
|
|
20
72
|
stopWorkspaceById(id: string) : void;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
76
|
+
*/
|
|
21
77
|
getIdOfRunningWorkspace(workspaceName: string): Promise<string>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
81
|
+
*/
|
|
22
82
|
getIdOfRunningWorkspaces(): Promise<Array<string>>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
86
|
+
*/
|
|
23
87
|
createWsFromDevFile(customTemplate: che.workspace.devfile.Devfile): void;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
91
|
+
*/
|
|
24
92
|
getBaseDevfile(): Promise<che.workspace.devfile.Devfile>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Method deprecated. Works with CHE server only
|
|
96
|
+
*/
|
|
25
97
|
startWorkspace(workspaceId: string): void;
|
|
26
98
|
}
|