@eclipse-che/che-e2e 7.59.0-dev-d1fb082 → 7.59.0-dev-a4c539f

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 (93) hide show
  1. package/TestConstants.ts +6 -1
  2. package/build/dockerfiles/Dockerfile +1 -1
  3. package/dist/TestConstants.js +5 -1
  4. package/dist/TestConstants.js.map +1 -1
  5. package/dist/driver/CheReporter.js +6 -26
  6. package/dist/driver/CheReporter.js.map +1 -1
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/inversify.config.js +2 -0
  10. package/dist/inversify.config.js.map +1 -1
  11. package/dist/inversify.types.js +1 -0
  12. package/dist/inversify.types.js.map +1 -1
  13. package/dist/pageobjects/dashboard/Workspaces.js +10 -2
  14. package/dist/pageobjects/dashboard/Workspaces.js.map +1 -1
  15. package/dist/pageobjects/ide/theia/Ide.js +1 -1
  16. package/dist/pageobjects/ide/theia/Ide.js.map +1 -1
  17. package/dist/tests/MochaHooks.js +65 -0
  18. package/dist/tests/MochaHooks.js.map +1 -0
  19. package/dist/tests/devfiles/che-code/EmptyWorkspace.spec.js +11 -24
  20. package/dist/tests/devfiles/che-code/EmptyWorkspace.spec.js.map +1 -1
  21. package/dist/tests/devfiles/theia/DotNetCore.spec.js.map +1 -1
  22. package/dist/tests/e2e/theia/FactoryUrl.spec.js.map +1 -1
  23. package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +1 -1
  24. package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +1 -1
  25. package/dist/tests/e2e/theia/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +1 -1
  26. package/dist/tests/e2e_happy_path/theia/DevWorkspaceHappyPath.spec.js.map +1 -1
  27. package/dist/testsLibrary/che-code/ProjectAndFileTestsCheCode.js +54 -0
  28. package/dist/testsLibrary/che-code/ProjectAndFileTestsCheCode.js.map +1 -0
  29. package/dist/testsLibrary/theia/LanguageServerTestsTheia.js.map +1 -1
  30. package/dist/testsLibrary/theia/ProjectAndFileTestsTheia.js.map +1 -1
  31. package/dist/utils/VCS/github/GitHubUtil.js +2 -2
  32. package/dist/utils/VCS/github/GitHubUtil.js.map +1 -1
  33. package/driver/CheReporter.ts +4 -25
  34. package/index.ts +1 -0
  35. package/inversify.config.ts +2 -0
  36. package/inversify.types.ts +1 -0
  37. package/mocha-all-devfiles-che-code.json +12 -0
  38. package/mocha-all-devfiles-theia.json +13 -10
  39. package/mocha-all-factories-che-code.json +14 -0
  40. package/mocha-all-factories-theia.json +14 -11
  41. package/mocha-all-plugins-che-code.json +13 -0
  42. package/mocha-all-plugins-theia.json +13 -10
  43. package/mocha-che-code.json +12 -0
  44. package/mocha-connector-theia.json +10 -7
  45. package/mocha-devworkspace-happy-path-che-code.json +13 -0
  46. package/mocha-devworkspace-happy-path-theia.json +12 -9
  47. package/mocha-factory-che-code.json +13 -0
  48. package/mocha-factory-theia.json +12 -9
  49. package/mocha-git-publish-branch-theia.json +12 -9
  50. package/mocha-git-self-sign-cert-theia.json +12 -9
  51. package/mocha-git-ssh-theia.json +12 -9
  52. package/mocha-happy-path-che-code.json +14 -0
  53. package/mocha-happy-path-theia.json +13 -10
  54. package/mocha-java-maven.json +11 -7
  55. package/mocha-java-springboot-che-code.json +12 -0
  56. package/mocha-java-springboot-theia.json +11 -7
  57. package/mocha-java-vertx-che-code.json +12 -0
  58. package/mocha-java-vertx-theia.json +11 -7
  59. package/mocha-load-theia.json +10 -7
  60. package/mocha-scala.json +11 -7
  61. package/mocha-single-devfile.json +9 -6
  62. package/mocha-theia.json +10 -6
  63. package/mocha-ws-creation-and-ls-theia.json +10 -7
  64. package/mocha.intelij.json +11 -7
  65. package/mocha.ocp.link.json +9 -6
  66. package/mocha.single.plugin.json +6 -5
  67. package/package.json +11 -11
  68. package/pageobjects/dashboard/Workspaces.ts +10 -4
  69. package/pageobjects/ide/theia/Ide.ts +1 -1
  70. package/pageobjects/ide/theia/OpenEditors.ts +1 -1
  71. package/tests/MochaHooks.ts +47 -0
  72. package/tests/devfiles/che-code/EmptyWorkspace.spec.ts +14 -24
  73. package/tests/devfiles/theia/DotNetCore.spec.ts +1 -1
  74. package/tests/e2e/theia/FactoryUrl.spec.ts +1 -1
  75. package/tests/e2e/theia/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +1 -1
  76. package/tests/e2e/theia/factories/DirectUrlFactoryWithRootFolderTest.spec.ts +1 -1
  77. package/tests/e2e/theia/factories/DirectUrlFactoryWithSpecificBranchTest.spec.ts +1 -1
  78. package/tests/e2e_happy_path/theia/DevWorkspaceHappyPath.spec.ts +1 -1
  79. package/testsLibrary/che-code/ProjectAndFileTestsCheCode.ts +34 -0
  80. package/testsLibrary/theia/LanguageServerTestsTheia.ts +2 -2
  81. package/testsLibrary/theia/ProjectAndFileTestsTheia.ts +2 -2
  82. package/tslint.json +13 -10
  83. package/utils/VCS/github/GitHubUtil.ts +2 -2
  84. package/utils/workspace/ApiUrlResolver.ts +1 -1
  85. package/utils/workspace/ITestWorkspaceUtil.ts +12 -12
  86. package/mocha-all-factories-code.json +0 -11
  87. package/mocha-all-plugins-code.json +0 -10
  88. package/mocha-code.json +0 -8
  89. package/mocha-devworkspace-happy-path-code.json +0 -10
  90. package/mocha-factory-code.json +0 -10
  91. package/mocha-happy-path-code.json +0 -11
  92. package/mocha-java-springboot-code.json +0 -9
  93. package/mocha-java-vertx-code.json +0 -9
