@kalisio/kdk 2.2.2 → 2.3.1

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 (388) hide show
  1. package/.eslintignore +1 -0
  2. package/.github/workflows/main.yaml +67 -0
  3. package/.gitmodules +3 -0
  4. package/README.md +1 -2
  5. package/core/api/hooks/hooks.query.js +15 -2
  6. package/core/api/marshall.js +35 -4
  7. package/core/client/api.js +1 -1
  8. package/core/client/components/KActivity.vue +73 -0
  9. package/core/client/components/KContent.vue +1 -1
  10. package/core/client/components/KSponsor.vue +2 -13
  11. package/core/client/components/account/KDeleteAccountManager.vue +1 -1
  12. package/core/client/components/account/KPasswordManager.vue +1 -1
  13. package/core/client/components/action/KAction.vue +294 -0
  14. package/core/client/components/action/KBugReportAction.vue +37 -0
  15. package/core/client/components/action/index.js +7 -0
  16. package/core/client/components/app/KAbout.vue +16 -63
  17. package/core/client/components/app/KPlatform.vue +1 -1
  18. package/core/client/components/app/KSettings.vue +14 -14
  19. package/core/client/components/app/KTour.vue +6 -8
  20. package/core/client/components/app/KWelcome.vue +1 -1
  21. package/core/client/components/app/index.js +4 -0
  22. package/core/client/components/chart/KDataTable.vue +40 -25
  23. package/core/client/components/chart/KTimeSeriesChart.vue +20 -12
  24. package/core/client/components/collection/KCard.vue +1 -1
  25. package/core/client/components/collection/KCardSection.vue +3 -2
  26. package/core/client/components/collection/KColumn.vue +1 -1
  27. package/core/client/components/collection/KFilter.vue +6 -1
  28. package/core/client/components/document/KDocument.vue +83 -0
  29. package/core/client/components/document/KHtml.vue +23 -0
  30. package/core/client/components/document/KMarkdown.vue +37 -0
  31. package/core/client/components/document/index.js +9 -0
  32. package/core/client/components/form/KForm.vue +6 -2
  33. package/core/client/components/form/KSelectField.vue +1 -1
  34. package/core/client/components/index.js +1 -4
  35. package/core/client/components/input/KOptionsChooser.vue +1 -1
  36. package/core/client/components/layout/KFab.vue +1 -1
  37. package/core/client/components/layout/KPage.vue +3 -2
  38. package/core/client/components/layout/KWindow.vue +1 -1
  39. package/core/client/components/media/KColorScale.vue +16 -6
  40. package/core/client/components/screen/KLoginScreen.vue +1 -1
  41. package/core/client/components/screen/KRegisterScreen.vue +1 -1
  42. package/core/client/components/team/KAddMember.vue +7 -7
  43. package/core/client/components/team/KGroupCard.vue +1 -1
  44. package/core/client/components/team/KMemberFilter.vue +1 -1
  45. package/core/client/components/team/KTagCard.vue +1 -1
  46. package/core/client/components/time/KRelativeTimeRanges.vue +16 -1
  47. package/core/client/components/time/KTimeControl.vue +1 -0
  48. package/core/client/components/tool/KExportTool.vue +1 -1
  49. package/core/client/composables/collection.js +1 -1
  50. package/core/client/composables/index.js +1 -0
  51. package/core/client/composables/layout.js +50 -0
  52. package/core/client/composables/session.js +6 -0
  53. package/core/client/filter.js +9 -6
  54. package/core/client/guards.js +29 -6
  55. package/core/client/i18n/core_en.json +4 -1
  56. package/core/client/i18n/core_fr.json +8 -5
  57. package/core/client/i18n.js +14 -0
  58. package/core/client/layout.js +25 -14
  59. package/core/client/mixins/mixin.base-activity.js +16 -0
  60. package/core/client/services/index.js +27 -26
  61. package/core/client/services/local-settings.service.js +2 -3
  62. package/core/client/units.js +6 -1
  63. package/core/client/utils/index.js +3 -0
  64. package/core/client/utils/utils.actions.js +93 -0
  65. package/core/client/utils/utils.colors.js +1 -1
  66. package/core/client/utils/utils.data.js +22 -0
  67. package/core/client/utils/utils.shapes.js +16 -6
  68. package/coverage/base.css +224 -0
  69. package/coverage/block-navigation.js +87 -0
  70. package/coverage/core/api/application.js.html +1870 -0
  71. package/coverage/core/api/authentication.js.html +742 -0
  72. package/coverage/core/api/db.js.html +778 -0
  73. package/coverage/core/api/hooks/hooks.authentication.js.html +313 -0
  74. package/coverage/core/api/hooks/hooks.authorisations.js.html +1243 -0
  75. package/coverage/core/api/hooks/hooks.groups.js.html +229 -0
  76. package/coverage/core/api/hooks/hooks.logger.js.html +163 -0
  77. package/coverage/core/api/hooks/hooks.model.js.html +955 -0
  78. package/coverage/core/api/hooks/hooks.organisations.js.html +541 -0
  79. package/coverage/core/api/hooks/hooks.push.js.html +253 -0
  80. package/coverage/core/api/hooks/hooks.query.js.html +862 -0
  81. package/coverage/core/api/hooks/hooks.schemas.js.html +304 -0
  82. package/coverage/core/api/hooks/hooks.service.js.html +319 -0
  83. package/coverage/core/api/hooks/hooks.storage.js.html +193 -0
  84. package/coverage/core/api/hooks/hooks.users.js.html +868 -0
  85. package/coverage/core/api/hooks/index.html +296 -0
  86. package/coverage/core/api/hooks/index.js.html +121 -0
  87. package/coverage/core/api/index.html +191 -0
  88. package/coverage/core/api/index.js.html +148 -0
  89. package/coverage/core/api/marshall.js.html +448 -0
  90. package/coverage/core/api/models/groups.model.mongodb.js.html +109 -0
  91. package/coverage/core/api/models/index.html +161 -0
  92. package/coverage/core/api/models/organisations.model.mongodb.js.html +94 -0
  93. package/coverage/core/api/models/tags.model.mongodb.js.html +115 -0
  94. package/coverage/core/api/models/users.model.mongodb.js.html +115 -0
  95. package/coverage/core/api/services/account/account.hooks.js.html +208 -0
  96. package/coverage/core/api/services/account/account.service.js.html +436 -0
  97. package/coverage/core/api/services/account/index.html +131 -0
  98. package/coverage/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  99. package/coverage/core/api/services/authorisations/authorisations.service.js.html +502 -0
  100. package/coverage/core/api/services/authorisations/index.html +131 -0
  101. package/coverage/core/api/services/databases/databases.hooks.js.html +193 -0
  102. package/coverage/core/api/services/databases/databases.service.js.html +100 -0
  103. package/coverage/core/api/services/databases/index.html +131 -0
  104. package/coverage/core/api/services/groups/groups.hooks.js.html +178 -0
  105. package/coverage/core/api/services/groups/index.html +116 -0
  106. package/coverage/core/api/services/import-export/import-export.hooks.js.html +184 -0
  107. package/coverage/core/api/services/import-export/import-export.service.js.html +118 -0
  108. package/coverage/core/api/services/import-export/index.html +131 -0
  109. package/coverage/core/api/services/index.html +116 -0
  110. package/coverage/core/api/services/index.js.html +499 -0
  111. package/coverage/core/api/services/mailer/index.html +131 -0
  112. package/coverage/core/api/services/mailer/mailer.hooks.js.html +190 -0
  113. package/coverage/core/api/services/mailer/mailer.service.js.html +118 -0
  114. package/coverage/core/api/services/organisations/index.html +131 -0
  115. package/coverage/core/api/services/organisations/organisations.hooks.js.html +178 -0
  116. package/coverage/core/api/services/organisations/organisations.service.js.html +343 -0
  117. package/coverage/core/api/services/push/index.html +131 -0
  118. package/coverage/core/api/services/push/push.hooks.js.html +190 -0
  119. package/coverage/core/api/services/push/push.service.js.html +121 -0
  120. package/coverage/core/api/services/storage/index.html +131 -0
  121. package/coverage/core/api/services/storage/storage.hooks.js.html +190 -0
  122. package/coverage/core/api/services/storage/storage.service.js.html +172 -0
  123. package/coverage/core/api/services/tags/index.html +116 -0
  124. package/coverage/core/api/services/tags/tags.hooks.js.html +178 -0
  125. package/coverage/core/api/services/users/index.html +116 -0
  126. package/coverage/core/api/services/users/users.hooks.js.html +307 -0
  127. package/coverage/core/api/utils.js.html +118 -0
  128. package/coverage/core/common/errors.js.html +88 -0
  129. package/coverage/core/common/index.html +176 -0
  130. package/coverage/core/common/index.js.html +115 -0
  131. package/coverage/core/common/permissions.js.html +1048 -0
  132. package/coverage/core/common/schema.js.html +190 -0
  133. package/coverage/core/common/utils.js.html +220 -0
  134. package/coverage/favicon.png +0 -0
  135. package/coverage/index.html +491 -0
  136. package/coverage/lcov-report/base.css +224 -0
  137. package/coverage/lcov-report/block-navigation.js +87 -0
  138. package/coverage/lcov-report/core/api/application.js.html +1870 -0
  139. package/coverage/lcov-report/core/api/authentication.js.html +742 -0
  140. package/coverage/lcov-report/core/api/db.js.html +778 -0
  141. package/coverage/lcov-report/core/api/hooks/hooks.authentication.js.html +313 -0
  142. package/coverage/lcov-report/core/api/hooks/hooks.authorisations.js.html +1243 -0
  143. package/coverage/lcov-report/core/api/hooks/hooks.groups.js.html +229 -0
  144. package/coverage/lcov-report/core/api/hooks/hooks.logger.js.html +163 -0
  145. package/coverage/lcov-report/core/api/hooks/hooks.model.js.html +955 -0
  146. package/coverage/lcov-report/core/api/hooks/hooks.organisations.js.html +541 -0
  147. package/coverage/lcov-report/core/api/hooks/hooks.push.js.html +253 -0
  148. package/coverage/lcov-report/core/api/hooks/hooks.query.js.html +862 -0
  149. package/coverage/lcov-report/core/api/hooks/hooks.schemas.js.html +304 -0
  150. package/coverage/lcov-report/core/api/hooks/hooks.service.js.html +319 -0
  151. package/coverage/lcov-report/core/api/hooks/hooks.storage.js.html +193 -0
  152. package/coverage/lcov-report/core/api/hooks/hooks.users.js.html +868 -0
  153. package/coverage/lcov-report/core/api/hooks/index.html +296 -0
  154. package/coverage/lcov-report/core/api/hooks/index.js.html +121 -0
  155. package/coverage/lcov-report/core/api/index.html +191 -0
  156. package/coverage/lcov-report/core/api/index.js.html +148 -0
  157. package/coverage/lcov-report/core/api/marshall.js.html +448 -0
  158. package/coverage/lcov-report/core/api/models/groups.model.mongodb.js.html +109 -0
  159. package/coverage/lcov-report/core/api/models/index.html +161 -0
  160. package/coverage/lcov-report/core/api/models/organisations.model.mongodb.js.html +94 -0
  161. package/coverage/lcov-report/core/api/models/tags.model.mongodb.js.html +115 -0
  162. package/coverage/lcov-report/core/api/models/users.model.mongodb.js.html +115 -0
  163. package/coverage/lcov-report/core/api/services/account/account.hooks.js.html +208 -0
  164. package/coverage/lcov-report/core/api/services/account/account.service.js.html +436 -0
  165. package/coverage/lcov-report/core/api/services/account/index.html +131 -0
  166. package/coverage/lcov-report/core/api/services/authorisations/authorisations.hooks.js.html +184 -0
  167. package/coverage/lcov-report/core/api/services/authorisations/authorisations.service.js.html +502 -0
  168. package/coverage/lcov-report/core/api/services/authorisations/index.html +131 -0
  169. package/coverage/lcov-report/core/api/services/databases/databases.hooks.js.html +193 -0
  170. package/coverage/lcov-report/core/api/services/databases/databases.service.js.html +100 -0
  171. package/coverage/lcov-report/core/api/services/databases/index.html +131 -0
  172. package/coverage/lcov-report/core/api/services/groups/groups.hooks.js.html +178 -0
  173. package/coverage/lcov-report/core/api/services/groups/index.html +116 -0
  174. package/coverage/lcov-report/core/api/services/import-export/import-export.hooks.js.html +184 -0
  175. package/coverage/lcov-report/core/api/services/import-export/import-export.service.js.html +118 -0
  176. package/coverage/lcov-report/core/api/services/import-export/index.html +131 -0
  177. package/coverage/lcov-report/core/api/services/index.html +116 -0
  178. package/coverage/lcov-report/core/api/services/index.js.html +499 -0
  179. package/coverage/lcov-report/core/api/services/mailer/index.html +131 -0
  180. package/coverage/lcov-report/core/api/services/mailer/mailer.hooks.js.html +190 -0
  181. package/coverage/lcov-report/core/api/services/mailer/mailer.service.js.html +118 -0
  182. package/coverage/lcov-report/core/api/services/organisations/index.html +131 -0
  183. package/coverage/lcov-report/core/api/services/organisations/organisations.hooks.js.html +178 -0
  184. package/coverage/lcov-report/core/api/services/organisations/organisations.service.js.html +343 -0
  185. package/coverage/lcov-report/core/api/services/push/index.html +131 -0
  186. package/coverage/lcov-report/core/api/services/push/push.hooks.js.html +190 -0
  187. package/coverage/lcov-report/core/api/services/push/push.service.js.html +121 -0
  188. package/coverage/lcov-report/core/api/services/storage/index.html +131 -0
  189. package/coverage/lcov-report/core/api/services/storage/storage.hooks.js.html +190 -0
  190. package/coverage/lcov-report/core/api/services/storage/storage.service.js.html +172 -0
  191. package/coverage/lcov-report/core/api/services/tags/index.html +116 -0
  192. package/coverage/lcov-report/core/api/services/tags/tags.hooks.js.html +178 -0
  193. package/coverage/lcov-report/core/api/services/users/index.html +116 -0
  194. package/coverage/lcov-report/core/api/services/users/users.hooks.js.html +307 -0
  195. package/coverage/lcov-report/core/api/utils.js.html +118 -0
  196. package/coverage/lcov-report/core/common/errors.js.html +88 -0
  197. package/coverage/lcov-report/core/common/index.html +176 -0
  198. package/coverage/lcov-report/core/common/index.js.html +115 -0
  199. package/coverage/lcov-report/core/common/permissions.js.html +1048 -0
  200. package/coverage/lcov-report/core/common/schema.js.html +190 -0
  201. package/coverage/lcov-report/core/common/utils.js.html +220 -0
  202. package/coverage/lcov-report/favicon.png +0 -0
  203. package/coverage/lcov-report/index.html +491 -0
  204. package/coverage/lcov-report/map/api/hooks/hooks.catalog.js.html +457 -0
  205. package/coverage/lcov-report/map/api/hooks/hooks.features.js.html +397 -0
  206. package/coverage/lcov-report/map/api/hooks/hooks.query.js.html +1309 -0
  207. package/coverage/lcov-report/map/api/hooks/index.html +161 -0
  208. package/coverage/lcov-report/map/api/hooks/index.js.html +94 -0
  209. package/coverage/lcov-report/map/api/index.html +131 -0
  210. package/coverage/lcov-report/map/api/index.js.html +139 -0
  211. package/coverage/lcov-report/map/api/marshall.js.html +178 -0
  212. package/coverage/lcov-report/map/api/models/alerts.model.mongodb.js.html +106 -0
  213. package/coverage/lcov-report/map/api/models/catalog.model.mongodb.js.html +127 -0
  214. package/coverage/lcov-report/map/api/models/features.model.mongodb.js.html +196 -0
  215. package/coverage/lcov-report/map/api/models/index.html +161 -0
  216. package/coverage/lcov-report/map/api/models/projects.model.mongodb.js.html +109 -0
  217. package/coverage/lcov-report/map/api/services/alerts/alerts.hooks.js.html +274 -0
  218. package/coverage/lcov-report/map/api/services/alerts/alerts.service.js.html +610 -0
  219. package/coverage/lcov-report/map/api/services/alerts/index.html +131 -0
  220. package/coverage/lcov-report/map/api/services/catalog/catalog.hooks.js.html +316 -0
  221. package/coverage/lcov-report/map/api/services/catalog/index.html +116 -0
  222. package/coverage/lcov-report/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  223. package/coverage/lcov-report/map/api/services/daptiles/index.html +116 -0
  224. package/coverage/lcov-report/map/api/services/features/features.hooks.js.html +241 -0
  225. package/coverage/lcov-report/map/api/services/features/features.service.js.html +241 -0
  226. package/coverage/lcov-report/map/api/services/features/index.html +131 -0
  227. package/coverage/lcov-report/map/api/services/index.html +116 -0
  228. package/coverage/lcov-report/map/api/services/index.js.html +817 -0
  229. package/coverage/lcov-report/map/api/services/projects/index.html +116 -0
  230. package/coverage/lcov-report/map/api/services/projects/projects.hooks.js.html +439 -0
  231. package/coverage/lcov-report/map/common/dynamic-grid-source.js.html +466 -0
  232. package/coverage/lcov-report/map/common/errors.js.html +94 -0
  233. package/coverage/lcov-report/map/common/geotiff-grid-source.js.html +541 -0
  234. package/coverage/lcov-report/map/common/grid.js.html +1612 -0
  235. package/coverage/lcov-report/map/common/index.html +371 -0
  236. package/coverage/lcov-report/map/common/index.js.html +172 -0
  237. package/coverage/lcov-report/map/common/meteo-model-grid-source.js.html +556 -0
  238. package/coverage/lcov-report/map/common/moment-utils.js.html +157 -0
  239. package/coverage/lcov-report/map/common/opendap-grid-source.js.html +868 -0
  240. package/coverage/lcov-report/map/common/opendap-utils.js.html +826 -0
  241. package/coverage/lcov-report/map/common/permissions.js.html +124 -0
  242. package/coverage/lcov-report/map/common/time-based-grid-source.js.html +418 -0
  243. package/coverage/lcov-report/map/common/tms-utils.js.html +274 -0
  244. package/coverage/lcov-report/map/common/wcs-grid-source.js.html +364 -0
  245. package/coverage/lcov-report/map/common/wcs-utils.js.html +586 -0
  246. package/coverage/lcov-report/map/common/weacast-grid-source.js.html +1033 -0
  247. package/coverage/lcov-report/map/common/wfs-utils.js.html +574 -0
  248. package/coverage/lcov-report/map/common/wms-utils.js.html +451 -0
  249. package/coverage/lcov-report/map/common/wmts-utils.js.html +547 -0
  250. package/coverage/lcov-report/prettify.css +1 -0
  251. package/coverage/lcov-report/prettify.js +2 -0
  252. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  253. package/coverage/lcov-report/sorter.js +196 -0
  254. package/coverage/lcov.info +11128 -0
  255. package/coverage/map/api/hooks/hooks.catalog.js.html +457 -0
  256. package/coverage/map/api/hooks/hooks.features.js.html +397 -0
  257. package/coverage/map/api/hooks/hooks.query.js.html +1309 -0
  258. package/coverage/map/api/hooks/index.html +161 -0
  259. package/coverage/map/api/hooks/index.js.html +94 -0
  260. package/coverage/map/api/index.html +131 -0
  261. package/coverage/map/api/index.js.html +139 -0
  262. package/coverage/map/api/marshall.js.html +178 -0
  263. package/coverage/map/api/models/alerts.model.mongodb.js.html +106 -0
  264. package/coverage/map/api/models/catalog.model.mongodb.js.html +127 -0
  265. package/coverage/map/api/models/features.model.mongodb.js.html +196 -0
  266. package/coverage/map/api/models/index.html +161 -0
  267. package/coverage/map/api/models/projects.model.mongodb.js.html +109 -0
  268. package/coverage/map/api/services/alerts/alerts.hooks.js.html +274 -0
  269. package/coverage/map/api/services/alerts/alerts.service.js.html +610 -0
  270. package/coverage/map/api/services/alerts/index.html +131 -0
  271. package/coverage/map/api/services/catalog/catalog.hooks.js.html +316 -0
  272. package/coverage/map/api/services/catalog/index.html +116 -0
  273. package/coverage/map/api/services/daptiles/daptiles.service.js.html +1510 -0
  274. package/coverage/map/api/services/daptiles/index.html +116 -0
  275. package/coverage/map/api/services/features/features.hooks.js.html +241 -0
  276. package/coverage/map/api/services/features/features.service.js.html +241 -0
  277. package/coverage/map/api/services/features/index.html +131 -0
  278. package/coverage/map/api/services/index.html +116 -0
  279. package/coverage/map/api/services/index.js.html +817 -0
  280. package/coverage/map/api/services/projects/index.html +116 -0
  281. package/coverage/map/api/services/projects/projects.hooks.js.html +439 -0
  282. package/coverage/map/common/dynamic-grid-source.js.html +466 -0
  283. package/coverage/map/common/errors.js.html +94 -0
  284. package/coverage/map/common/geotiff-grid-source.js.html +541 -0
  285. package/coverage/map/common/grid.js.html +1612 -0
  286. package/coverage/map/common/index.html +371 -0
  287. package/coverage/map/common/index.js.html +172 -0
  288. package/coverage/map/common/meteo-model-grid-source.js.html +556 -0
  289. package/coverage/map/common/moment-utils.js.html +157 -0
  290. package/coverage/map/common/opendap-grid-source.js.html +868 -0
  291. package/coverage/map/common/opendap-utils.js.html +826 -0
  292. package/coverage/map/common/permissions.js.html +124 -0
  293. package/coverage/map/common/time-based-grid-source.js.html +418 -0
  294. package/coverage/map/common/tms-utils.js.html +274 -0
  295. package/coverage/map/common/wcs-grid-source.js.html +364 -0
  296. package/coverage/map/common/wcs-utils.js.html +586 -0
  297. package/coverage/map/common/weacast-grid-source.js.html +1033 -0
  298. package/coverage/map/common/wfs-utils.js.html +574 -0
  299. package/coverage/map/common/wms-utils.js.html +451 -0
  300. package/coverage/map/common/wmts-utils.js.html +547 -0
  301. package/coverage/prettify.css +1 -0
  302. package/coverage/prettify.js +2 -0
  303. package/coverage/sort-arrow-sprite.png +0 -0
  304. package/coverage/sorter.js +196 -0
  305. package/coverage/tmp/coverage-137435-1719398750767-0.json +1 -0
  306. package/coverage/tmp/coverage-137447-1719398750752-0.json +1 -0
  307. package/coverage/tmp/coverage-137458-1719398750740-0.json +1 -0
  308. package/coverage/tmp/coverage-137470-1719398750728-0.json +1 -0
  309. package/coverage/tmp/coverage-137477-1719398750691-0.json +1 -0
  310. package/map/api/hooks/hooks.query.js +5 -2
  311. package/map/api/services/catalog/catalog.hooks.js +4 -5
  312. package/map/client/cesium/utils/index.js +2 -1
  313. package/map/client/cesium/utils/utils.cesium.js +8 -0
  314. package/map/client/cesium/utils/utils.features.js +2 -2
  315. package/map/client/cesium/utils/utils.style.js +19 -17
  316. package/map/client/components/KCompass.vue +25 -3
  317. package/map/client/components/KEditLayerData.vue +1 -1
  318. package/map/client/components/KPositionIndicator.vue +1 -1
  319. package/map/client/components/catalog/KConnectLayer.vue +2 -2
  320. package/map/client/components/catalog/KCreateView.vue +2 -2
  321. package/map/client/components/form/KDirectionField.vue +4 -0
  322. package/map/client/components/form/KOwsLayerField.vue +4 -4
  323. package/map/client/components/form/KOwsServiceField.vue +3 -4
  324. package/map/client/components/legend/KLegend.vue +13 -15
  325. package/map/client/components/tools/KGeolocateTool.vue +1 -1
  326. package/map/client/components/widget/KStackableTimeSeries.vue +3 -0
  327. package/map/client/composables/highlight.js +4 -1
  328. package/map/client/elevation-utils.js +2 -2
  329. package/map/client/i18n/map_en.json +3 -1
  330. package/map/client/i18n/map_fr.json +3 -1
  331. package/map/client/mixins/globe/mixin.base-globe.js +121 -80
  332. package/map/client/mixins/globe/mixin.file-layers.js +2 -2
  333. package/map/client/mixins/globe/mixin.geojson-layers.js +24 -19
  334. package/map/client/mixins/globe/mixin.globe-activity.js +3 -3
  335. package/map/client/mixins/globe/mixin.opendap-layers.js +3 -3
  336. package/map/client/mixins/globe/mixin.style.js +5 -5
  337. package/map/client/mixins/globe/mixin.tooltip.js +5 -3
  338. package/map/client/mixins/map/mixin.base-map.js +42 -4
  339. package/map/client/mixins/map/mixin.canvas-layers.js +0 -1
  340. package/map/client/mixins/map/mixin.geojson-layers.js +10 -5
  341. package/map/client/mixins/mixin.activity.js +2 -2
  342. package/map/client/mixins/mixin.feature-selection.js +7 -5
  343. package/map/client/mixins/mixin.levels.js +1 -1
  344. package/map/client/utils/utils.catalog.js +15 -0
  345. package/map/client/utils/utils.location.js +2 -1
  346. package/map/client/utils/utils.style.js +1 -1
  347. package/map/common/geotiff-grid-source.js +5 -3
  348. package/map/common/grid.js +2 -2
  349. package/map/common/meteo-model-grid-source.js +1 -1
  350. package/map/common/time-based-grid-source.js +1 -1
  351. package/map/common/wmts-utils.js +11 -11
  352. package/package.json +12 -8
  353. package/scripts/build_docs.sh +37 -0
  354. package/scripts/init_runner.sh +30 -0
  355. package/scripts/kash/.github/workflows/run_tests.yaml +33 -0
  356. package/scripts/kash/README.md +2 -0
  357. package/scripts/kash/kash.sh +1657 -0
  358. package/scripts/kash/scripts/run_tests.sh +151 -0
  359. package/scripts/run_tests.sh +48 -0
  360. package/scripts/setup_workspace.sh +42 -0
  361. package/test/api/core/hooks.test.js +31 -0
  362. package/test/api/core/test-log-2023-12-19.log +7 -0
  363. package/test/api/core/test-log-2024-01-04.log +14 -0
  364. package/test/api/core/test-log-2024-05-14.log +6 -0
  365. package/test/api/core/test-log-2024-06-06.log +23 -0
  366. package/test/api/core/test-log-2024-06-26.log +25 -0
  367. package/test/api/core/test-log-2024-06-28.log +2 -0
  368. package/test/api/map/grid-sources.test.js +3 -1
  369. package/test/api/map/hooks.test.js +58 -12
  370. package/test/api/map/test-log-2023-11-24.log +121 -0
  371. package/test/api/map/test-log-2023-12-12.log +29 -0
  372. package/test/api/map/test-log-2023-12-13.log +5 -0
  373. package/test/api/map/test-log-2024-01-04.log +2 -0
  374. package/test/api/map/test-log-2024-01-11.log +1 -0
  375. package/test/api/map/test-log-2024-01-25.log +19 -0
  376. package/test/api/map/test-log-2024-06-06.log +39 -0
  377. package/test/client/core/collection.js +2 -2
  378. package/test/client/core/dialogs.js +13 -0
  379. package/test/client/core/index.js +6 -5
  380. package/test/client/core/layout.js +1 -13
  381. package/test/client/core/runner.js +41 -20
  382. package/test/client/core/screens.js +6 -0
  383. package/test/client/core/utils.js +23 -19
  384. package/.travis.doc.sh +0 -8
  385. package/.travis.test.sh +0 -72
  386. package/core/client/components/KAction.vue +0 -393
  387. package/core/client/components/KBlock.vue +0 -67
  388. package/core/client/components/app/KTerms.vue +0 -41
