@eclipse-che/che-e2e 7.45.0-dev-0129fe6 → 7.45.0-dev-60c4bc4

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.
Files changed (57) hide show
  1. package/dist/driver/CheReporter.js +4 -4
  2. package/dist/driver/CheReporter.js.map +1 -1
  3. package/dist/index.js +1 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/pageobjects/dashboard/Dashboard.js +15 -2
  6. package/dist/pageobjects/dashboard/Dashboard.js.map +1 -1
  7. package/dist/pageobjects/ide/Ide.js +14 -4
  8. package/dist/pageobjects/ide/Ide.js.map +1 -1
  9. package/dist/pageobjects/ide/ProjectTree.js +9 -5
  10. package/dist/pageobjects/ide/ProjectTree.js.map +1 -1
  11. package/dist/tests/devfiles/DotNetCore.spec.js +1 -1
  12. package/dist/tests/devfiles/DotNetCore.spec.js.map +1 -1
  13. package/dist/tests/devfiles/Go.spec.js +15 -15
  14. package/dist/tests/devfiles/Go.spec.js.map +1 -1
  15. package/dist/tests/e2e/OpenshiftConnector.spec.js +2 -2
  16. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +10 -9
  17. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
  18. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +10 -9
  19. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
  20. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +15 -14
  21. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
  22. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +10 -7
  23. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +1 -1
  24. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +3 -2
  25. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +1 -1
  26. package/dist/testsLibrary/LanguageServerTests.js +1 -0
  27. package/dist/testsLibrary/LanguageServerTests.js.map +1 -1
  28. package/dist/testsLibrary/WorkspaceHandlingTests.js +11 -7
  29. package/dist/testsLibrary/WorkspaceHandlingTests.js.map +1 -1
  30. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +3 -15
  31. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +1 -1
  32. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js +3 -3
  33. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js.map +1 -1
  34. package/driver/CheReporter.ts +4 -4
  35. package/index.ts +1 -1
  36. package/mocha-all-factories.json +2 -1
  37. package/package.json +2 -2
  38. package/pageobjects/dashboard/Dashboard.ts +14 -2
  39. package/pageobjects/ide/Ide.ts +13 -4
  40. package/pageobjects/ide/ProjectTree.ts +6 -5
  41. package/tests/devfiles/DotNetCore.spec.ts +1 -1
  42. package/tests/devfiles/Go.spec.ts +15 -17
  43. package/tests/e2e/OpenshiftConnector.spec.ts +2 -2
  44. package/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +15 -13
  45. package/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +15 -14
  46. package/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +19 -20
  47. package/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.ts +126 -123
  48. package/tests/plugins/GitHubPullRequestPlugin.spec.ts +3 -2
  49. package/testsLibrary/LanguageServerTests.ts +1 -0
  50. package/testsLibrary/WorkspaceHandlingTests.ts +8 -4
  51. package/tsconfig.json +1 -0
  52. package/tslint.json +119 -115
  53. package/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.ts +3 -9
  54. package/utils/requestHandlers/tokens/CheMultiuserTokenHandler.ts +20 -18
  55. package/dist/utils/KeycloackUrlHandler.js +0 -30
  56. package/dist/utils/KeycloackUrlHandler.js.map +0 -1
  57. package/utils/KeycloackUrlHandler.ts +0 -32
@@ -68,6 +68,7 @@ export class LanguageServerTests {
68
68
  await this.editor.pressControlSpaceCombination(openedTab);
69
69
  await this.editor.waitSuggestionContainer();
70
70
  await this.editor.waitSuggestionWithScrolling(openedTab, expectedText);
71
+ await this.editor.waitTabWithSavedStatus(openedTab);
71
72
  });
72
73
  }
73
74
 