@@ -0,0 +1,14 @@
1
+ {
2
+ "timeout": "2200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "ui": "tdd",
5
+ "bail": true,
6
+ "full-trace": true,
7
+ "require": [
8
+ "source-map-support/register",
9
+ "./dist/tests/MochaHooks.js"
10
+ ],
11
+ "spec": [
12
+ "dist/tests/login/Login.spec.js"
13
+ ]
14
+ }
@@ -1,12 +1,15 @@
1
1
  {
2
- "timeout": "2200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "require": "source-map-support/register",
8
- "spec": [
9
- "dist/tests/login/Login.spec.js",
10
- "dist/tests/e2e_happy_path/theia/HappyPath.spec.js"
11
- ]
2
+ "timeout": "2200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "ui": "tdd",
5
+ "bail": true,
6
+ "full-trace": true,
7
+ "require": [
8
+ "source-map-support/register",
9
+ "./dist/tests/MochaHooks.js"
10
+ ],
11
+ "spec": [
12
+ "dist/tests/login/Login.spec.js",
13
+ "dist/tests/e2e_happy_path/theia/HappyPath.spec.js"
14
+ ]
12
15
  }
@@ -1,9 +1,13 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/login/Login.spec.js", "dist/tests/devfiles/JavaMaven.spec.js"]
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "require": "./dist/tests/MochaHooks.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js",
11
+ "dist/tests/devfiles/JavaMaven.spec.js"
12
+ ]
9
13
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js"
11
+ ]
12
+ }
@@ -1,9 +1,13 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/login/Login.spec.js", "dist/tests/devfiles/theia/JavaSpringBoot.spec.js"]
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js",
11
+ "dist/tests/devfiles/theia/JavaSpringBoot.spec.js"
12
+ ]
9
13
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js"
11
+ ]
12
+ }
@@ -1,9 +1,13 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/login/Login.spec.js", "dist/tests/devfiles/theia/JavaVertx.spec.js"]
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js",
11
+ "dist/tests/devfiles/theia/JavaVertx.spec.js"
12
+ ]
9
13
  }