@@ -0,0 +1,29 @@
1
+ {"level":"info","message":"Logger configured"}
2
+ {"level":"info","message":"Initializing weacast-gfs plugin"}
3
+ {"level":"info","message":"Initializing gfs-world forecast"}
4
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/u-wind"}
5
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/v-wind"}
6
+ {"level":"info","message":"Completed forecast data update on gfs-world/u-wind"}
7
+ {"level":"info","message":"Completed forecast data update on gfs-world/v-wind"}
8
+ {"level":"error","message":"Cannot check alert 65780ebfb5b3a128d6297727 as target probes service is not available"}
9
+ {"level":"error","message":"Cannot check alert 65780ebfb5b3a128d6297727 as target probes service is not available"}
10
+ {"level":"error","message":"error: api/probes - Method: create: [object Object]"}
11
+ {"level":"error","message":"[object Object]"}
12
+ {"level":"error","message":"error: api/alerts - Method: create: error.toJSON is not a function"}
13
+ {"level":"error","message":"error: api/alerts - Method: remove: No record found for id '65780ebfb5b3a128d6297727'"}
14
+ {"level":"error","message":"Cannot check alert 65780eceb5b3a128d6297729 as no data is available for gfs-world"}
15
+ {"level":"error","message":"Cannot check alert 65780eceb5b3a128d6297c6c as no data is available for features service vigicrues-observations"}
16
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
17
+ {"level":"info","message":"Logger configured"}
18
+ {"level":"error","message":"error: api/catalog - Method: remove: Cannot read properties of null (reading 'find')"}
19
+ {"level":"error","message":"error: api/catalog - Method: remove: Cannot read properties of null (reading 'find')"}
20
+ {"level":"error","message":"error: api/users - Method: create: E11000 duplicate key error collection: kdk-test.users index: email_1 dup key: { email: \"test-user@test.org\" }"}
21
+ {"level":"error","message":"error: api/catalog - Method: create: E11000 duplicate key error collection: kdk-test.catalog index: name-type-en collation: { locale: \"en\", caseLevel: false, caseFirst: \"off\", strength: 1, numericOrdering: false, alternate: \"non-ignorable\", maxVariable: \"punct\", normalization: false, backwards: false, version: \"57.1\" } dup key: { name: \"0x533935392d4b51314d050e4d4f294f3945434d\", type: \"0x4553314b3f29593f2959314b\" }"}
22
+ {"level":"error","message":"error: api/users - Method: create: E11000 duplicate key error collection: kdk-test.users index: email_1 dup key: { email: \"test-user@test.org\" }"}
23
+ {"level":"error","message":"error: api/catalog - Method: create: E11000 duplicate key error collection: kdk-test.catalog index: name-type-en collation: { locale: \"en\", caseLevel: false, caseFirst: \"off\", strength: 1, numericOrdering: false, alternate: \"non-ignorable\", maxVariable: \"punct\", normalization: false, backwards: false, version: \"57.1\" } dup key: { name: \"0x533935392d4b51314d050e4d4f294f3945434d\", type: \"0x4553314b3f29593f2959314b\" }"}
24
+ {"level":"error","message":"error: api/users - Method: create: E11000 duplicate key error collection: kdk-test.users index: email_1 dup key: { email: \"test-user@test.org\" }"}
25
+ {"level":"error","message":"error: api/catalog - Method: create: E11000 duplicate key error collection: kdk-test.catalog index: name-type-en collation: { locale: \"en\", caseLevel: false, caseFirst: \"off\", strength: 1, numericOrdering: false, alternate: \"non-ignorable\", maxVariable: \"punct\", normalization: false, backwards: false, version: \"57.1\" } dup key: { name: \"0x533935392d4b51314d050e4d4f294f3945434d\", type: \"0x4553314b3f29593f2959314b\" }"}
26
+ {"level":"error","message":"error: api/zones - Method: find: weast is not defined"}
27
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: weast is not defined"}
28
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: can't parse extra field: crs: { type: \"name\", properties: { name: \"urn:x-mongodb:crs:strictwinding:EPSG:4326\" } }"}
29
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: Cannot convert undefined or null to object"}
@@ -0,0 +1,5 @@
1
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: Assignment to constant variable."}
2
+ {"level":"error","message":"error: api/zones - Method: find: weast is not defined"}
3
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: weast is not defined"}
4
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: unknown operator: $or"}
5
+ {"level":"error","message":"error: api/vigicrues-stations - Method: find: unknown operator: $or"}
@@ -0,0 +1,2 @@
1
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
2
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
@@ -0,0 +1 @@
1
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
@@ -0,0 +1,19 @@
1
+ {"level":"info","message":"Logger configured"}
2
+ {"level":"info","message":"Initializing weacast-gfs plugin"}
3
+ {"level":"info","message":"Initializing gfs-world forecast"}
4
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/u-wind"}
5
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/v-wind"}
6
+ {"level":"info","message":"Completed forecast data update on gfs-world/u-wind"}
7
+ {"level":"info","message":"Completed forecast data update on gfs-world/v-wind"}
8
+ {"level":"error","message":"Cannot check alert 65b23e9b0c441d5b46ac6f77 as target probes service is not available"}
9
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
10
+ {"level":"error","message":"Cannot check alert 65b23e9b0c441d5b46ac6f78 as target probes service is not available"}
11
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
12
+ {"level":"error","message":"Cannot check alert 65b23e9b0c441d5b46ac6f79 as target probes service is not available"}
13
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
14
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
15
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
16
+ {"level":"error","message":"Cannot check alert 65b23e9b0c441d5b46ac74bc as no data is available for features service vigicrues-observations"}
17
+ {"level":"error","message":"error: api/alerts - Method: create: Not Found"}
18
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
19
+ {"level":"info","message":"Logger configured"}
@@ -0,0 +1,39 @@
1
+ {"level":"info","message":"Logger configured"}
2
+ {"level":"info","message":"Initializing weacast-gfs plugin"}
3
+ {"level":"info","message":"Initializing gfs-world forecast"}
4
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/u-wind"}
5
+ {"level":"info","message":"Checking for up-to-date forecast data on gfs-world/v-wind"}
6
+ {"level":"error","message":"Could not update gfs-world/v-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T06:00:00Z"}
7
+ {"level":"error","message":"Could not download gfs-world/v-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T06:00:00Z, provider responded with HTTP code 302"}
8
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T06:00:00Z"}
9
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T06:00:00Z, provider responded with HTTP code 302"}
10
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T00:00:00Z"}
11
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-06T00:00:00Z, provider responded with HTTP code 302"}
12
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-05T18:00:00Z"}
13
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-05T18:00:00Z, provider responded with HTTP code 302"}
14
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-05T12:00:00Z"}
15
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T06:00:00Z for run 2024-06-05T12:00:00Z, provider responded with HTTP code 302"}
16
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T06:00:00Z"}
17
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T06:00:00Z, provider responded with HTTP code 302"}
18
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T00:00:00Z"}
19
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T00:00:00Z, provider responded with HTTP code 302"}
20
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T18:00:00Z"}
21
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T18:00:00Z, provider responded with HTTP code 302"}
22
+ {"level":"error","message":"Could not update gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T12:00:00Z"}
23
+ {"level":"error","message":"Could not download gfs-world/u-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T12:00:00Z, provider responded with HTTP code 302"}
24
+ {"level":"info","message":"Completed forecast data update on gfs-world/u-wind"}
25
+ {"level":"error","message":"Could not update gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T06:00:00Z"}
26
+ {"level":"error","message":"Could not download gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T06:00:00Z, provider responded with HTTP code 302"}
27
+ {"level":"error","message":"Could not update gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T00:00:00Z"}
28
+ {"level":"error","message":"Could not download gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-06T00:00:00Z, provider responded with HTTP code 302"}
29
+ {"level":"error","message":"Could not update gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T18:00:00Z"}
30
+ {"level":"error","message":"Could not download gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T18:00:00Z, provider responded with HTTP code 302"}
31
+ {"level":"error","message":"Could not update gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T12:00:00Z"}
32
+ {"level":"error","message":"Could not download gfs-world/v-wind forecast at 2024-06-06T09:00:00Z for run 2024-06-05T12:00:00Z, provider responded with HTTP code 302"}
33
+ {"level":"info","message":"Completed forecast data update on gfs-world/v-wind"}
34
+ {"level":"error","message":"Cannot check alert 66616846c02f915fbfc94e05 as target probes service is not available"}
35
+ {"level":"error","message":"Cannot check alert 66616846c02f915fbfc94e05 as target probes service is not available"}
36
+ {"level":"error","message":"Cannot check alert 66616864c02f915fbfc94e07 as no data is available for gfs-world"}
37
+ {"level":"error","message":"Cannot check alert 66616883c02f915fbfc9534a as no data is available for features service vigicrues-observations"}
38
+ {"level":"error","message":"error: api/catalog - Method: create: Object with name equals to dummy already exist for service catalog"}
39
+ {"level":"info","message":"Logger configured"}
@@ -19,7 +19,7 @@ export async function itemActionExists (page, component, name, action) {
19
19
  return elements.length === 1
20
20
  }
