@eclipse-che/che-e2e 7.44.0 → 7.45.0-dev-564dd1b
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 +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 +15 -2
- package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
- package/dist/pageobjects/ide/Ide.js +14 -4
- package/dist/pageobjects/ide/Ide.js.map +1 -1
- package/dist/pageobjects/ide/ProjectTree.js +9 -5
- 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_happy_path/DevWorkspaceHappyPath.spec.js +10 -7
- 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/testsLibrary/LanguageServerTests.js +1 -0
- package/dist/testsLibrary/LanguageServerTests.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/package.json +2 -2
- package/pageobjects/dashboard/Dashboard.ts +14 -2
- package/pageobjects/ide/Ide.ts +13 -4
- package/pageobjects/ide/ProjectTree.ts +6 -5
- 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_happy_path/DevWorkspaceHappyPath.spec.ts +126 -123
- package/tests/plugins/GitHubPullRequestPlugin.spec.ts +3 -2
- package/testsLibrary/LanguageServerTests.ts +1 -0
- 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
|
@@ -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"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
|
|
11
|
-
import { TestConstants } from '../TestConstants';
|
|
12
|
-
|
|
13
|
-
export class KeycloackUrlHandler {
|
|
14
|
-
public static getBaseKeycloakUrl(): string {
|
|
15
|
-
let baseKeycloakUrl: string = TestConstants.TS_SELENIUM_BASE_URL;
|
|
16
|
-
|
|
17
|
-
if (!TestConstants.TS_SELENIUM_SINGLE_HOST) {
|
|
18
|
-
baseKeycloakUrl = baseKeycloakUrl.replace('che', 'keycloak');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return baseKeycloakUrl;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
public static getTokenEndpointUrl(): string {
|
|
25
|
-
return `${this.getBaseKeycloakUrl()}/auth/realms/che/protocol/openid-connect/token`;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
public static getIdentityCallbackUrl(): string {
|
|
29
|
-
return `${this.getBaseKeycloakUrl()}/auth/realms/che/broker/github/endpoint`;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
}
|