@@ -1,9 +1,12 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/load_test/theia/LoadTest.spec.js"]
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/load_test/theia/LoadTest.spec.js"
11
+ ]
9
12
  }
package/mocha-scala.json CHANGED
@@ -1,9 +1,13 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/login/Login.spec.js", "dist/tests/devfiles/Scala.spec.js"]
2
+ "timeout": "1200000",
3
+ "require": "./dist/tests/MochaHooks.js",
4
+ "reporter": "dist/driver/CheReporter.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/login/Login.spec.js",
11
+ "dist/tests/devfiles/Scala.spec.js"
12
+ ]
9
13
  }
@@ -1,8 +1,11 @@
1
1
  {
2
- "timeout": "2200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "require": "source-map-support/register"
2
+ "timeout": "2200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "ui": "tdd",
5
+ "bail": true,
6
+ "full-trace": true,
7
+ "require": [
8
+ "source-map-support/register",
9
+ "./dist/tests/MochaHooks.js"
10
+ ]
8
11
  }
package/mocha-theia.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "spec": ["dist/tests/login/Login.spec.js", "dist/tests/e2e/theia/*.spec.js"]
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "ui": "tdd",
5
+ "bail": true,
6
+ "full-trace": true,
7
+ "require": "./dist/tests/MochaHooks.js",
8
+ "spec": [
9
+ "dist/tests/login/Login.spec.js",
10
+ "dist/tests/e2e/theia/*.spec.js"
11
+ ]
8
12
  }
@@ -1,9 +1,12 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["dist/tests/e2e/theia/WorkspaceCreationAndLsInitialization.spec.js"]
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "require": "./dist/tests/MochaHooks.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "dist/tests/e2e/theia/WorkspaceCreationAndLsInitialization.spec.js"
11
+ ]
9
12
  }
@@ -1,9 +1,13 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "support": "source-map-support/register",
8
- "spec": ["./dist/tests/login/Login.spec.js", "./dist/tests/intelij/IntelijOpenWorkspace.spec.js"]
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "require": "./dist/tests/MochaHooks.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "support": "source-map-support/register",
9
+ "spec": [
10
+ "./dist/tests/login/Login.spec.js",
11
+ "./dist/tests/intelij/IntelijOpenWorkspace.spec.js"
12
+ ]
9
13
  }
@@ -1,8 +1,11 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true,
7
- "spec": ["./dist/tests/login/LinkCheAndOcpUsers.spec.js"]
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "require": "./dist/tests/MochaHooks.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true,
8
+ "spec": [
9
+ "./dist/tests/login/LinkCheAndOcpUsers.spec.js"
10
+ ]
8
11
  }
@@ -1,7 +1,8 @@
1
1
  {
2
- "timeout": "1200000",
3
- "reporter": "dist/driver/CheReporter.js",
4
- "ui": "tdd",
5
- "bail": true,
6
- "full-trace": true
2
+ "timeout": "1200000",
3
+ "reporter": "dist/driver/CheReporter.js",
4
+ "require": "./dist/tests/MochaHooks.js",
5
+ "ui": "tdd",
6
+ "bail": true,
7
+ "full-trace": true
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-che/che-e2e",
3
- "version": "7.59.0-dev-d1fb082",
3
+ "version": "7.59.0-dev-a4c539f",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,15 +29,15 @@
29
29
  "test-all-factories-theia": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-theia.json",
30
30
  "test-plugin-ci-theia": "export TS_DELETE_PLUGINS_TEST_WORKSPACE=true && npm run init-mocha-opts -- --spec dist/tests/plugins/theia/${USERSTORY}.spec.js",
31
31
  "test-all-plugins-theia": "tsc && mocha --config mocha-all-plugins-theia.json",
32
- "test-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-code.json",
33
- "test-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-happy-path-code.json",
34
- "test-devworkspace-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-devworkspace-happy-path-code.json",
35
- "test-java-vertx-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-vertx-code.json",
36
- "test-java-springboot-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-springboot-code.json",
37
- "test-factory-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-factory-code.json",
38
- "test-all-factories-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-code.json",
32
+ "test-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-che-code.json",
33
+ "test-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-happy-path-che-code.json",
34
+ "test-devworkspace-happy-path-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-devworkspace-happy-path-che-code.json",
35
+ "test-java-vertx-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-vertx-che-code.json",
36
+ "test-java-springboot-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-java-springboot-che-code.json",
37
+ "test-factory-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-factory-che-code.json",
38
+ "test-all-factories-code": "./generateIndex.sh && npm run lint && npm run tsc && mocha --config mocha-all-factories-che-code.json",
39
39
  "test-plugin-ci-code": "export TS_DELETE_PLUGINS_TEST_WORKSPACE=true && npm run init-mocha-opts -- --spec dist/tests/plugins/code/${USERSTORY}.spec.js",
40
- "test-all-plugins-code": "tsc && mocha --config mocha-all-plugins-code.json"
40
+ "test-all-plugins-code": "tsc && mocha --config mocha-all-plugins-che-code.json"
41
41
  },