21
21
 
22
- export async function clickItem (page, component, name, wait = 250) {
22
+ export async function clickItem (page, component, name, wait = 500) {
23
23
  const xpath = `//div[contains(@component, "${component}") and contains(., "${name}")]`
24
24
  const elements = await page.$x(xpath)
25
25
  if (elements.length > 0) {
@@ -31,7 +31,7 @@ export async function clickItem (page, component, name, wait = 250) {
31
31
  }
32
32
  }
33
33
 
34
- export async function clickItemAction (page, component, name, action, wait = 250) {
34
+ export async function clickItemAction (page, component, name, action, wait = 500) {
35
35
  const xpath = `//div[contains(@component, "${component}") and contains(., "${name}")]//button[@id="${action}"]`
36
36
  const elements = await page.$x(xpath)
37
37
  if (elements.length > 0) {
@@ -0,0 +1,13 @@
1
+ import { click, isElementVisible } from './utils.js'
2
+
3
+ export async function closeWelcomeDialog (page) {
4
+ await click(page, '.q-dialog #close-button')
5
+ }
6
+
7
+ export async function closeInstallDialog (page) {
8
+ await click(page, '.q-dialog #ignore-button')
9
+ }
10
+
11
+ export async function isToastVisible (page) {
12
+ return isElementVisible(page, '[role="alert"]')
13
+ }
@@ -1,8 +1,9 @@
1
- export * from './runner.js'
2
- export * from './utils.js'
3
- export * from './api.js'
4
- export * from './screens.js'
5
- export * from './layout.js'
6
1
  export * from './account.js'
2
+ export * from './api.js'
7
3
  export * from './collection.js'
4
+ export * from './dialogs.js'
5
+ export * from './layout.js'
6
+ export * from './runner.js'
7
+ export * from './screens.js'
8
8
  export * from './time.js'
9
+ export * from './utils.js'
@@ -1,5 +1,5 @@
1
1
  import makeDebug from 'debug'
2
- import { countElements, click, clickAction, isElementVisible, isActionVisible } from './utils.js'
2
+ import { countElements, clickAction, isElementVisible, isActionVisible } from './utils.js'
3
3
 
4
4
  const debug = makeDebug('kdk:core:test:layout')
5
5
 
@@ -118,18 +118,6 @@ export async function countFabActions (page) {
118
118
  return countElements(page, '//a[contains(@class, "k-action-fab-action")]')
119
119
  }
120
120
 
121
- export async function closeWelcomeDialog (page) {
122
- await click(page, '.q-dialog #close-button')
123
- }
124
-
125
- export async function closeInstallDialog (page) {
126
- await click(page, '.q-dialog #ignore-button')
127
- }
128
-
129
- export async function isToastVisible (page) {
130
- return isElementVisible(page, '[role="alert"]')
131
- }
132
-
133
121
  export async function logout (page) {
134
122
  await clickPaneAction(page, 'left', 'logout', 1000)
135
123
  }
@@ -1,6 +1,7 @@
1
1
  import _ from 'lodash'
2
2
  import fs from 'fs'
3
3
  import path from 'path'
4
+ import png from 'pngjs'
4
5
  import makeDebug from 'debug'
5
6
  import puppeteer from 'puppeteer'
6
7
  import { compareImages, GeolocationAccuracy } from './utils.js'
@@ -32,7 +33,7 @@ export class Runner {
32
33
  baseUrl: domain,
33
34
  browser: {
34
35
  product: defaultBrowser,
35
- headless: process.env.HEADLESS ? !!process.env.HEADLESS : false,
36
+ headless: process.env.HEADLESS ? (process.env.HEADLESS ? 'new' : false) : false,
36
37
  devtools: (process.env.NODE_ENV === 'development'),
37
38
  defaultViewport: {
38
39
  width: +process.env.VIEWPORT_WIDTH || 1024,
@@ -42,15 +43,19 @@ export class Runner {
42
43
  },
43
44
  dataDir: defaultDataDir,
44
45
  runDir: defaultRunDir,
45
- screenrefsDir: path.join(defaultDataDir, 'screenrefs'),
46
- screenshotsDir: path.join(defaultRunDir, '/screenshots'),
46
+ screenshots: {
47
+ dir: path.join(defaultRunDir, '/screenshots'),
48
+ screenrefsDir: path.join(defaultDataDir, 'screenrefs'),
49
+ matchThreshold: 0.1,
50
+ diffTolerance: 0.1,
51
+ writeDiffs: true
52
+ },
47
53
  // Could be:
48
54
  // - 'preview' to only run tests without comparing to reference screenshots
49
55
  // - 'run' to run tests by comparing to reference screenshots
50
56
  // - 'record' to run tests and update reference screenshots
51
57
  mode: process.env.TEST_MODE || 'run',
52
- writeDiffs: false,
53
- matchTreshold: 0.1,
58
+
54
59
  // Accuracy is required to get some desired behaviours
55
60
  geolocation: {
56
61
  accuracy: GeolocationAccuracy
@@ -60,9 +65,13 @@ export class Runner {
60
65
  console.log('Runner created with the following options:')
61
66
  console.log(this.options)
62
67
  // Create the run directory if needed
63
- if (!fs.existsSync(this.options.screenshotsDir)) {
68
+ if (!fs.existsSync(this.options.screenshots.dir)) {
64
69
  console.log('Creating runner directory structure')
65
- fs.mkdirSync(this.options.screenshotsDir, { recursive: true })
70
+ fs.mkdirSync(this.options.screenshots.dir, { recursive: true })
71
+ } else {
72
+ // Clear the directory
73
+ const files = fs.readdirSync(this.options.screenshots.dir)
74
+ for (const file of files) fs.unlinkSync(path.join(this.options.screenshots.dir, file))
66
75
  }
67
76
  }
68
77
 
@@ -122,6 +131,14 @@ export class Runner {
122
131
  this.errors.push(message)
123
132
  debug('Page error:', message)
124
133
  })
134
+ // Process the page language
135
+ await this.page.evaluateOnNewDocument((options) => {
136
+ Object.defineProperty(navigator, 'language', {
137
+ get: function () {
138
+ return _.get(options, 'lang', 'en-US')
139
+ }
140
+ })
141
+ }, this.options)
125
142
  // Navigate the to given url
126
143
  await this.page.goto(this.getUrl(path))
127
144
  return this.page
@@ -137,7 +154,7 @@ export class Runner {
137
154
  // In record mode erase current ref, otherwise skip capture in preview mode
138
155
  if ((this.options.mode !== 'run') && (this.options.mode !== 'record')) return
139
156
  // If run mode store in screenshots dir, otherwise in screenrefs dir
140
- const dir = (this.options.mode === 'run' ? this.options.screenshotsDir : this.options.screenrefsDir)
157
+ const dir = (this.options.mode === 'run' ? this.options.screenshots.dir : this.options.screenshots.screenrefsDir)
141
158
  const options = Object.assign(
142
159
  {
143
160
  path: path.join(dir, key + '.png'),
@@ -146,25 +163,29 @@ export class Runner {
146
163
  await this.page.screenshot(options)
147
164
  }
148
165
 
149
- async captureAndMatch (key, diffTolerance = 1.0, boundingBox = null) {
166
+ async captureAndMatch (key, boundingBox = null, tolerance = null) {
150
167
  await this.capture(key, boundingBox)
151
- // If run mode compare, otherwise skip as we only want to record screenrefs
152
- if (this.options.mode === 'run') {
153
- const runDir = path.join(this.options.screenshotsDir, key + '.png')
154
- const refPath = path.join(this.options.screenrefsDir, key + '.png')
155
- const diffFilename = this.options.writeDiffs ? path.join(this.options.screenshotsDir, `diff.${key}.png`) : null
156
- const diff = compareImages(runDir, refPath, this.options.matchTreshold, diffFilename)
157
- return diff.diffRatio <= diffTolerance
158
- } else {
159
- return true
168
+ // If not in run skip the image comparison
169
+ if (this.options.mode !== 'run') return true
170
+ // Compare the image
171
+ const runImageKey = path.join(this.options.screenshots.dir, key + '.png')
172
+ const refImageKey = path.join(this.options.screenshots.screenrefsDir, key + '.png')
173
+ const diff = compareImages(runImageKey, refImageKey, this.options.screenshots.matchThreshold)
174
+ if (!tolerance) tolerance = this.options.screenshots.diffTolerance
175
+ if (diff.ratio <= tolerance) return true
176
+ // Write the image diffs
177
+ if (this.options.screenshots.writeDiffs) {
178
+ const diffImageKey = path.join(this.options.screenshots.dir, `diff.${key}.png`)
179
+ fs.writeFileSync(diffImageKey, png.PNG.sync.write(diff.data))
160
180
  }
181
+ return false
161
182
  }
162
183
 
163
184
  compareCaptures (key1, key2, threshold) {
164
- const dir = this.options.screenshotsDir
185
+ const dir = this.options.screenshots.dir
165
186
  const img1 = path.join(dir, key1 + '.png')
166
187
  const img2 = path.join(dir, key2 + '.png')
167
- const imgDiff = this.options.writeDiffs ? path.join(dir, `diff.${key1}.${key2}.png`) : null
188
+ const imgDiff = this.options.screenshots.writeDiffs ? path.join(dir, `diff.${key1}.${key2}.png`) : null
168
189
  const result = compareImages(img1, img2, threshold, imgDiff)
169
190
  return result.diffRatio
170
191
  }
@@ -17,6 +17,12 @@ export async function login (page, user, wait = 5000) {
17
17
  await clickAction(page, 'login-button', wait)
18
18
  }
19
19
 
20
+ export async function loginWithKeycloak (page, user, wait = 5000) {
21
+ await type(page, 'input[name="username"]', user.name)
22
+ await type(page, 'input[name="password"]', user.password)
23
+ await click(page, '[name="login"]', wait)
24
+ }
25
+
20
26
  export async function goToRegisterScreen (page) {
21
27
  await Promise.all([
22
28
  page.waitForNavigation(),
@@ -13,7 +13,7 @@ export const GeolocationAccuracy = 500
13
13
  */
14
14
  export async function elementExists (page, selector) {
15
15
  const exists = !!(await page.$(selector))
16
- debug(`Element ${selector} ` + (exists ? 'exists' : 'does not exist'))
16
+ debug(`[KDK] Element ${selector} ` + (exists ? 'exists' : 'does not exist'))
17
17
  return exists
18
18
  }
19
19
 
@@ -46,9 +46,9 @@ export async function click (page, selector, wait = 500) {
46
46
  await page.waitForSelector(selector, { timeout: 2000 })
47
47
  await page.click(selector)
48
48
  await page.waitForTimeout(wait)
49
- debug(`Clicked target ${selector}`)
49
+ debug(`[KDK] Clicked target ${selector}`)
50
50
  } catch (error) {
51
- console.error(`click ${selector} failed.`)
51
+ console.error(`[KDK] Click ${selector} failed.`)
52
52
  }
53
53
  }
54
54
 
@@ -64,7 +64,7 @@ export async function isActionVisible (page, action) {
64
64
  export async function clickAction (page, action, wait = 500) {
65
65
  const selector = `#${action}`
66
66
  await click(page, selector, wait)
67
- debug(`Clicked action ${selector}`)
67
+ debug(`[KDK] Clicked action ${selector}`)
68
68
  }
69
69
 
70
70
  /* Helper function to click on a menuUtem selector
@@ -75,7 +75,7 @@ export async function clickMenuItem (page, wait = 500) {
75
75
  await page.waitForXPath(xpath)
76
76
  await page.waitForTimeout(wait)
77
77
  } catch (error) {
78
- console.error(`click ${xpath} failed.`)
78
+ console.error(`[KDK] Click ${xpath} failed.`)
79
79
  }
80
80
  }
81
81
 
@@ -88,10 +88,10 @@ export async function clickXPath (page, xpath, wait = 500) {
88
88
  if (elements.length > 0) {
89
89
  elements[0].click()
90
90
  await page.waitForTimeout(wait)
91
- debug(`Clicked target ${xpath}`)
91
+ debug(`[KDK] Clicked target ${xpath}`)
92
92
  }
93
93
  } catch (error) {
94
- console.error(`click ${xpath} failed.`)
94
+ console.error(`[KDK] Click ${xpath} failed.`)
95
95
  }
96
96
  }
97
97
 
@@ -115,9 +115,9 @@ export async function clickSelect (page, selector, entry, wait = 500) {
115
115
  await page.click(entry)
116
116
  }
117
117
  await page.waitForTimeout(wait)
118
- debug(`Clicked entry ${selector}`)
118
+ debug(`[KDK) Clicked entry ${selector}`)
119
119
  } catch (error) {
120
- console.error(`select ${entry} in ${selector} failed.`)
120
+ console.error(`[KDK) Select ${entry} in ${selector} failed.`)
121
121
  }
122
122
  }
123
123
 
@@ -137,7 +137,7 @@ export async function type (page, selector, text, enter = false, replace = false
137
137
  if (enter) await page.keyboard.press('Enter')
138
138
  await page.waitForTimeout(wait)
139
139
  } catch (error) {
140
- console.error(`type ${text} in ${selector} failed.`)
140
+ console.error(`[KDK] Type ${text} in ${selector} failed.`)
141
141
  }
142
142
  }
143
143
 
@@ -158,7 +158,7 @@ export async function typeXPath (page, selector, text, enter = false, replace =
158
158
  if (enter) await page.keyboard.press('Enter')
159
159
  await page.waitForTimeout(wait)
160
160
  } catch (error) {
161
- console.error(`type ${text} in ${selector} failed.`)
161
+ console.error(`[KDK] Type ${text} in ${selector} failed.`)
162
162
  }
163
163
  }
164
164
 
@@ -170,7 +170,7 @@ export async function uploadFile (page, selector, filePath, wait = 2000) {
170
170
  await element.uploadFile(filePath)
171
171
  await page.waitForTimeout(wait)
172
172
  } catch (error) {
173
- console.error(`upload ${filePath} in ${selector} failed.`)
173
+ console.error(`[KDK] Upload ${filePath} in ${selector} failed.`)
174
174
  }
175
175
  }
176
176
 
@@ -236,7 +236,7 @@ export async function setToStore (page, path, value) {
236
236
  * diffFilename is the filename where the diff of the images will be written,
237
237
  * if null, no diff will be written
238
238
  */
239
- export function compareImages (image1, image2, threshold, diffFilename) {
239
+ export function compareImages (image1, image2, threshold) {
240
240
  const img1 = png.PNG.sync.read(fs.readFileSync(image1))
241
241
  const img2 = png.PNG.sync.read(fs.readFileSync(image2))
242
242
  const { width, height } = img1
@@ -245,12 +245,16 @@ export function compareImages (image1, image2, threshold, diffFilename) {
245
245
  alpha: 0.3,
246
246
  diffColor: [255, 0, 0],
247
247
  diffColorAlt: [0, 255, 0],
248
- threshold: threshold
248
+ threshold
249
+ }
250
+ let numDiffs = width * height
251
+ try {
252
+ numDiffs = pixelmatch(img1.data, img2.data, diff.data, width, height, options)
253
+ } catch (error) {
254
+ console.error(`[KDK] Image comparison failed: ${error}`)
249
255
  }
250
- const numDiffs = pixelmatch(img1.data, img2.data, diff.data, width, height, options)
251
- const diffRatio = 100.0 * (numDiffs / (width * height))
252
- if (diffFilename) fs.writeFileSync(diffFilename, png.PNG.sync.write(diff))
253
- return { diffRatio, diff }
256
+ const ratio = 100.0 * (numDiffs / (width * height))
257
+ return { ratio, data: diff }
254
258
  }
255
259
 
256
260
  /* Moves a slider in a chosen direction (right or left), for a specific times
@@ -262,6 +266,6 @@ export async function moveSlider (page, action, direction, times, wait = 500) {
262
266
  for (let i = 0; i < times; i++) {
263
267
  await page.keyboard.press(key)
264
268
  }
265
- debug(`Pressed ${key} ${times} times to move slider ${action}`)
269
+ debug(`[KDK] Pressed ${key} ${times} times to move slider ${action}`)
266
270
  await page.waitForTimeout(wait)
267
271
  }
package/.travis.doc.sh DELETED
@@ -1,8 +0,0 @@
1
- #!/bin/bash
2
-
3
- cd docs && yarn install && yarn build
4
- RESULT_CODE=$?
5
- if [ $RESULT_CODE -ne 0 ]; then
6
- echo "Doc generation failed [error: $RESULT_CODE]"
7
- exit 1
8
- fi
package/.travis.test.sh DELETED
@@ -1,72 +0,0 @@
1
- #!/bin/bash
2
-
3
- check_code()
4
- {
5
- if [ $1 -eq 1 ]; then
6
- echo "$2 has failed [error: $1]"
7
- exit 1
8
- fi
9
- }
10
-
11
- AGE_VERSION=1.1.1
12
- SOPS_VERSION=3.8.1
13
- TMP_PATH="$(mktemp -d -p "${XDG_RUNTIME_DIR:-}" kalisio.XXXXXX)"
14
-
15
- install_age() {
16
- local DL_PATH="$TMP_PATH/age"
17
- mkdir "$DL_PATH" && pushd "$DL_PATH" || exit
18
- wget -q https://github.com/FiloSottile/age/releases/download/v${AGE_VERSION}/age-v${AGE_VERSION}-linux-amd64.tar.gz
19
- # no checksum ...
20
- tar xf age-v${AGE_VERSION}-linux-amd64.tar.gz
21
- cp age/age "$HOME/.local/bin"
22
- popd || exit
23
- }
24
-
25
- install_sops() {
26
- local DL_PATH="$TMP_PATH/sops"
27
- mkdir "$DL_PATH" && pushd "$DL_PATH" || exit
28
- wget -q https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.linux.amd64
29
- wget -q https://github.com/getsops/sops/releases/download/v${SOPS_VERSION}/sops-v${SOPS_VERSION}.checksums.txt
30
- sha256sum --ignore-missing --quiet -c sops-v${SOPS_VERSION}.checksums.txt
31
- cp sops-v${SOPS_VERSION}.linux.amd64 "$HOME/.local/bin/sops"
32
- chmod a+x "$HOME/.local/bin/sops"
33
- popd || exit
34
- }
35
-
36
- # Make sure that folder exists, with Travis CI it's already in the PATH
37
- mkdir -p "$HOME/.local/bin"
38
- install_age
39
- install_sops
40
-
41
- echo -e "machine github.com\n login $GITHUB_TOKEN" > ~/.netrc
42
-
43
- # Setup KDK
44
- yarn install
45
-
46
- # Clone others direct dependencies we'd like to use for testing
47
- git clone https://github.com/kalisio/feathers-distributed && cd feathers-distributed && yarn install && yarn link && cd ..
48
- yarn link @kalisio/feathers-distributed
49
-
50
- git clone https://github.com/kalisio/feathers-s3 && cd feathers-s3 && yarn install && yarn link && cd ..
51
- yarn link @kalisio/feathers-s3
52
-
53
- git clone https://github.com/kalisio/feathers-import-export && cd feathers-import-export && yarn install && yarn link && yarn link @kalisio/feathers-s3 && cd ..
54
- yarn link @kalisio/feathers-import-export
55
-
56
- git clone https://github.com/kalisio/feathers-webpush && cd feathers-webpush && yarn install && yarn link && cd ..
57
- yarn link @kalisio/feathers-webpush
58
-
59
- git clone https://github.com/weacast/weacast && cd weacast && yarn install && cd packages
60
- cd core && yarn link && cd .. && cd gfs && yarn link && cd .. && cd probe && yarn link && cd ..
61
- cd ../..
62
- yarn link @weacast/core
63
- yarn link @weacast/gfs
64
- yarn link @weacast/probe
65
-
66
- # Clone the development project and configure the env
67
- git clone https://oauth2:$GITHUB_TOKEN@github.com/kalisio/development.git "development"
68
- source development/workspaces/libs/libs.sh kdk
69
-
70
- # Run the test
71
- yarn test
72
- check_code $? "Running tests"