@@ -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 { WorkspaceNameHandler } from '../utils/WorkspaceNameHandler';
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.WorkspaceNameHandler) private readonly workspaceNameHandler: WorkspaceNameHandler) {}
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.dashboard.waitWorkspaceStartingPage();
41
- WorkspaceHandlingTests.workspaceName = await this.workspaceNameHandler.getNameFromUrl();
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
@@ -11,6 +11,7 @@
11
11
  "types": ["reflect-metadata", "@types/mocha", "@types/node"],
12
12
  "experimentalDecorators": true,
13
13
  "emitDecoratorMetadata": true,
14
+ "noImplicitReturns": false,
14
15
  "sourceMap": true
15
16
  }
16
17
  }
package/tslint.json CHANGED
@@ -1,123 +1,127 @@
1
1
  {
2
- "rules": {
3
- "ban": [
4
- true,
5
- [
6
- "_",
7
- "extend"
8
- ],
9
- [
10
- "_",
11
- "isNull"
12
- ],
13
- [
14
- "_",
15
- "isDefined"
16
- ]
2
+ "rules": {
3
+ "ban": [
4
+ true,
5
+ [
6
+ "_",
7
+ "extend"
17
8
  ],
18
- "class-name": true,
19
- "comment-format": [
20
- true,
21
- "check-space",
22
- "check-lowercase"
9
+ [
10
+ "_",
11
+ "isNull"
23
12
  ],
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
- "label-undefined": true,
35
- "max-line-length": [
36
- false,
37
- 140
38
- ],
39
- "member-ordering": [
40
- true,
41
- "public-before-private",
42
- "static-before-instance",
43
- "variables-before-functions"
44
- ],
45
- "no-arg": true,
46
- "no-bitwise": true,
47
- "no-console": [
48
- true,
49
- "debug",
50
- "info",
51
- "time",
52
- "timeEnd",
53
- "trace"
54
- ],
55
- "no-construct": true,
56
- "no-constructor-vars": true,
57
- "no-debugger": true,
58
- "no-duplicate-key": true,
59
- "no-duplicate-variable": true,
60
- "no-empty": true,
61
- "no-eval": true,
62
- "no-string-literal": true,
63
- "no-switch-case-fall-through": true,
64
- "no-trailing-comma": true,
65
- "no-trailing-whitespace": true,
66
- "no-unused-expression": true,
67
- "no-unused-variable": true,
68
- "no-unreachable": true,
69
- "no-use-before-declare": true,
70
- "no-var-requires": false,
71
- "one-line": [
72
- true,
73
- "check-open-brace",
74
- "check-catch",
75
- "check-else",
76
- "check-whitespace"
77
- ],
78
- "quotemark": [
79
- true,
80
- "single"
81
- ],
82
- "radix": true,
83
- "semicolon": true,
84
- "triple-equals": [
85
- true,
86
- "allow-null-check"
87
- ],
88
- "typedef": [
89
- true,
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
- "indexSignature",
92
- "parameter",
93
- "propertySignature",
94
- "variableDeclarator"
105
+ "noSpace"
95
106
  ],
96
- "typedef-whitespace": [
97
- true,
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
- "use-strict": false,
112
- "variable-name": false,
113
- "whitespace": [
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, inject } from 'inversify';
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
- const token = await this.tokenHandler.get();
25
- return { headers: { 'Authorization': `Bearer ${token}` } };
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
- import { KeycloackUrlHandler } from '../../KeycloackUrlHandler';
15
+
16
16
 
17
17
  @injectable()
18
18
  export class CheMultiuserTokenHandler implements ITokenHandler {
19
- async get(): Promise<string> {
20
- const keycloakUrl = KeycloackUrlHandler.getTokenEndpointUrl();
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
- try {
30
- const responseToObtainBearerToken = await axios.post(keycloakUrl, querystring.stringify(params));
31
- return responseToObtainBearerToken.data.access_token;
32
- } catch (err) {
33
- console.log(`Can not get bearer token. URL used: ${keycloakUrl}`);
34
- throw err;
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
- }