42
42
  "author": "Ihor Okhrimenko (iokhrime@redhat.com)",
43
43
  "license": "ISC",
@@ -49,12 +49,12 @@
49
49
  "@types/selenium-webdriver": "4.1.3",
50
50
  "axios": "^0.25.0",
51
51
  "chai": "4.2.0",
52
- "chromedriver": "^103.0.0",
52
+ "chromedriver": "^107.0.0",
53
53
  "mocha": "^9.1.3",
54
54
  "rimraf": "2.6.2",
55
55
  "selenium-webdriver": "4.4.0",
56
56
  "ts-node": "8.0.3",
57
- "tslint": "5.10.0",
57
+ "tslint": "^6.1.3",
58
58
  "typed-rest-client": "1.8.5",
59
59
  "typescript": "3.9.9",
60
60
  "monaco-page-objects": "3.1.0",
@@ -86,12 +86,11 @@ export class Workspaces {
86
86
  Logger.debug(`Workspaces.waitActionsPopup of the '${workspaceName}' list item`);
87
87
 
88
88
  await this.driverHelper.waitVisibility(this.getExpandedActionsLocator(workspaceName), timeout);
89
- await this.driverHelper.wait(5000);
89
+ await this.driverHelper.wait(2000);
90
90
  }
91
91
 
92
92
  async openActionsPopup(workspaceName: string, timeout: number = TimeoutConstants.TS_CONTEXT_MENU_TIMEOUT) {
93
93
  Logger.debug(`Workspaces.openActionsPopup for the '${workspaceName}' list item`);
94
-
95
94
  await this.clickActionsButton(workspaceName);
96
95
  await this.waitActionsPopup(workspaceName, timeout);
97
96
  }
