@eclipse-che/che-e2e 7.56.0 → 7.56.1-dev-8788793

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 (314) hide show
  1. package/TestConstants.ts +23 -0
  2. package/driver/CheReporter.ts +16 -5
  3. package/driver/ChromeDriver.ts +7 -5
  4. package/index.ts +26 -26
  5. package/initDefaultValues.sh +2 -0
  6. package/initDevfileTests.sh +7 -3
  7. package/initPluginTest.sh +1 -1
  8. package/inversify.config.ts +30 -30
  9. package/inversify.types.ts +4 -4
  10. package/{mocha-all-devfiles.json → mocha-all-devfiles-theia.json} +2 -2
  11. package/{mocha-git-ssh.json → mocha-all-factories-code.json} +1 -1
  12. package/{mocha-all-factories.json → mocha-all-factories-theia.json} +2 -2
  13. package/mocha-all-plugins-code.json +10 -0
  14. package/{mocha-all-plugins.json → mocha-all-plugins-theia.json} +2 -2
  15. package/{mocha.json → mocha-code.json} +1 -1
  16. package/{mocha-connector.json → mocha-connector-theia.json} +1 -1
  17. package/mocha-devworkspace-happy-path-code.json +10 -0
  18. package/{mocha-devworkspace-happy-path.json → mocha-devworkspace-happy-path-theia.json} +1 -1
  19. package/mocha-factory-code.json +10 -0
  20. package/{mocha-factory.json → mocha-factory-theia.json} +1 -1
  21. package/mocha-git-publish-branch-theia.json +11 -0
  22. package/mocha-git-self-sign-cert-theia.json +11 -0
  23. package/{mocha-git-self-sign-cert.json → mocha-git-ssh-theia.json} +1 -1
  24. package/{mocha-git-publish-branch.json → mocha-happy-path-code.json} +1 -1
  25. package/{mocha-happy-path.json → mocha-happy-path-theia.json} +1 -1
  26. package/{mocha-java-vertx.json → mocha-java-maven.json} +1 -1
  27. package/{mocha-load.json → mocha-java-springboot-code.json} +1 -1
  28. package/mocha-java-springboot-theia.json +9 -0
  29. package/{mocha-wkspc-creation-and-ls.json → mocha-java-vertx-code.json} +1 -1
  30. package/mocha-java-vertx-theia.json +9 -0
  31. package/mocha-load-theia.json +9 -0
  32. package/mocha-scala.json +9 -0
  33. package/mocha-theia.json +8 -0
  34. package/mocha-ws-creation-and-ls-theia.json +9 -0
  35. package/package.json +37 -25
  36. package/pageobjects/dashboard/CreateWorkspace.ts +9 -1
  37. package/pageobjects/dashboard/workspace-details/WorkspaceDetails.ts +1 -1
  38. package/pageobjects/ide/{ContextMenu.ts → theia/ContextMenu.ts} +6 -6
  39. package/pageobjects/ide/{DebugView.ts → theia/DebugView.ts} +6 -6
  40. package/pageobjects/ide/{DialogWindow.ts → theia/DialogWindow.ts} +4 -4
  41. package/pageobjects/ide/{Editor.ts → theia/Editor.ts} +19 -20
  42. package/pageobjects/ide/{Ide.ts → theia/Ide.ts} +5 -5
  43. package/pageobjects/ide/{LeftToolBar.ts → theia/LeftToolBar.ts} +4 -4
  44. package/pageobjects/ide/{NavigationBar.ts → theia/NavigationBar.ts} +7 -7
  45. package/pageobjects/ide/{NotificationCenter.ts → theia/NotificationCenter.ts} +4 -4
  46. package/pageobjects/ide/{OpenDialogWidget.ts → theia/OpenDialogWidget.ts} +6 -6
  47. package/pageobjects/ide/{OpenEditors.ts → theia/OpenEditors.ts} +4 -4
  48. package/pageobjects/ide/{OpenWorkspaceWidget.ts → theia/OpenWorkspaceWidget.ts} +4 -4
  49. package/pageobjects/ide/{PreviewWidget.ts → theia/PreviewWidget.ts} +5 -5
  50. package/pageobjects/ide/{ProjectTree.ts → theia/ProjectTree.ts} +6 -6
  51. package/pageobjects/ide/{QuickOpenContainer.ts → theia/QuickOpenContainer.ts} +4 -4
  52. package/pageobjects/ide/{RightToolBar.ts → theia/RightToolBar.ts} +4 -4
  53. package/pageobjects/ide/{Terminal.ts → theia/Terminal.ts} +5 -5
  54. package/pageobjects/ide/{TopMenu.ts → theia/TopMenu.ts} +5 -5
  55. package/pageobjects/ide/{plugins → theia/plugins}/GitHubPullRequestPlugin.ts +5 -5
  56. package/pageobjects/ide/{plugins → theia/plugins}/GitPlugin.ts +4 -4
  57. package/pageobjects/ide/{plugins → theia/plugins}/KubernetesPlugin.ts +4 -4
  58. package/pageobjects/ide/{plugins → theia/plugins}/OpenshiftPlugin.ts +4 -4
  59. package/pageobjects/ide/{plugins → theia/plugins}/PluginsView.ts +4 -4
  60. package/tests/devfiles/code/JavaSpringBoot.spec.ts +77 -0
  61. package/tests/devfiles/{CSlashCPlusPlus.spec.ts → theia/CSlashCPlusPlus.spec.ts} +11 -11
  62. package/tests/devfiles/{DevfileSmoke.spec.ts → theia/DevfileSmoke.spec.ts} +10 -10
  63. package/tests/devfiles/{DotNetCore.spec.ts → theia/DotNetCore.spec.ts} +11 -11
  64. package/tests/devfiles/{Go.spec.ts → theia/Go.spec.ts} +13 -13
  65. package/tests/devfiles/{JavaMaven.spec.ts → theia/JavaMaven.spec.ts} +10 -10
  66. package/tests/devfiles/{JavaSpringBoot.spec.ts → theia/JavaSpringBoot.spec.ts} +10 -10
  67. package/tests/devfiles/{JavaVertx.spec.ts → theia/JavaVertx.spec.ts} +10 -10
  68. package/tests/devfiles/{NodeJS.spec.ts → theia/NodeJS.spec.ts} +10 -10
  69. package/tests/devfiles/{PHPSimple.spec.ts → theia/PHPSimple.spec.ts} +11 -11
  70. package/tests/devfiles/{Python.spec.ts → theia/Python.spec.ts} +10 -10
  71. package/tests/devfiles/{PythonDjango.spec.ts → theia/PythonDjango.spec.ts} +8 -8
  72. package/tests/devfiles/{Quarkus.spec.ts → theia/Quarkus.spec.ts} +10 -10
  73. package/tests/devfiles/{Scala.spec.ts → theia/Scala.spec.ts} +10 -10
  74. package/tests/e2e/{FactoryUrl.spec.ts → theia/FactoryUrl.spec.ts} +9 -9
  75. package/tests/e2e/{GitPublishBranch.spec.ts → theia/GitPublishBranch.spec.ts} +16 -16
  76. package/tests/e2e/{GitSelfSignCert.spec.ts → theia/GitSelfSignCert.spec.ts} +17 -17
  77. package/tests/e2e/{GitSsh.spec.ts → theia/GitSsh.spec.ts} +20 -20
  78. package/tests/e2e/{OpenshiftConnector.spec.ts → theia/OpenshiftConnector.spec.ts} +21 -21
  79. package/tests/e2e/{factories → theia/factories}/DirectUrlFactoryWithKeepDirectoryTest.spec.ts +10 -10
  80. package/tests/e2e/{factories → theia/factories}/DirectUrlFactoryWithRootFolderTest.spec.ts +10 -10
  81. package/tests/e2e/{factories → theia/factories}/DirectUrlFactoryWithSpecificBranchTest.spec.ts +10 -10
  82. package/tests/e2e_happy_path/{DevWorkspaceHappyPath.spec.ts → theia/DevWorkspaceHappyPath.spec.ts} +17 -19
  83. package/tests/e2e_happy_path/{HappyPath.spec.ts → theia/HappyPath.spec.ts} +21 -20
  84. package/tests/intelij/IntelijOpenWorkspace.spec.ts +1 -1
  85. package/tests/load_test/{LoadTest.spec.ts → theia/LoadTest.spec.ts} +10 -9
  86. package/tests/plugins/{GitHubPullRequestPlugin.spec.ts → theia/GitHubPullRequestPlugin.spec.ts} +19 -20
  87. package/tests/plugins/{InstallPluginUsingUI.spec.ts → theia/InstallPluginUsingUI.spec.ts} +11 -12
  88. package/tests/plugins/{JavaPlugin.spec.ts → theia/JavaPlugin.spec.ts} +13 -13
  89. package/tests/plugins/{PhpPlugin.spec.ts → theia/PhpPlugin.spec.ts} +12 -12
  90. package/tests/plugins/{PythonPlugin.spec.ts → theia/PythonPlugin.spec.ts} +13 -13
  91. package/tests/plugins/{TypescriptPlugin.spec.ts → theia/TypescriptPlugin.spec.ts} +19 -19
  92. package/tests/plugins/{VscodeKubernetesPlugin.spec.ts → theia/VscodeKubernetesPlugin.spec.ts} +13 -13
  93. package/tests/plugins/{VscodeShellcheckPlugin.spec.ts → theia/VscodeShellcheckPlugin.spec.ts} +12 -12
  94. package/tests/plugins/{VscodeValePlugin.spec.ts → theia/VscodeValePlugin.spec.ts} +11 -11
  95. package/tests/plugins/{VscodeXmlPlugin.spec.ts → theia/VscodeXmlPlugin.spec.ts} +12 -12
  96. package/tests/plugins/{VscodeYamlPlugin.spec.ts → theia/VscodeYamlPlugin.spec.ts} +12 -12
  97. package/testsLibrary/WorkspaceHandlingTests.ts +115 -140
  98. package/testsLibrary/{CodeExecutionTests.ts → theia/CodeExecutionTestsTheia.ts} +15 -15
  99. package/testsLibrary/{LanguageServerTests.ts → theia/LanguageServerTestsTheia.ts} +9 -9
  100. package/testsLibrary/{ProjectAndFileTests.ts → theia/ProjectAndFileTestsTheia.ts} +36 -10
  101. package/utils/DriverHelper.ts +3 -3
  102. package/utils/{PreferencesHandler.ts → theia/PreferencesHandlerTheia.ts} +11 -11
  103. package/dist/TestConstants.js +0 -220
  104. package/dist/TestConstants.js.map +0 -1
  105. package/dist/TimeoutConstants.js +0 -184
  106. package/dist/TimeoutConstants.js.map +0 -1
  107. package/dist/driver/CheReporter.js +0 -181
  108. package/dist/driver/CheReporter.js.map +0 -1
  109. package/dist/driver/ChromeDriver.js +0 -75
  110. package/dist/driver/ChromeDriver.js.map +0 -1
  111. package/dist/driver/IDriver.js +0 -3
  112. package/dist/driver/IDriver.js.map +0 -1
  113. package/dist/index.js +0 -93
  114. package/dist/index.js.map +0 -1
  115. package/dist/inversify.config.js +0 -130
  116. package/dist/inversify.config.js.map +0 -1
  117. package/dist/inversify.types.js +0 -74
  118. package/dist/inversify.types.js.map +0 -1
  119. package/dist/pageobjects/dashboard/CreateWorkspace.js +0 -65
  120. package/dist/pageobjects/dashboard/CreateWorkspace.js.map +0 -1
  121. package/dist/pageobjects/dashboard/Dashboard.js +0 -115
  122. package/dist/pageobjects/dashboard/Dashboard.js.map +0 -1
  123. package/dist/pageobjects/dashboard/Workspaces.js +0 -157
  124. package/dist/pageobjects/dashboard/Workspaces.js.map +0 -1
  125. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js +0 -138
  126. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetails.js.map +0 -1
  127. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js +0 -97
  128. package/dist/pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins.js.map +0 -1
  129. package/dist/pageobjects/ide/ContextMenu.js +0 -66
  130. package/dist/pageobjects/ide/ContextMenu.js.map +0 -1
  131. package/dist/pageobjects/ide/DebugView.js +0 -98
  132. package/dist/pageobjects/ide/DebugView.js.map +0 -1
  133. package/dist/pageobjects/ide/DialogWindow.js +0 -102
  134. package/dist/pageobjects/ide/DialogWindow.js.map +0 -1
  135. package/dist/pageobjects/ide/Editor.js +0 -464
  136. package/dist/pageobjects/ide/Editor.js.map +0 -1
  137. package/dist/pageobjects/ide/Ide.js +0 -336
  138. package/dist/pageobjects/ide/Ide.js.map +0 -1
  139. package/dist/pageobjects/ide/LeftToolBar.js +0 -81
  140. package/dist/pageobjects/ide/LeftToolBar.js.map +0 -1
  141. package/dist/pageobjects/ide/NavigationBar.js +0 -57
  142. package/dist/pageobjects/ide/NavigationBar.js.map +0 -1
  143. package/dist/pageobjects/ide/NotificationCenter.js +0 -76
  144. package/dist/pageobjects/ide/NotificationCenter.js.map +0 -1
  145. package/dist/pageobjects/ide/OpenDialogWidget.js +0 -100
  146. package/dist/pageobjects/ide/OpenDialogWidget.js.map +0 -1
  147. package/dist/pageobjects/ide/OpenEditors.js +0 -73
  148. package/dist/pageobjects/ide/OpenEditors.js.map +0 -1
  149. package/dist/pageobjects/ide/OpenWorkspaceWidget.js +0 -62
  150. package/dist/pageobjects/ide/OpenWorkspaceWidget.js.map +0 -1
  151. package/dist/pageobjects/ide/PreviewWidget.js +0 -134
  152. package/dist/pageobjects/ide/PreviewWidget.js.map +0 -1
  153. package/dist/pageobjects/ide/ProjectTree.js +0 -282
  154. package/dist/pageobjects/ide/ProjectTree.js.map +0 -1
  155. package/dist/pageobjects/ide/QuickOpenContainer.js +0 -70
  156. package/dist/pageobjects/ide/QuickOpenContainer.js.map +0 -1
  157. package/dist/pageobjects/ide/RightToolBar.js +0 -51
  158. package/dist/pageobjects/ide/RightToolBar.js.map +0 -1
  159. package/dist/pageobjects/ide/Terminal.js +0 -184
  160. package/dist/pageobjects/ide/Terminal.js.map +0 -1
  161. package/dist/pageobjects/ide/TopMenu.js +0 -109
  162. package/dist/pageobjects/ide/TopMenu.js.map +0 -1
  163. package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.js +0 -128
  164. package/dist/pageobjects/ide/plugins/GitHubPullRequestPlugin.js.map +0 -1
  165. package/dist/pageobjects/ide/plugins/GitPlugin.js +0 -120
  166. package/dist/pageobjects/ide/plugins/GitPlugin.js.map +0 -1
  167. package/dist/pageobjects/ide/plugins/KubernetesPlugin.js +0 -107
  168. package/dist/pageobjects/ide/plugins/KubernetesPlugin.js.map +0 -1
  169. package/dist/pageobjects/ide/plugins/OpenshiftPlugin.js +0 -99
  170. package/dist/pageobjects/ide/plugins/OpenshiftPlugin.js.map +0 -1
  171. package/dist/pageobjects/ide/plugins/PluginsView.js +0 -166
  172. package/dist/pageobjects/ide/plugins/PluginsView.js.map +0 -1
  173. package/dist/pageobjects/login/ICheLoginPage.js +0 -12
  174. package/dist/pageobjects/login/ICheLoginPage.js.map +0 -1
  175. package/dist/pageobjects/login/IOcpLoginPage.js +0 -12
  176. package/dist/pageobjects/login/IOcpLoginPage.js.map +0 -1
  177. package/dist/pageobjects/login/MultiUserLoginPage.js +0 -49
  178. package/dist/pageobjects/login/MultiUserLoginPage.js.map +0 -1
  179. package/dist/pageobjects/login/OcpUserLoginPage.js +0 -53
  180. package/dist/pageobjects/login/OcpUserLoginPage.js.map +0 -1
  181. package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js +0 -86
  182. package/dist/pageobjects/login/RegularUserOcpCheLoginPage.js.map +0 -1
  183. package/dist/pageobjects/login/UpdateAccountInformationPage.js +0 -74
  184. package/dist/pageobjects/login/UpdateAccountInformationPage.js.map +0 -1
  185. package/dist/pageobjects/openshift/CheLoginPage.js +0 -88
  186. package/dist/pageobjects/openshift/CheLoginPage.js.map +0 -1
  187. package/dist/pageobjects/openshift/OcpLoginPage.js +0 -106
  188. package/dist/pageobjects/openshift/OcpLoginPage.js.map +0 -1
  189. package/dist/pageobjects/third-parties/GitLoginPage.js +0 -85
  190. package/dist/pageobjects/third-parties/GitLoginPage.js.map +0 -1
  191. package/dist/pageobjects/third-parties/GitOauthAppsSettings.js +0 -110
  192. package/dist/pageobjects/third-parties/GitOauthAppsSettings.js.map +0 -1
  193. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js +0 -73
  194. package/dist/tests/devfiles/CSlashCPlusPlus.spec.js.map +0 -1
  195. package/dist/tests/devfiles/DevfileSmoke.spec.js +0 -47
  196. package/dist/tests/devfiles/DevfileSmoke.spec.js.map +0 -1
  197. package/dist/tests/devfiles/DotNetCore.spec.js +0 -81
  198. package/dist/tests/devfiles/DotNetCore.spec.js.map +0 -1
  199. package/dist/tests/devfiles/Go.spec.js +0 -72
  200. package/dist/tests/devfiles/Go.spec.js.map +0 -1
  201. package/dist/tests/devfiles/JavaMaven.spec.js +0 -60
  202. package/dist/tests/devfiles/JavaMaven.spec.js.map +0 -1
  203. package/dist/tests/devfiles/JavaSpringBoot.spec.js +0 -66
  204. package/dist/tests/devfiles/JavaSpringBoot.spec.js.map +0 -1
  205. package/dist/tests/devfiles/JavaVertx.spec.js +0 -60
  206. package/dist/tests/devfiles/JavaVertx.spec.js.map +0 -1
  207. package/dist/tests/devfiles/NodeJS.spec.js +0 -64
  208. package/dist/tests/devfiles/NodeJS.spec.js.map +0 -1
  209. package/dist/tests/devfiles/PHPSimple.spec.js +0 -74
  210. package/dist/tests/devfiles/PHPSimple.spec.js.map +0 -1
  211. package/dist/tests/devfiles/Python.spec.js +0 -58
  212. package/dist/tests/devfiles/Python.spec.js.map +0 -1
  213. package/dist/tests/devfiles/PythonDjango.spec.js +0 -61
  214. package/dist/tests/devfiles/PythonDjango.spec.js.map +0 -1
  215. package/dist/tests/devfiles/Quarkus.spec.js +0 -69
  216. package/dist/tests/devfiles/Quarkus.spec.js.map +0 -1
  217. package/dist/tests/devfiles/Scala.spec.js +0 -66
  218. package/dist/tests/devfiles/Scala.spec.js.map +0 -1
  219. package/dist/tests/e2e/FactoryUrl.spec.js +0 -40
  220. package/dist/tests/e2e/FactoryUrl.spec.js.map +0 -1
  221. package/dist/tests/e2e/GitPublishBranch.spec.js +0 -90
  222. package/dist/tests/e2e/GitPublishBranch.spec.js.map +0 -1
  223. package/dist/tests/e2e/GitSelfSignCert.spec.js +0 -90
  224. package/dist/tests/e2e/GitSelfSignCert.spec.js.map +0 -1
  225. package/dist/tests/e2e/GitSsh.spec.js +0 -120
  226. package/dist/tests/e2e/GitSsh.spec.js.map +0 -1
  227. package/dist/tests/e2e/OpenshiftConnector.spec.js +0 -124
  228. package/dist/tests/e2e/OpenshiftConnector.spec.js.map +0 -1
  229. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js +0 -50
  230. package/dist/tests/e2e/factories/DirectUrlFactoryWithKeepDirectoryTest.spec.js.map +0 -1
  231. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js +0 -48
  232. package/dist/tests/e2e/factories/DirectUrlFactoryWithRootFolderTest.spec.js.map +0 -1
  233. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js +0 -48
  234. package/dist/tests/e2e/factories/DirectUrlFactoryWithSpecificBranchTest.spec.js.map +0 -1
  235. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js +0 -278
  236. package/dist/tests/e2e_happy_path/DevWorkspaceHappyPath.spec.js.map +0 -1
  237. package/dist/tests/e2e_happy_path/HappyPath.spec.js +0 -314
  238. package/dist/tests/e2e_happy_path/HappyPath.spec.js.map +0 -1
  239. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js +0 -39
  240. package/dist/tests/intelij/IntelijOpenWorkspace.spec.js.map +0 -1
  241. package/dist/tests/load_test/LoadTest.spec.js +0 -41
  242. package/dist/tests/load_test/LoadTest.spec.js.map +0 -1
  243. package/dist/tests/login/LinkCheAndOcpUsers.spec.js +0 -39
  244. package/dist/tests/login/LinkCheAndOcpUsers.spec.js.map +0 -1
  245. package/dist/tests/login/Login.spec.js +0 -28
  246. package/dist/tests/login/Login.spec.js.map +0 -1
  247. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js +0 -118
  248. package/dist/tests/plugins/GitHubPullRequestPlugin.spec.js.map +0 -1
  249. package/dist/tests/plugins/InstallPluginUsingUI.spec.js +0 -63
  250. package/dist/tests/plugins/InstallPluginUsingUI.spec.js.map +0 -1
  251. package/dist/tests/plugins/JavaPlugin.spec.js +0 -82
  252. package/dist/tests/plugins/JavaPlugin.spec.js.map +0 -1
  253. package/dist/tests/plugins/PhpPlugin.spec.js +0 -96
  254. package/dist/tests/plugins/PhpPlugin.spec.js.map +0 -1
  255. package/dist/tests/plugins/PythonPlugin.spec.js +0 -72
  256. package/dist/tests/plugins/PythonPlugin.spec.js.map +0 -1
  257. package/dist/tests/plugins/TypescriptPlugin.spec.js +0 -135
  258. package/dist/tests/plugins/TypescriptPlugin.spec.js.map +0 -1
  259. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js +0 -69
  260. package/dist/tests/plugins/VscodeKubernetesPlugin.spec.js.map +0 -1
  261. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js +0 -82
  262. package/dist/tests/plugins/VscodeShellcheckPlugin.spec.js.map +0 -1
  263. package/dist/tests/plugins/VscodeValePlugin.spec.js +0 -70
  264. package/dist/tests/plugins/VscodeValePlugin.spec.js.map +0 -1
  265. package/dist/tests/plugins/VscodeXmlPlugin.spec.js +0 -81
  266. package/dist/tests/plugins/VscodeXmlPlugin.spec.js.map +0 -1
  267. package/dist/tests/plugins/VscodeYamlPlugin.spec.js +0 -78
  268. package/dist/tests/plugins/VscodeYamlPlugin.spec.js.map +0 -1
  269. package/dist/testsLibrary/CodeExecutionTests.js +0 -248
  270. package/dist/testsLibrary/CodeExecutionTests.js.map +0 -1
  271. package/dist/testsLibrary/LanguageServerTests.js +0 -230
  272. package/dist/testsLibrary/LanguageServerTests.js.map +0 -1
  273. package/dist/testsLibrary/ProjectAndFileTests.js +0 -105
  274. package/dist/testsLibrary/ProjectAndFileTests.js.map +0 -1
  275. package/dist/testsLibrary/WorkspaceHandlingTests.js +0 -167
  276. package/dist/testsLibrary/WorkspaceHandlingTests.js.map +0 -1
  277. package/dist/utils/AnimationChecker.js +0 -45
  278. package/dist/utils/AnimationChecker.js.map +0 -1
  279. package/dist/utils/BrowserTabsUtil.js +0 -115
  280. package/dist/utils/BrowserTabsUtil.js.map +0 -1
  281. package/dist/utils/DriverHelper.js +0 -616
  282. package/dist/utils/DriverHelper.js.map +0 -1
  283. package/dist/utils/Logger.js +0 -84
  284. package/dist/utils/Logger.js.map +0 -1
  285. package/dist/utils/PreferencesHandler.js +0 -142
  286. package/dist/utils/PreferencesHandler.js.map +0 -1
  287. package/dist/utils/Sanitizer.js +0 -29
  288. package/dist/utils/Sanitizer.js.map +0 -1
  289. package/dist/utils/ScreenCatcher.js +0 -107
  290. package/dist/utils/ScreenCatcher.js.map +0 -1
  291. package/dist/utils/VCS/CheGitApi.js +0 -42
  292. package/dist/utils/VCS/CheGitApi.js.map +0 -1
  293. package/dist/utils/VCS/github/GitHubUtil.js +0 -126
  294. package/dist/utils/VCS/github/GitHubUtil.js.map +0 -1
  295. package/dist/utils/WorkspaceNameHandler.js +0 -60
  296. package/dist/utils/WorkspaceNameHandler.js.map +0 -1
  297. package/dist/utils/requestHandlers/CheApiRequestHandler.js +0 -126
  298. package/dist/utils/requestHandlers/CheApiRequestHandler.js.map +0 -1
  299. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js +0 -49
  300. package/dist/utils/requestHandlers/headers/CheMultiuserAuthorizationHeaderHandler.js.map +0 -1
  301. package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.js +0 -12
  302. package/dist/utils/requestHandlers/headers/IAuthorizationHeaderHandler.js.map +0 -1
  303. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js +0 -50
  304. package/dist/utils/requestHandlers/tokens/CheMultiuserTokenHandler.js.map +0 -1
  305. package/dist/utils/requestHandlers/tokens/ITokenHandler.js +0 -12
  306. package/dist/utils/requestHandlers/tokens/ITokenHandler.js.map +0 -1
  307. package/dist/utils/workspace/ApiUrlResolver.js +0 -67
  308. package/dist/utils/workspace/ApiUrlResolver.js.map +0 -1
  309. package/dist/utils/workspace/ITestWorkspaceUtil.js +0 -12
  310. package/dist/utils/workspace/ITestWorkspaceUtil.js.map +0 -1
  311. package/dist/utils/workspace/TestWorkspaceUtil.js +0 -357
  312. package/dist/utils/workspace/TestWorkspaceUtil.js.map +0 -1
  313. package/dist/utils/workspace/WorkspaceStatus.js +0 -19
  314. package/dist/utils/workspace/WorkspaceStatus.js.map +0 -1
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Logger = void 0;
4
- const TestConstants_1 = require("../TestConstants");
5
- /*********************************************************************
6
- * Copyright (c) 2019 Red Hat, Inc.
7
- *
8
- * This program and the accompanying materials are made
9
- * available under the terms of the Eclipse Public License 2.0
10
- * which is available at https://www.eclipse.org/legal/epl-2.0/
11
- *
12
- * SPDX-License-Identifier: EPL-2.0
13
- **********************************************************************/
14
- class Logger {
15
- /**
16
- * Uses for logging of fatal errors.
17
- * @param text log text
18
- */
19
- static error(text, indentLevel = 1) {
20
- this.logText(indentLevel, `[ERROR] ${text}`);
21
- }
22
- /**
23
- * Uses for logging of recoverable errors and general warnings.
24
- * @param text log text
25
- */
26
- static warn(text, indentLevel = 1) {
27
- if (TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR') {
28
- return;
29
- }
30
- this.logText(indentLevel, `[WARN] ${text}`);
31
- }
32
- /**
33
- * Uses for logging of the public methods of the pageobjects.
34
- * @param text log text
35
- */
36
- static info(text, indentLevel = 3) {
37
- if (TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
38
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'WARN') {
39
- return;
40
- }
41
- this.logText(indentLevel, `• ${text}`);
42
- }
43
- /**
44
- * Uses for logging of the public methods of the pageobjects.
45
- * @param text log text
46
- */
47
- static debug(text, indentLevel = 5) {
48
- if (TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
49
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'WARN' ||
50
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'INFO') {
51
- return;
52
- }
53
- this.logText(indentLevel, `▼ ${text}`);
54
- }
55
- /**
56
- * Uses for logging of the public methods of the {@link DriverHelper} or
57
- * private methods inside of pageobjects.
58
- * @param text log text
59
- */
60
- static trace(text, indentLevel = 6) {
61
- if (TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'ERROR' ||
62
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'WARN' ||
63
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'INFO' ||
64
- TestConstants_1.TestConstants.TS_SELENIUM_LOG_LEVEL === 'DEBUG') {
65
- return;
66
- }
67
- this.logText(indentLevel, `‣ ${text}`);
68
- }
69
- static logText(messageIndentationLevel, text) {
70
- // start group for every level
71
- for (let i = 0; i < messageIndentationLevel; i++) {
72
- console.group();
73
- }
74
- // print the trimmed text
75
- // if multiline, the message should be properly padded
76
- console.log(text);
77
- // end group for every level
78
- for (let i = 0; i < messageIndentationLevel; i++) {
79
- console.groupEnd();
80
- }
81
- }
82
- }
83
- exports.Logger = Logger;
84
- //# sourceMappingURL=Logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../utils/Logger.ts"],"names":[],"mappings":";;;AAAA,oDAAiD;AAEjD;;;;;;;;wEAQwE;AAExE,MAAsB,MAAM;IAExB;;;OAGG;IACI,MAAM,CAAC,KAAK,CAAC,IAAY,EAAE,cAAsB,CAAC;QACrD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;I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,CAAC,GAAG,uBAAuB,EAAE,CAAC,EAAE,EAAE;YAC9C,OAAO,CAAC,KAAK,EAAE,CAAC;SACnB;QACD,yBAAyB;QACzB,sDAAsD;QACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,4BAA4B;QAC5B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,EAAE,CAAC,EAAE,EAAE;YAC9C,OAAO,CAAC,QAAQ,EAAE,CAAC;SACtB;IACL,CAAC;CACJ;AA1ED,wBA0EC"}
@@ -1,142 +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
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
- return c > 3 && r && Object.defineProperty(target, key, r), r;
16
- };
17
- var __metadata = (this && this.__metadata) || function (k, v) {
18
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
- };
20
- var __param = (this && this.__param) || function (paramIndex, decorator) {
21
- return function (target, key) { decorator(target, key, paramIndex); }
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.PreferencesHandler = exports.AskForConfirmationType = exports.TerminalRendererType = void 0;
25
- const inversify_1 = require("inversify");
26
- const Logger_1 = require("./Logger");
27
- const inversify_types_1 = require("../inversify.types");
28
- const CheApiRequestHandler_1 = require("./requestHandlers/CheApiRequestHandler");
29
- const Editor_1 = require("../pageobjects/ide/Editor");
30
- const QuickOpenContainer_1 = require("../pageobjects/ide/QuickOpenContainer");
31
- const TopMenu_1 = require("../pageobjects/ide/TopMenu");
32
- const selenium_webdriver_1 = require("selenium-webdriver");
33
- var TerminalRendererType;
34
- (function (TerminalRendererType) {
35
- TerminalRendererType["canvas"] = "canvas";
36
- TerminalRendererType["dom"] = "dom";
37
- })(TerminalRendererType = exports.TerminalRendererType || (exports.TerminalRendererType = {}));
38
- var AskForConfirmationType;
39
- (function (AskForConfirmationType) {
40
- AskForConfirmationType["never"] = "never";
41
- AskForConfirmationType["ifRquired"] = "ifRequired";
42
- AskForConfirmationType["always"] = "always";
43
- })(AskForConfirmationType = exports.AskForConfirmationType || (exports.AskForConfirmationType = {}));
44
- let PreferencesHandler = class PreferencesHandler {
45
- constructor(requestHandler, editor, quickOpenContainer, topMenu) {
46
- this.requestHandler = requestHandler;
47
- this.editor = editor;
48
- this.quickOpenContainer = quickOpenContainer;
49
- this.topMenu = topMenu;
50
- }
51
- /**
52
- * Works properly only for the running workspace.
53
- */
54
- async setPreferenceUsingUI(property, value) {
55
- const tabTitle = 'settings.json';
56
- await this.topMenu.selectOption('View', 'Find Command...');
57
- await this.quickOpenContainer.typeAndSelectSuggestion('Preferences:', 'Preferences: Open Preferences (JSON)');
58
- let editorText = await this.editor.getEditorVisibleText(tabTitle);
59
- if (!editorText) {
60
- editorText = '{}';
61
- }
62
- let preferences = JSON.parse(editorText);
63
- preferences[property] = value;
64
- await this.editor.deleteAllText(tabTitle);
65
- await this.editor.type(tabTitle, JSON.stringify(preferences), 1);
66
- await this.editor.type(tabTitle, selenium_webdriver_1.Key.chord(selenium_webdriver_1.Key.CONTROL, selenium_webdriver_1.Key.SHIFT, 'i'), 1);
67
- }
68
- /**
69
- * Works properly only if set before workspace startup.
70
- */
71
- async setTerminalType(type) {
72
- Logger_1.Logger.debug('PreferencesHandler.setTerminalToDom');
73
- await this.setPreference('terminal.integrated.rendererType', type);
74
- }
75
- /**
76
- *
77
- * @param askForConfirmation possible values are "never", "ifRequired" and "always"
78
- */
79
- async setConfirmExit(askForConfirmation) {
80
- Logger_1.Logger.debug(`PreferencesHandler.setConfirmExit to ${askForConfirmation}`);
81
- await this.setPreference(`application.confirmExit`, askForConfirmation);
82
- }
83
- /**
84
- * Works properly only if set before workspace startup.
85
- */
86
- async setUseGoLanaguageServer() {
87
- Logger_1.Logger.debug(`PreferencesHandler.setUseGoLanguageServer to true.`);
88
- await this.setPreference('go.useLanguageServer', 'true');
89
- }
90
- /**
91
- * Works properly only if set before workspace startup.
92
- */
93
- async setVscodeKubernetesPluginConfig(vsKubernetesConfig) {
94
- Logger_1.Logger.debug(`PreferencesHandler.setVscodeKubernetesPluginConfig`);
95
- await this.setPreference('vs-kubernetes', vsKubernetesConfig);
96
- }
97
- async setPreference(attribute, value) {
98
- Logger_1.Logger.trace(`PreferencesHandler.setPreferences ${attribute} to ${value}`);
99
- let response;
100
- try {
101
- response = await this.requestHandler.get('api/preferences');
102
- }
103
- catch (e) {
104
- Logger_1.Logger.error(`PreferencesHandler.setPreferences failed to get user preferences: ${e}`);
105
- return;
106
- }
107
- let userPref = response.data;
108
- try {
109
- let theiaPref = JSON.parse(userPref['theia-user-preferences']);
110
- theiaPref[attribute] = value;
111
- userPref['theia-user-preferences'] = JSON.stringify(theiaPref);
112
- await this.requestHandler.post('api/preferences', userPref);
113
- }
114
- catch (e) {
115
- // setting terminal before running a workspace, so no theia preferences are set
116
- Logger_1.Logger.warn(`PreferencesHandler.setPreference could not set theia-user-preferences from api/preferences response, forcing manually.`);
117
- let theiaPref = `{ "${attribute}":"${value}" }`;
118
- userPref['theia-user-preferences'] = JSON.stringify(JSON.parse(theiaPref));
119
- try {
120
- await this.requestHandler.post('api/preferences', userPref);
121
- }
122
- catch (e) {
123
- Logger_1.Logger.error(`PreferencesHandler.setPreference failed to manually set preferences value: ${e}`);
124
- return;
125
- }
126
- }
127
- Logger_1.Logger.trace(`PreferencesHandler.setPreferences ${attribute} to ${value} done.`);
128
- }
129
- };
130
- PreferencesHandler = __decorate([
131
- inversify_1.injectable(),
132
- __param(0, inversify_1.inject(inversify_types_1.CLASSES.CheApiRequestHandler)),
133
- __param(1, inversify_1.inject(inversify_types_1.CLASSES.Editor)),
134
- __param(2, inversify_1.inject(inversify_types_1.CLASSES.QuickOpenContainer)),
135
- __param(3, inversify_1.inject(inversify_types_1.CLASSES.TopMenu)),
136
- __metadata("design:paramtypes", [CheApiRequestHandler_1.CheApiRequestHandler,
137
- Editor_1.Editor,
138
- QuickOpenContainer_1.QuickOpenContainer,
139
- TopMenu_1.TopMenu])
140
- ], PreferencesHandler);
141
- exports.PreferencesHandler = PreferencesHandler;
142
- //# sourceMappingURL=PreferencesHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PreferencesHandler.js","sourceRoot":"","sources":["../../utils/PreferencesHandler.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;;;;;;;;;;;;;AAExE,yCAA+C;AAC/C,qCAAkC;AAClC,wDAA6C;AAC7C,iFAA8E;AAC9E,sDAAmD;AACnD,8EAA2E;AAC3E,wDAAqD;AACrD,2DAAyC;AAEzC,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,mCAAW,CAAA;AACf,CAAC,EAHW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAG/B;AAED,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAC9B,yCAAe,CAAA;IACf,kDAAwB,CAAA;IACxB,2CAAiB,CAAA;AACrB,CAAC,EAJW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAIjC;AAGD,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE3B,YAAmE,cAAoC,EAC1D,MAAc,EACF,kBAAsC,EACjD,OAAgB;QAHK,mBAAc,GAAd,cAAc,CAAsB;QAC1D,WAAM,GAAN,MAAM,CAAQ;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AAC,EAAE;YACR,+EAA+E;YAC/E,eAAM,CAAC,IAAI,CAAC,wHAAwH,CAAC,CAAC;YACtI,IAAI,SAAS,GAAG,MAAM,SAAS,MAAM,KAAK,KAAK,CAAC;YAChD,QAAQ,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;YAC3E,IAAI;gBACA,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;aAC/D;YAAC,OAAO,CAAC,EAAE;gBACR,eAAM,CAAC,KAAK,CAAC,8EAA8E,CAAC,EAAE,CAAC,CAAC;gBAChG,OAAO;aACV;SACJ;QACD,eAAM,CAAC,KAAK,CAAC,qCAAqC,SAAS,OAAO,KAAK,QAAQ,CAAC,CAAC;IACrF,CAAC;CACJ,CAAA;AA3FY,kBAAkB;IAD9B,sBAAU,EAAE;IAGI,WAAA,kBAAM,CAAC,yBAAO,CAAC,oBAAoB,CAAC,CAAA;IAC5C,WAAA,kBAAM,CAAC,yBAAO,CAAC,MAAM,CAAC,CAAA;IACtB,WAAA,kBAAM,CAAC,yBAAO,CAAC,kBAAkB,CAAC,CAAA;IAClC,WAAA,kBAAM,CAAC,yBAAO,CAAC,OAAO,CAAC,CAAA;qCAHuD,2CAAoB;QAClD,eAAM;QACkB,uCAAkB;QACxC,iBAAO;GALrD,kBAAkB,CA2F9B;AA3FY,gDAAkB"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- /*********************************************************************
3
- * Copyright (c) 2021 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
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
- return c > 3 && r && Object.defineProperty(target, key, r), r;
16
- };
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.Sanitizer = void 0;
19
- const inversify_1 = require("inversify");
20
- let Sanitizer = class Sanitizer {
21
- sanitize(arg) {
22
- return arg.replace(/[\/]/g, '+').replace(/[\,]/g, '.').replace(/[\:]/g, '-').replace(/[\'\"]/g, '').replace(/[^a-z0-9\+\-\.\(\)\[\]\_]/gi, '_');
23
- }
24
- };
25
- Sanitizer = __decorate([
26
- inversify_1.injectable()
27
- ], Sanitizer);
28
- exports.Sanitizer = Sanitizer;
29
- //# sourceMappingURL=Sanitizer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Sanitizer.js","sourceRoot":"","sources":["../../utils/Sanitizer.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;;;;;;;AAExE,yCAAuC;AAGvC,IAAa,SAAS,GAAtB,MAAa,SAAS;IAEX,QAAQ,CAAC,GAAW;QACvB,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAC;IACpJ,CAAC;CAEJ,CAAA;AANY,SAAS;IADrB,sBAAU,EAAE;GACA,SAAS,CAMrB;AANY,8BAAS"}
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
15
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
16
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
17
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
18
- return c > 3 && r && Object.defineProperty(target, key, r), r;
19
- };
20
- var __importStar = (this && this.__importStar) || function (mod) {
21
- if (mod && mod.__esModule) return mod;
22
- var result = {};
23
- if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
24
- __setModuleDefault(result, mod);
25
- return result;
26
- };
27
- var __metadata = (this && this.__metadata) || function (k, v) {
28
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
29
- };
30
- var __param = (this && this.__param) || function (paramIndex, decorator) {
31
- return function (target, key) { decorator(target, key, paramIndex); }
32
- };
33
- Object.defineProperty(exports, "__esModule", { value: true });
34
- exports.ScreenCatcher = void 0;
35
- /*********************************************************************
36
- * Copyright (c) 2021 Red Hat, Inc.
37
- *
38
- * This program and the accompanying materials are made
39
- * available under the terms of the Eclipse Public License 2.0
40
- * which is available at https://www.eclipse.org/legal/epl-2.0/
41
- *
42
- * SPDX-License-Identifier: EPL-2.0
43
- **********************************************************************/
44
- const fs = __importStar(require("fs"));
45
- const inversify_1 = require("inversify");
46
- const inversify_types_1 = require("../inversify.types");
47
- const DriverHelper_1 = require("./DriverHelper");
48
- const __1 = require("..");
49
- const Sanitizer_1 = require("./Sanitizer");
50
- const selenium_webdriver_1 = require("selenium-webdriver");
51
- let ScreenCatcher = class ScreenCatcher {
52
- constructor(driverHelper, sanitizer) {
53
- this.driverHelper = driverHelper;
54
- this.sanitizer = sanitizer;
55
- }
56
- async catchMethodScreen(methodName, methodIndex, screenshotIndex) {
57
- const executionScreenCastDir = `${__1.TestConstants.TS_SELENIUM_REPORT_FOLDER}/executionScreencast`;
58
- const executionScreenCastErrorsDir = `${__1.TestConstants.TS_SELENIUM_REPORT_FOLDER}/executionScreencastErrors`;
59
- const formattedMethodIndex = new Intl.NumberFormat('en-us', { minimumIntegerDigits: 3 }).format(methodIndex);
60
- const formattedScreenshotIndex = new Intl.NumberFormat('en-us', { minimumIntegerDigits: 5 }).format(screenshotIndex).replace(/,/g, '');
61
- if (!fs.existsSync(__1.TestConstants.TS_SELENIUM_REPORT_FOLDER)) {
62
- fs.mkdirSync(__1.TestConstants.TS_SELENIUM_REPORT_FOLDER);
63
- }
64
- if (!fs.existsSync(executionScreenCastDir)) {
65
- fs.mkdirSync(executionScreenCastDir);
66
- }
67
- const date = new Date();
68
- const timeStr = date.toLocaleTimeString('en-us', { hour12: false }) + '.' + new Intl.NumberFormat('en-us', { minimumIntegerDigits: 3 }).format(date.getMilliseconds());
69
- const screenshotPath = `${executionScreenCastDir}/${formattedMethodIndex}-${formattedScreenshotIndex}--(${this.sanitizer.sanitize(timeStr)})_${this.sanitizer.sanitize(methodName)}.png`;
70
- try {
71
- await this.catchScreen(screenshotPath);
72
- }
73
- catch (err) {
74
- if (!fs.existsSync(executionScreenCastErrorsDir)) {
75
- fs.mkdirSync(executionScreenCastErrorsDir);
76
- }
77
- let errorLogFilePath = screenshotPath.replace('.png', '.txt');
78
- errorLogFilePath = errorLogFilePath.replace(executionScreenCastDir, executionScreenCastErrorsDir);
79
- if (err instanceof selenium_webdriver_1.error.IError) {
80
- await this.writeErrorLog(errorLogFilePath, err);
81
- }
82
- }
83
- }
84
- async catchScreen(screenshotPath) {
85
- const screenshot = await this.driverHelper.getDriver().takeScreenshot();
86
- const screenshotStream = fs.createWriteStream(screenshotPath);
87
- screenshotStream.write(Buffer.from(screenshot, 'base64'));
88
- screenshotStream.end();
89
- }
90
- async writeErrorLog(errorLogPath, err) {
91
- console.log(`Failed to save screenshot, additional information in the ${errorLogPath}`);
92
- if (err.stack) {
93
- const screenshotStream = fs.createWriteStream(errorLogPath);
94
- screenshotStream.write(Buffer.from(err.stack, 'utf8'));
95
- screenshotStream.end();
96
- }
97
- }
98
- };
99
- ScreenCatcher = __decorate([
100
- inversify_1.injectable(),
101
- __param(0, inversify_1.inject(inversify_types_1.CLASSES.DriverHelper)),
102
- __param(1, inversify_1.inject(inversify_types_1.CLASSES.Sanitizer)),
103
- __metadata("design:paramtypes", [DriverHelper_1.DriverHelper,
104
- Sanitizer_1.Sanitizer])
105
- ], ScreenCatcher);
106
- exports.ScreenCatcher = ScreenCatcher;
107
- //# sourceMappingURL=ScreenCatcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ScreenCatcher.js","sourceRoot":"","sources":["../../utils/ScreenCatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;wEAQwE;AACxE,uCAAyB;AACzB,yCAA+C;AAC/C,wDAA6C;AAC7C,iDAA8C;AAC9C,0BAAmC;AACnC,2CAAwC;AACxC,2DAA2C;AAG3C,IAAa,aAAa,GAA1B,MAAa,aAAa;IACtB,YAA2D,YAA0B,EAC7B,SAAoB;QADjB,iBAAY,GAAZ,YAAY,CAAc;QAC7B,cAAS,GAAT,SAAS,CAAW;IAAI,CAAC;IAEjF,KAAK,CAAC,iBAAiB,CAAC,UAAkB,EAAE,WAAmB,EAAE,eAAuB;QACpF,MAAM,sBAAsB,GAAG,GAAG,iBAAa,CAAC,yBAAyB,sBAAsB,CAAC;QAChG,MAAM,4BAA4B,GAAG,GAAG,iBAA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AA;IAC5B,WAAA,kBAAM,CAAC,yBAAO,CAAC,SAAS,CAAC,CAAA;qCADmC,2BAAY;QAClB,qBAAS;GAFnE,aAAa,CAuDzB;AAvDY,sCAAa"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var CheGitApi_1;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CheGitApi = void 0;
17
- const inversify_1 = require("inversify");
18
- const inversify_types_1 = require("../../inversify.types");
19
- const CheApiRequestHandler_1 = require("../../utils/requestHandlers/CheApiRequestHandler");
20
- let CheGitApi = CheGitApi_1 = class CheGitApi {
21
- constructor(processRequestHandler) {
22
- this.processRequestHandler = processRequestHandler;
23
- }
24
- async getPublicSSHKey() {
25
- try {
26
- const responce = await this.processRequestHandler.get(CheGitApi_1.GIT_API_ENTRIPOINT_URL);
27
- return responce.data[0].publicKey;
28
- }
29
- catch (error) {
30
- console.error('Cannot get public ssh key with API \n' + error);
31
- throw error;
32
- }
33
- }
34
- };
35
- CheGitApi.GIT_API_ENTRIPOINT_URL = 'api/ssh/vcs';
36
- CheGitApi = CheGitApi_1 = __decorate([
37
- inversify_1.injectable(),
38
- __param(0, inversify_1.inject(inversify_types_1.CLASSES.CheApiRequestHandler)),
39
- __metadata("design:paramtypes", [CheApiRequestHandler_1.CheApiRequestHandler])
40
- ], CheGitApi);
41
- exports.CheGitApi = CheGitApi;
42
- //# sourceMappingURL=CheGitApi.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CheGitApi.js","sourceRoot":"","sources":["../../../utils/VCS/CheGitApi.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yCAA+C;AAC/C,2DAAgD;AAChD,2FAAwF;AAIxF,IAAa,SAAS,iBAAtB,MAAa,SAAS;IAGpB,YAAmE,qBAA2C;QAA3C,0BAAqB,GAArB,qBAAqB,CAAsB;IAAI,CAAC;IAI5G,KAAK,CAAE,eAAe;QAE3B,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,WAAS,CAAC,sBAAsB,CAAC,CAAC;YACxF,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;SACnC;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,uCAAuC,GAAG,KAAK,CAAC,CAAC;YAC/D,MAAM,KAAK,CAAC;SACb;IAEH,CAAC;CAEF,CAAA;AAlBiB,gCAAsB,GAAG,aAAa,CAAC;AAD5C,SAAS;IADrB,sBAAU,EAAE;IAIE,WAAA,kBAAM,CAAC,yBAAO,CAAC,oBAAoB,CAAC,CAAA;qCAAyC,2CAAoB;GAHnG,SAAS,CAmBrB;AAnBY,8BAAS"}
@@ -1,126 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- var GitHubUtil_1;
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.GitHubUtil = void 0;
14
- const inversify_1 = require("inversify");
15
- const axios_1 = __importDefault(require("axios"));
16
- let GitHubUtil = GitHubUtil_1 = class GitHubUtil {
17
- /**
18
- * add public part of ssh key to the defied github account
19
- * @param authToken
20
- * @param title
21
- * @param key
22
- */
23
- async addPublicSshKeyToUserAccount(authToken, title, key) {
24
- const gitHubApiSshURL = GitHubUtil_1.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
25
- const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
26
- const data = {
27
- title: `${title}`,
28
- key: `${key}`
29
- };
30
- try {
31
- await axios_1.default.post(gitHubApiSshURL, JSON.stringify(data), authHeader);
32
- }
33
- catch (error) {
34
- console.error('Cannot add the public key to the GitHub account: ');
35
- console.error(error);
36
- throw error;
37
- }
38
- }
39
- async getRawContentFromFile(pathToFile) {
40
- const gitHubContentEntryPointUrl = 'https://raw.githubusercontent.com/';
41
- const pathToRawContent = `${gitHubContentEntryPointUrl}${pathToFile}`;
42
- const authorization = 'Authorization';
43
- const contentType = 'Content-Type';
44
- try {
45
- delete axios_1.default.defaults.headers.common[authorization];
46
- delete axios_1.default.defaults.headers.common[contentType];
47
- const response = await axios_1.default.get(`${gitHubContentEntryPointUrl}${pathToFile}`);
48
- return response.data;
49
- }
50
- catch (error) {
51
- console.error('Cannot get content form the raw github content: ' + pathToRawContent);
52
- console.error(error);
53
- throw error;
54
- }
55
- }
56
- async getPublicSshKeys(authToken) {
57
- const gitHubApiSshURL = GitHubUtil_1.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
58
- const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
59
- try {
60
- const response = await axios_1.default.get(gitHubApiSshURL, authHeader);
61
- const stringified = JSON.stringify(response.data);
62
- const arrayOfWorkspaces = JSON.parse(stringified);
63
- const idOfRunningWorkspace = new Array();
64
- for (let entry of arrayOfWorkspaces) {
65
- idOfRunningWorkspace.push(entry.id);
66
- }
67
- return idOfRunningWorkspace;
68
- }
69
- catch (error) {
70
- console.error('Cannot get public Keys from github: ' + gitHubApiSshURL);
71
- console.error(error);
72
- throw error;
73
- }
74
- }
75
- async removePublicSshKey(authToken, keyId) {
76
- const gitHubApiSshURL = GitHubUtil_1.GITHUB_API_ENTRIPOINT_URL + 'user/keys/' + keyId;
77
- const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
78
- try {
79
- await axios_1.default.delete(gitHubApiSshURL, authHeader);
80
- }
81
- catch (error) {
82
- console.error('Cannot delete the public key from the GitHub account: ');
83
- console.error(error);
84
- throw error;
85
- }
86
- }
87
- async deletePublicSshKeyByName(authToken, keyName) {
88
- const gitHubApiSshURL = GitHubUtil_1.GITHUB_API_ENTRIPOINT_URL + 'user/keys';
89
- const authHeader = { headers: { 'Authorization': 'token ' + authToken, 'Content-Type': 'application/json' } };
90
- try {
91
- const response = await axios_1.default.get(gitHubApiSshURL, authHeader);
92
- const stringified = JSON.stringify(response.data);
93
- const arrayOfPublicKeys = JSON.parse(stringified);
94
- for (let entry of arrayOfPublicKeys) {
95
- if (entry.title === keyName) {
96
- this.removePublicSshKey(authToken, entry.id);
97
- break;
98
- }
99
- }
100
- }
101
- catch (error) {
102
- console.error('Cannot delete the ' + keyName + ' public key from the GitHub account');
103
- console.error(error);
104
- throw error;
105
- }
106
- }
107
- async removeAllPublicSshKeys(authToken) {
108
- try {
109
- const idList = await this.getPublicSshKeys(authToken);
110
- for (let id of idList) {
111
- this.removePublicSshKey(authToken, id);
112
- }
113
- }
114
- catch (error) {
115
- console.error('Cannot delete the public key from the GitHub account: ');
116
- console.error(error);
117
- throw error;
118
- }
119
- }
120
- };
121
- GitHubUtil.GITHUB_API_ENTRIPOINT_URL = 'https://api.github.com/';
122
- GitHubUtil = GitHubUtil_1 = __decorate([
123
- inversify_1.injectable()
124
- ], GitHubUtil);
125
- exports.GitHubUtil = GitHubUtil;
126
- //# sourceMappingURL=GitHubUtil.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GitHubUtil.js","sourceRoot":"","sources":["../../../../utils/VCS/github/GitHubUtil.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yCAAuC;AACvC,kDAA0B;AAG1B,IAAa,UAAU,kBAAvB,MAAa,UAAU;IAErB;;;;;OAKG;IACH,KAAK,CAAC,4BAA4B,CAAC,SAAiB,EAAE,KAAa,EAAE,GAAW;QAC9E,MAAM,eAAe,GAAW,YAAU,CAAC,yBAAyB,GAAG,WAAW,CAAC;QACnF,MAAM,UAAU,GAAG,EAAE,OAAO,EAAE,EAAE,eAAe,EAAE,QAAQ,GAAG,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC;QAE9G,MAAM,IAAI,GAAG;YACX,KAAK,EAAE,GAAG,KAAK,EAAE;YACjB,GAAG,EAAE,GAAG,GAAG,EAAE;SACd,CAAC;QAEF,IAAI;YAAE,MAAM,eAAK,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC;SAAE;QAAC,OAAO,KAAK,EAAE;YACzF,OAAO,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACnE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,KAAK,CAAC;SACb;IACH,CAAC;IAED,KAAK,CAAC,qBAAqB,CAAC,UAAkB;QAC5C,MAAM,0BAA0B,GAAW,oCAAoC,CAAC;QAChF,MAAM,gBAAgB,GAAW,GAAG,0BAA0B,GAAG,UAAU,EAAE,CAAC;QAC9E,MAAM,aAAa,GAAW,eAAe,CAAC;QAC9C,MA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kB,CAAC,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;oBAC7C,MAAM;iBACP;aACF;SACF;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,oBAAoB,GAAG,OAAO,GAAG,qCAAqC,CAAC,CAAC;YACtF,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,KAAK,CAAC;SACb;IACH,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,SAAiB;QAC5C,IAAI;YACF,MAAM,MAAM,GAAa,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAChE,KAAK,IAAI,EAAE,IAAI,MAAM,EAAE;gBACrB,IAAI,CAAC,kBAAkB,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;aACxC;SAEF;QAAC,OAAO,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,wDAAwD,CAAC,CAAC;YACxE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,MAAM,KAAK,CAAC;SACb;IACH,CAAC;CAEF,CAAA;AAxGyB,oCAAyB,GAAG,yBAAyB,CAAC;AADnE,UAAU;IADtB,sBAAU,EAAE;GACA,UAAU,CAyGtB;AAzGY,gCAAU"}
@@ -1,60 +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
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
15
- return c > 3 && r && Object.defineProperty(target, key, r), r;
16
- };
17
- var __metadata = (this && this.__metadata) || function (k, v) {
18
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
- };
20
- var __param = (this && this.__param) || function (paramIndex, decorator) {
21
- return function (target, key) { decorator(target, key, paramIndex); }
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.WorkspaceNameHandler = void 0;
25
- const inversify_types_1 = require("../inversify.types");
26
- const inversify_1 = require("inversify");
27
- const BrowserTabsUtil_1 = require("./BrowserTabsUtil");
28
- const Logger_1 = require("./Logger");
29
- let WorkspaceNameHandler = class WorkspaceNameHandler {
30
- constructor(browserTabsUtil) {
31
- this.browserTabsUtil = browserTabsUtil;
32
- }
33
- generateWorkspaceName(prefix, randomLength) {
34
- const possibleCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
35
- const possibleCharactersLength = possibleCharacters.length;
36
- let randomPart = '';
37
- Logger_1.Logger.debug('WorkspaceNameHandler.generateWorkspaceName');
38
- for (let i = 0; i < randomLength; i++) {
39
- let currentRandomIndex = Math.floor(Math.random() * Math.floor(possibleCharactersLength));
40
- randomPart += possibleCharacters[currentRandomIndex];
41
- }
42
- return prefix + randomPart;
43
- }
44
- async getNameFromUrl() {
45
- let workspaceUrl = await this.browserTabsUtil.getCurrentUrl();
46
- Logger_1.Logger.debug(`WorkspaceNameHandler.fromWorkspaceUrl workspaceUrl: ${workspaceUrl}`);
47
- const workspaceUrlParts = workspaceUrl.split('/');
48
- const workspaceNameQueryString = workspaceUrlParts[workspaceUrlParts.length - 1];
49
- const workspaceName = workspaceNameQueryString.split('?')[0];
50
- Logger_1.Logger.debug(`workspaceName: ${workspaceName}`);
51
- return workspaceName;
52
- }
53
- };
54
- WorkspaceNameHandler = __decorate([
55
- inversify_1.injectable(),
56
- __param(0, inversify_1.inject(inversify_types_1.CLASSES.BrowserTabsUtil)),
57
- __metadata("design:paramtypes", [BrowserTabsUtil_1.BrowserTabsUtil])
58
- ], WorkspaceNameHandler);
59
- exports.WorkspaceNameHandler = WorkspaceNameHandler;
60
- //# sourceMappingURL=WorkspaceNameHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WorkspaceNameHandler.js","sourceRoot":"","sources":["../../utils/WorkspaceNameHandler.ts"],"names":[],"mappings":";AAAA;;;;;;;;wEAQwE;;;;;;;;;;;;;;;AAExE,wDAA6C;AAC7C,yCAA+C;AAC/C,uDAAoD;AACpD,qCAAkC;AAGlC,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAE7B,YAA8D,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAE3F,qBAAqB,CAAC,MAAc,EAAE,YAAoB;QAC7D,MAAM,kBAAkB,GAAW,sDAAsD,CAAC;QAC1F,MAAM,wBAAwB,GAAW,kBAAkB,CAAC,MAAM,CAAC;QACnE,IAAI,UAAU,GAAW,EAAE,CAAC;QAC5B,eAAM,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAE3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC,EAAE,EAAE;YACnC,IAAI,kBAAkB,GAAW,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC,CAAC;YAElG,UAAU,IAAI,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;SACxD;QAED,OAAO,MAAM,GAAG,UAAU,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,cAAc;QACvB,IAAI,YAAY,GAAW,MAAM,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,CAAC;QACtE,eAAM,CAAC,KAAK,CAAC,wDAAwD,YAAY,EAAE,CAAC,CAAC;QAErF,MAAM,iBAAiB,GAA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