@@ -104,8 +103,15 @@ export class Workspaces {
104
103
 
105
104
  async clickActionsStopWorkspaceButton(workspaceName: string) {
106
105
  Logger.debug(`Workspaces.clickActionsStopWorkspaceButton for the '${workspaceName}' list item`);
107
-
108
- await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
106
+ // workaround because of issue CRW-3649
107
+ try {
108
+ await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
109
+ } catch (e) {
110
+ Logger.warn(`Workspaces.clickActionsStopWorkspaceButton for the '${workspaceName}' list item - popup was missed, try to click one more time (issue CRW-3649).`);
111
+
112
+ await this.driverHelper.waitAndClick(this.getActionsLocator(workspaceName));
113
+ await this.driverHelper.waitAndClick(this.getActionsPopupButtonLocator(workspaceName, 'Stop Workspace'));
114
+ }
109
115
  }
110
116
 
111
117
  async waitDeleteWorkspaceConfirmationWindow(timeout: number = TimeoutConstants.TS_DASHBOARD_WORKSPACE_STOP_TIMEOUT) {
@@ -52,7 +52,7 @@ export class Ide {
52
52
  } catch (err) {
53
53
  if (err instanceof error.StaleElementReferenceError) {
54
54
  Logger.warn('StaleElementException occurred during waiting for IDE. Sleeping for 2 secs and retrying.');
55
- this.driverHelper.wait(2000);
55
+ await this.driverHelper.wait(2000);
56
56
  try {
57
57
  await this.driverHelper.waitAndSwitchToFrame(By.css(Ide.IDE_IFRAME_CSS), timeout);
58
58
  } catch (err) {
@@ -56,7 +56,7 @@ export class OpenEditors {
56
56
  Logger.trace('OpenEditors.waitAndClickExpansionToggle expansion toggle clicked.');
57
57
  }
58
58
 
59
- async isExpansionToggleCollapsed(timeout: number = TimeoutConstants.TS_OPEN_EDITORS_CLICK_ON_ITEM_TIMEOUT) : Promise<boolean> {
59
+ async isExpansionToggleCollapsed(timeout: number = TimeoutConstants.TS_OPEN_EDITORS_CLICK_ON_ITEM_TIMEOUT): Promise<boolean> {
60
60
  Logger.debug('OpenEditors.isExpansionToggleCollapsed');
61
61
  return await this.driverHelper.waitVisibilityBoolean(OpenEditors.OPEN_EDITORS_EXPANSION_TOGGLE_COLLAPSED_LOCATOR, 1, timeout);
62
62
  }
@@ -0,0 +1,47 @@
1
+
2
+ import { IDriver } from '..';
3
+ import { TYPES, CLASSES } from '..';
4
+ import { EditorType, TestConstants } from '../TestConstants';
5
+ import { AskForConfirmationTypeTheia, PreferencesHandlerTheia, TerminalRendererTypeTheia } from '../utils/theia/PreferencesHandlerTheia';
6
+ import { CheApiRequestHandler } from '../utils/requestHandlers/CheApiRequestHandler';
7
+ import { TimeoutConstants } from '../TimeoutConstants';
8
+ import * as monacoPageObjects from 'monaco-page-objects';
9
+ import * as vscodeExtensionTesterLocators from 'vscode-extension-tester-locators';
10
+ import { e2eContainer } from '../inversify.config';
11
+
12
+ const driver: IDriver = e2eContainer.get(TYPES.Driver);
13
+ const preferencesHandler: PreferencesHandlerTheia = e2eContainer.get(CLASSES.PreferencesHandlerTheia);
14
+
15
+ exports.mochaHooks = {
16
+ beforeAll: [
17
+ async function enableRequestInterceptor() {
18
+ if (TestConstants.TS_SELENIUM_REQUEST_INTERCEPTOR) {
19
+ CheApiRequestHandler.enableRequestInteceptor();
20
+ }
21
+ },
22
+ async function enableResponseInterceptor() {
23
+ if (TestConstants.TS_SELENIUM_RESPONSE_INTERCEPTOR) {
24
+ CheApiRequestHandler.enableResponseInterceptor();
25
+ }
26
+ },
27
+ async function setTheiaSpecificPreferences() {
28
+ if (TestConstants.TS_SELENIUM_EDITOR === EditorType.THEIA) {
29
+ await preferencesHandler.setConfirmExit(AskForConfirmationTypeTheia.never);
30
+ await preferencesHandler.setTerminalType(TerminalRendererTypeTheia.dom);
31
+ }
32
+ },
33
+ async function initMonacoPageObjects() {
34
+ if (TestConstants.TS_SELENIUM_EDITOR === EditorType.CHE_CODE) {
35
+ // init vscode-extension-tester monaco-page-objects
36
+ monacoPageObjects.initPageObjects(TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_USE_VERSION, TestConstants.TS_SELENIUM_MONACO_PAGE_OBJECTS_BASE_VERSION, vscodeExtensionTesterLocators.getLocatorsPath(), driver.get(), 'google-chrome');
37
+ }
38
+ },
39
+ async function prolongTimeoutConstantsInDebugMode() {
40
+ if (TestConstants.TS_DEBUG_MODE === true) {
41
+ for (let [timeout, seconds] of Object.entries(TimeoutConstants)) {
42
+ Object.defineProperty(TimeoutConstants, timeout, {value: seconds * 100});
43
+ }
44
+ }
45
+ },
46
+ ]
47
+ };
@@ -7,19 +7,16 @@
7
7
  *
8
8
  * SPDX-License-Identifier: EPL-2.0
9
9
  **********************************************************************/
10
- import 'reflect-metadata';
11
- import { CLASSES } from '../../../inversify.types';
12
10
  import { e2eContainer } from '../../../inversify.config';
11
+ import { ActivityBar, ViewControl, Workbench } from 'monaco-page-objects';
12
+ import { CLASSES } from '../../../inversify.types';
13
13
  import { WorkspaceHandlingTests } from '../../../testsLibrary/WorkspaceHandlingTests';
14
- import CheReporter from '../../../driver/CheReporter';
15
14
  import { Logger } from '../../../utils/Logger';
16
- import { DriverHelper } from '../../../utils/DriverHelper';
17
- import { By, until } from 'selenium-webdriver';
18
- import { Workbench } from 'monaco-page-objects';
15
+ import CheReporter from '../../../driver/CheReporter';
16
+ import { ProjectAndFileTestsCheCode } from '../../../testsLibrary/che-code/ProjectAndFileTestsCheCode';
19
17
 
20
18
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
21
- const driverHelper: DriverHelper = e2eContainer.get(CLASSES.DriverHelper);
22
-
19
+ const projectAndFileTests: ProjectAndFileTestsCheCode = e2eContainer.get(CLASSES.ProjectAndFileTestsCheCode);
23
20
  const stackName: string = 'Empty Workspace';
24
21
 
25
22
  suite(`${stackName} test`, async () => {
@@ -30,28 +27,21 @@ suite(`${stackName} test`, async () => {
30
27
  CheReporter.registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
31
28
  });
32
29
  test('Wait workspace readiness', async() => {
33
- try {
34
- await driverHelper.getDriver().wait(until.elementLocated(By.className('monaco-workbench')));
35
- } catch (err) {
36
- if ((err as Error).name === 'WebDriverError') {
37
- await new Promise(res => setTimeout(res, 3000));
38
- } else {
39
- throw err;
40
- }
41
- }
42
- let workbench = new Workbench();
43
- let activityBar = workbench.getActivityBar();
44
- let activityBarControls = await activityBar.getViewControls();
30
+ await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
31
+
32
+ const workbench: Workbench = new Workbench();
33
+ const activityBar: ActivityBar = workbench.getActivityBar();
34
+ const activityBarControls: ViewControl[] = await activityBar.getViewControls();
35
+
45
36
  Logger.debug(`Editor sections:`);
46
- activityBarControls.forEach(async control => {
37
+ for (const control of activityBarControls) {
47
38
  Logger.debug(`${await control.getTitle()}`);
48
- });
39
+ }
49
40
  });
50
- // projectAndFileTests.waitWorkspaceReadiness(workspaceSampleName, workspaceRootFolderName, false);
51
41
  });
52
42
 
53
43
  suite('Stopping and deleting the workspace', async () => {
54
- test(`Stop and remowe workspace`, async () => {
44
+ test(`Stop and remove workspace`, async () => {
55
45
  await workspaceHandlingTests.stopAndRemoveWorkspace(WorkspaceHandlingTests.getWorkspaceName());
56
46
  });
57
47
  });
@@ -27,7 +27,7 @@ const workspaceSampleName: string = 'dotnet-web-simple';
27
27
  const fileFolderPath: string = `${workspaceSampleName}`;
28
28
  const tabTitle: string = 'Program.cs';
29
29
  // const codeNavigationClassName: string = '[metadata] Console.cs';
30
- const stack : string = 'ASP.NET Core Web Application';
30
+ const stack: string = 'ASP.NET Core Web Application';
31
31
  const updateDependenciesTaskName: string = 'update dependencies';
32
32
  const buildTaskName: string = 'build';
33
33
  const runTaskName: string = 'run';
@@ -21,7 +21,7 @@ const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUti
21
21
  const testWorkspaceUtils: ITestWorkspaceUtil = e2eContainer.get<ITestWorkspaceUtil>(TYPES.WorkspaceUtil);
22
22
  const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
23
23
 
24
- const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml`;
24
+ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://raw.githubusercontent.com/eclipse/che-devfile-registry/master/devfiles/java-maven/devfile.yaml`;
25
25
  const workspaceSampleName: string = 'console-java-simple';
26
26
  const workspaceRootFolderName: string = 'src';
27
27
 
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
21
21
  const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
22
22
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
23
23
 
24
- const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/master/src`;
24
+ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/master/src`;
25
25
  const workspaceSampleName: string = 'console-java-simple';
26
26
  const workspaceRootFolderName: string = 'src';
27
27
  const fileName: string = 'pom.xml';
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
21
21
  const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
22
22
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
23
23
 
24
- const factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple`;
24
+ const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple`;
25
25
  const workspaceSampleName: string = 'console-java-simple';
26
26
  const workspaceRootFolderName: string = 'src';
27
27
  const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
@@ -21,7 +21,7 @@ const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.
21
21
  const projectAndFileTests: ProjectAndFileTestsTheia = e2eContainer.get(CLASSES.ProjectAndFileTestsTheia);
22
22
  const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
23
23
 
24
- let factoryUrl : string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
24
+ let factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=https://github.com/che-samples/console-java-simple/tree/java1.11`;
25
25
  const workspaceSampleName: string = 'console-java-simple';
26
26
  const workspaceRootFolderName: string = 'src';
27
27
  const fileFolderPath: string = `${workspaceSampleName}/${workspaceRootFolderName}/main/java/org/eclipse/che/examples`;
@@ -55,7 +55,7 @@ const SpringAppLocators = {
55
55
 
56
56
  // this test checks only workspace created from "web-nodejs-sample" https://github.com/devfile/devworkspace-operator/blob/main/samples/flattened_theia-next.yaml.
57
57
  suite('Workspace creation via factory url', async () => {
58
- let factoryUrl : string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
58
+ let factoryUrl: string = `${TestConstants.TS_SELENIUM_DEVWORKSPACE_URL}`;
59
59
 
60
60
  suite('Open factory URL', async () => {
61
61
  // this is DevWorkspace test specific - we create the test ws. using factory instead of chectl
@@ -0,0 +1,34 @@
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 'reflect-metadata';
12
+ import { inject, injectable } from 'inversify';
13
+ import { By, until } from 'selenium-webdriver';
14
+ import { DriverHelper } from '../../utils/DriverHelper';
15
+ import { CLASSES } from '../../inversify.types';
16
+
17
+ @injectable()
18
+ export class ProjectAndFileTestsCheCode {
19
+
20
+ constructor(
21
+ @inject(CLASSES.DriverHelper) private readonly driverHelper: DriverHelper) {}
22
+
23
+ public async waitWorkspaceReadinessForCheCodeEditor(): Promise<void> {
24
+ try {
25
+ await this.driverHelper.getDriver().wait(until.elementLocated(By.className('monaco-workbench')));
26
+ } catch (err) {
27
+ if ((err as Error).name === 'WebDriverError') {
28
+ await new Promise(res => setTimeout(res, 3000));
29
+ } else {
30
+ throw err;
31
+ }
32
+ }
33
+ }
34
+ }
@@ -97,7 +97,7 @@ export class LanguageServerTestsTheia {
97
97
  });
98
98
  }
99
99
 
100
- public goToDefinition(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout : number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
100
+ public goToDefinition(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout: number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
101
101
  test('Go to Definition', async () => {
102
102
  try {
103
103
  await this.editor.moveCursorToLineAndChar(openedFile, line, char);
@@ -123,7 +123,7 @@ export class LanguageServerTestsTheia {
123
123
  });
124
124
  }
125
125
 
126
- public goToImplementations(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout : number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
126
+ public goToImplementations(openedFile: string, line: number, char: number, codeNavigationClassName: string, timeout: number = TimeoutConstants.TS_EDITOR_TAB_INTERACTION_TIMEOUT) {
127
127
  test('Go to Implementations', async () => {
128
128
  try {
129
129
  await this.editor.moveCursorToLineAndChar(openedFile, line, char);