@globisnv/cypress-core 0.0.2 → 0.0.4

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 (297) hide show
  1. package/README.md +12 -7
  2. package/dist/apiMethods/IGS_request.d.ts +98 -0
  3. package/dist/apiMethods/IGS_request.js +161 -0
  4. package/dist/apiMethods/IGS_response.d.ts +47 -0
  5. package/dist/apiMethods/IGS_response.js +1 -0
  6. package/dist/blueprints/GLO_addressPopup.d.ts +45 -0
  7. package/dist/blueprints/GLO_addressPopup.js +96 -0
  8. package/dist/blueprints/GLO_article.d.ts +45 -0
  9. package/dist/blueprints/GLO_article.js +110 -0
  10. package/dist/blueprints/GLO_articleLot.d.ts +12 -0
  11. package/dist/blueprints/GLO_articleLot.js +23 -0
  12. package/dist/blueprints/GLO_articleVersion.d.ts +4 -0
  13. package/dist/blueprints/GLO_articleVersion.js +4 -0
  14. package/dist/blueprints/GLO_attachmentPopup.d.ts +9 -0
  15. package/dist/blueprints/GLO_attachmentPopup.js +10 -0
  16. package/dist/blueprints/GLO_bankAccount.d.ts +7 -0
  17. package/dist/blueprints/GLO_bankAccount.js +7 -0
  18. package/dist/blueprints/GLO_billingProcess.d.ts +4 -0
  19. package/dist/blueprints/GLO_billingProcess.js +4 -0
  20. package/dist/blueprints/GLO_billingProposal.d.ts +9 -0
  21. package/dist/blueprints/GLO_billingProposal.js +9 -0
  22. package/dist/blueprints/GLO_cancel.d.ts +7 -0
  23. package/dist/blueprints/GLO_cancel.js +7 -0
  24. package/dist/blueprints/GLO_commandlist.d.ts +10 -0
  25. package/dist/blueprints/GLO_commandlist.js +10 -0
  26. package/dist/blueprints/GLO_complaint.d.ts +27 -0
  27. package/dist/blueprints/GLO_complaint.js +51 -0
  28. package/dist/blueprints/GLO_composition.d.ts +14 -0
  29. package/dist/blueprints/GLO_composition.js +20 -0
  30. package/dist/blueprints/GLO_consignment.d.ts +61 -0
  31. package/dist/blueprints/GLO_consignment.js +104 -0
  32. package/dist/blueprints/GLO_consignmentContainerGroup.d.ts +6 -0
  33. package/dist/blueprints/GLO_consignmentContainerGroup.js +6 -0
  34. package/dist/blueprints/GLO_consignmentGoods.d.ts +40 -0
  35. package/dist/blueprints/GLO_consignmentGoods.js +62 -0
  36. package/dist/blueprints/GLO_consignmentHandling.d.ts +4 -0
  37. package/dist/blueprints/GLO_consignmentHandling.js +4 -0
  38. package/dist/blueprints/GLO_consignmentOrder.d.ts +31 -0
  39. package/dist/blueprints/GLO_consignmentOrder.js +37 -0
  40. package/dist/blueprints/GLO_consignmentPart.d.ts +13 -0
  41. package/dist/blueprints/GLO_consignmentPart.js +13 -0
  42. package/dist/blueprints/GLO_consignmentParts.d.ts +5 -0
  43. package/dist/blueprints/GLO_consignmentParts.js +12 -0
  44. package/dist/blueprints/GLO_consignmentPrice.d.ts +11 -0
  45. package/dist/blueprints/GLO_consignmentPrice.js +19 -0
  46. package/dist/blueprints/GLO_consignmentSupplier.d.ts +6 -0
  47. package/dist/blueprints/GLO_consignmentSupplier.js +11 -0
  48. package/dist/blueprints/GLO_contacts.d.ts +10 -0
  49. package/dist/blueprints/GLO_contacts.js +14 -0
  50. package/dist/blueprints/GLO_container.d.ts +6 -0
  51. package/dist/blueprints/GLO_container.js +4 -0
  52. package/dist/blueprints/GLO_contract.d.ts +22 -0
  53. package/dist/blueprints/GLO_contract.js +30 -0
  54. package/dist/blueprints/GLO_contractArticle.d.ts +17 -0
  55. package/dist/blueprints/GLO_contractArticle.js +35 -0
  56. package/dist/blueprints/GLO_contractArticleCost.d.ts +5 -0
  57. package/dist/blueprints/GLO_contractArticleCost.js +8 -0
  58. package/dist/blueprints/GLO_countryVatZone.d.ts +8 -0
  59. package/dist/blueprints/GLO_countryVatZone.js +9 -0
  60. package/dist/blueprints/GLO_currencyDeviation.d.ts +14 -0
  61. package/dist/blueprints/GLO_currencyDeviation.js +15 -0
  62. package/dist/blueprints/GLO_customerArticle.d.ts +12 -0
  63. package/dist/blueprints/GLO_customerArticle.js +15 -0
  64. package/dist/blueprints/GLO_customsFlow.d.ts +8 -0
  65. package/dist/blueprints/GLO_customsFlow.js +19 -0
  66. package/dist/blueprints/GLO_customsFlowDefinition.d.ts +15 -0
  67. package/dist/blueprints/GLO_customsFlowDefinition.js +14 -0
  68. package/dist/blueprints/GLO_customsUnion.d.ts +4 -0
  69. package/dist/blueprints/GLO_customsUnion.js +4 -0
  70. package/dist/blueprints/GLO_deliveryReceipt.d.ts +10 -0
  71. package/dist/blueprints/GLO_deliveryReceipt.js +22 -0
  72. package/dist/blueprints/GLO_departureSchedule.d.ts +27 -0
  73. package/dist/blueprints/GLO_departureSchedule.js +57 -0
  74. package/dist/blueprints/GLO_departureScheduleTimes.d.ts +49 -0
  75. package/dist/blueprints/GLO_departureScheduleTimes.js +61 -0
  76. package/dist/blueprints/GLO_document.d.ts +7 -0
  77. package/dist/blueprints/GLO_document.js +7 -0
  78. package/dist/blueprints/GLO_documentAttachment.d.ts +4 -0
  79. package/dist/blueprints/GLO_documentAttachment.js +4 -0
  80. package/dist/blueprints/GLO_documentDefinitionEntity.d.ts +5 -0
  81. package/dist/blueprints/GLO_documentDefinitionEntity.js +5 -0
  82. package/dist/blueprints/GLO_documentGroup.d.ts +4 -0
  83. package/dist/blueprints/GLO_documentGroup.js +4 -0
  84. package/dist/blueprints/GLO_documentType.d.ts +12 -0
  85. package/dist/blueprints/GLO_documentType.js +11 -0
  86. package/dist/blueprints/GLO_enterCountry.d.ts +21 -0
  87. package/dist/blueprints/GLO_enterCountry.js +47 -0
  88. package/dist/blueprints/GLO_enterDiscount.d.ts +8 -0
  89. package/dist/blueprints/GLO_enterDiscount.js +9 -0
  90. package/dist/blueprints/GLO_equipment.d.ts +34 -0
  91. package/dist/blueprints/GLO_equipment.js +55 -0
  92. package/dist/blueprints/GLO_equipmentCategory.d.ts +15 -0
  93. package/dist/blueprints/GLO_equipmentCategory.js +14 -0
  94. package/dist/blueprints/GLO_equipmentEntity.d.ts +5 -0
  95. package/dist/blueprints/GLO_equipmentEntity.js +5 -0
  96. package/dist/blueprints/GLO_equipmentServiceCategory.d.ts +13 -0
  97. package/dist/blueprints/GLO_equipmentServiceCategory.js +13 -0
  98. package/dist/blueprints/GLO_equipmentType.d.ts +21 -0
  99. package/dist/blueprints/GLO_equipmentType.js +20 -0
  100. package/dist/blueprints/GLO_equipmentTypeServiceCategory.d.ts +13 -0
  101. package/dist/blueprints/GLO_equipmentTypeServiceCategory.js +12 -0
  102. package/dist/blueprints/GLO_fieldInputValidation.d.ts +46 -0
  103. package/dist/blueprints/GLO_fieldInputValidation.js +73 -0
  104. package/dist/blueprints/GLO_formula.d.ts +9 -0
  105. package/dist/blueprints/GLO_formula.js +9 -0
  106. package/dist/blueprints/GLO_gang.d.ts +12 -0
  107. package/dist/blueprints/GLO_gang.js +12 -0
  108. package/dist/blueprints/GLO_holiday.d.ts +7 -0
  109. package/dist/blueprints/GLO_holiday.js +8 -0
  110. package/dist/blueprints/GLO_journey.d.ts +18 -0
  111. package/dist/blueprints/GLO_journey.js +24 -0
  112. package/dist/blueprints/GLO_journeyStop.d.ts +32 -0
  113. package/dist/blueprints/GLO_journeyStop.js +44 -0
  114. package/dist/blueprints/GLO_layout.d.ts +6 -0
  115. package/dist/blueprints/GLO_layout.js +6 -0
  116. package/dist/blueprints/GLO_logging.d.ts +9 -0
  117. package/dist/blueprints/GLO_logging.js +12 -0
  118. package/dist/blueprints/GLO_logisticConnection.d.ts +10 -0
  119. package/dist/blueprints/GLO_logisticConnection.js +11 -0
  120. package/dist/blueprints/GLO_logisticConnectionType.d.ts +5 -0
  121. package/dist/blueprints/GLO_logisticConnectionType.js +5 -0
  122. package/dist/blueprints/GLO_logisticContract.d.ts +28 -0
  123. package/dist/blueprints/GLO_logisticContract.js +80 -0
  124. package/dist/blueprints/GLO_logisticContractDetail.d.ts +42 -0
  125. package/dist/blueprints/GLO_logisticContractDetail.js +122 -0
  126. package/dist/blueprints/GLO_logisticContractDetailHandling.d.ts +11 -0
  127. package/dist/blueprints/GLO_logisticContractDetailHandling.js +14 -0
  128. package/dist/blueprints/GLO_logisticContractDetailItem.d.ts +5 -0
  129. package/dist/blueprints/GLO_logisticContractDetailItem.js +8 -0
  130. package/dist/blueprints/GLO_logisticContractItem.d.ts +14 -0
  131. package/dist/blueprints/GLO_logisticContractItem.js +40 -0
  132. package/dist/blueprints/GLO_logisticContractItemActivity.d.ts +4 -0
  133. package/dist/blueprints/GLO_logisticContractItemActivity.js +4 -0
  134. package/dist/blueprints/GLO_logisticContractItemSurcharge.d.ts +7 -0
  135. package/dist/blueprints/GLO_logisticContractItemSurcharge.js +7 -0
  136. package/dist/blueprints/GLO_logisticContractItemSurchargeItem.d.ts +4 -0
  137. package/dist/blueprints/GLO_logisticContractItemSurchargeItem.js +4 -0
  138. package/dist/blueprints/GLO_logisticContractReference.d.ts +4 -0
  139. package/dist/blueprints/GLO_logisticContractReference.js +4 -0
  140. package/dist/blueprints/GLO_logisticContractVolumeConstraint.d.ts +9 -0
  141. package/dist/blueprints/GLO_logisticContractVolumeConstraint.js +8 -0
  142. package/dist/blueprints/GLO_logisticLocation.d.ts +7 -0
  143. package/dist/blueprints/GLO_logisticLocation.js +7 -0
  144. package/dist/blueprints/GLO_logisticPriceRequestDetailExternalPrice.d.ts +19 -0
  145. package/dist/blueprints/GLO_logisticPriceRequestDetailExternalPrice.js +30 -0
  146. package/dist/blueprints/GLO_logisticPurchaseOrder.d.ts +4 -0
  147. package/dist/blueprints/GLO_logisticPurchaseOrder.js +4 -0
  148. package/dist/blueprints/GLO_logistic_waiting_hours.d.ts +6 -0
  149. package/dist/blueprints/GLO_logistic_waiting_hours.js +6 -0
  150. package/dist/blueprints/GLO_operationalDefault.d.ts +23 -0
  151. package/dist/blueprints/GLO_operationalDefault.js +25 -0
  152. package/dist/blueprints/GLO_outputDetailMail.d.ts +14 -0
  153. package/dist/blueprints/GLO_outputDetailMail.js +13 -0
  154. package/dist/blueprints/GLO_postalcode.d.ts +6 -0
  155. package/dist/blueprints/GLO_postalcode.js +6 -0
  156. package/dist/blueprints/GLO_priceDependency.d.ts +5 -0
  157. package/dist/blueprints/GLO_priceDependency.js +4 -0
  158. package/dist/blueprints/GLO_priceEntry.d.ts +17 -0
  159. package/dist/blueprints/GLO_priceEntry.js +17 -0
  160. package/dist/blueprints/GLO_priceRequest.d.ts +8 -0
  161. package/dist/blueprints/GLO_priceRequest.js +20 -0
  162. package/dist/blueprints/GLO_priceRequestLine.d.ts +12 -0
  163. package/dist/blueprints/GLO_priceRequestLine.js +17 -0
  164. package/dist/blueprints/GLO_principal.d.ts +9 -0
  165. package/dist/blueprints/GLO_principal.js +13 -0
  166. package/dist/blueprints/GLO_printPopup.d.ts +10 -0
  167. package/dist/blueprints/GLO_printPopup.js +62 -0
  168. package/dist/blueprints/GLO_production.d.ts +9 -0
  169. package/dist/blueprints/GLO_production.js +9 -0
  170. package/dist/blueprints/GLO_productionLineMaterial.d.ts +8 -0
  171. package/dist/blueprints/GLO_productionLineMaterial.js +13 -0
  172. package/dist/blueprints/GLO_productionMaterial.d.ts +5 -0
  173. package/dist/blueprints/GLO_productionMaterial.js +5 -0
  174. package/dist/blueprints/GLO_purchaseCosts.d.ts +6 -0
  175. package/dist/blueprints/GLO_purchaseCosts.js +9 -0
  176. package/dist/blueprints/GLO_purchaseInvoice.d.ts +12 -0
  177. package/dist/blueprints/GLO_purchaseInvoice.js +25 -0
  178. package/dist/blueprints/GLO_purchaseInvoiceLine.d.ts +8 -0
  179. package/dist/blueprints/GLO_purchaseInvoiceLine.js +13 -0
  180. package/dist/blueprints/GLO_purchaseOrder.d.ts +14 -0
  181. package/dist/blueprints/GLO_purchaseOrder.js +25 -0
  182. package/dist/blueprints/GLO_purchaseOrderLine.d.ts +10 -0
  183. package/dist/blueprints/GLO_purchaseOrderLine.js +24 -0
  184. package/dist/blueprints/GLO_purchasePrices.d.ts +10 -0
  185. package/dist/blueprints/GLO_purchasePrices.js +10 -0
  186. package/dist/blueprints/GLO_quotation.d.ts +12 -0
  187. package/dist/blueprints/GLO_quotation.js +32 -0
  188. package/dist/blueprints/GLO_quotationLine.d.ts +12 -0
  189. package/dist/blueprints/GLO_quotationLine.js +28 -0
  190. package/dist/blueprints/GLO_receipt.d.ts +13 -0
  191. package/dist/blueprints/GLO_receipt.js +17 -0
  192. package/dist/blueprints/GLO_receiptFromTempReceipt.d.ts +8 -0
  193. package/dist/blueprints/GLO_receiptFromTempReceipt.js +8 -0
  194. package/dist/blueprints/GLO_receiptLine.d.ts +22 -0
  195. package/dist/blueprints/GLO_receiptLine.js +28 -0
  196. package/dist/blueprints/GLO_relationAddress.d.ts +26 -0
  197. package/dist/blueprints/GLO_relationAddress.js +58 -0
  198. package/dist/blueprints/GLO_relationBankAccount.d.ts +9 -0
  199. package/dist/blueprints/GLO_relationBankAccount.js +9 -0
  200. package/dist/blueprints/GLO_relationContact.d.ts +23 -0
  201. package/dist/blueprints/GLO_relationContact.js +45 -0
  202. package/dist/blueprints/GLO_relationGroupType.d.ts +7 -0
  203. package/dist/blueprints/GLO_relationGroupType.js +6 -0
  204. package/dist/blueprints/GLO_relations.d.ts +67 -0
  205. package/dist/blueprints/GLO_relations.js +186 -0
  206. package/dist/blueprints/GLO_relationtype.d.ts +15 -0
  207. package/dist/blueprints/GLO_relationtype.js +31 -0
  208. package/dist/blueprints/GLO_remarkType.d.ts +10 -0
  209. package/dist/blueprints/GLO_remarkType.js +9 -0
  210. package/dist/blueprints/GLO_remarkTypeDefaultValue.d.ts +4 -0
  211. package/dist/blueprints/GLO_remarkTypeDefaultValue.js +14 -0
  212. package/dist/blueprints/GLO_remarkTypeEntityType.d.ts +10 -0
  213. package/dist/blueprints/GLO_remarkTypeEntityType.js +9 -0
  214. package/dist/blueprints/GLO_representative.d.ts +7 -0
  215. package/dist/blueprints/GLO_representative.js +6 -0
  216. package/dist/blueprints/GLO_salesInvoice.d.ts +9 -0
  217. package/dist/blueprints/GLO_salesInvoice.js +15 -0
  218. package/dist/blueprints/GLO_salesInvoiceLine.d.ts +9 -0
  219. package/dist/blueprints/GLO_salesInvoiceLine.js +13 -0
  220. package/dist/blueprints/GLO_salesOrder.d.ts +13 -0
  221. package/dist/blueprints/GLO_salesOrder.js +25 -0
  222. package/dist/blueprints/GLO_salesOrderLine.d.ts +13 -0
  223. package/dist/blueprints/GLO_salesOrderLine.js +34 -0
  224. package/dist/blueprints/GLO_stockCorrection.d.ts +14 -0
  225. package/dist/blueprints/GLO_stockCorrection.js +24 -0
  226. package/dist/blueprints/GLO_stopSchedule.d.ts +4 -0
  227. package/dist/blueprints/GLO_stopSchedule.js +4 -0
  228. package/dist/blueprints/GLO_supplierArticle.d.ts +8 -0
  229. package/dist/blueprints/GLO_supplierArticle.js +8 -0
  230. package/dist/blueprints/GLO_tclSetting.d.ts +6 -0
  231. package/dist/blueprints/GLO_tclSetting.js +6 -0
  232. package/dist/blueprints/GLO_todo.d.ts +10 -0
  233. package/dist/blueprints/GLO_todo.js +21 -0
  234. package/dist/blueprints/GLO_todoSchedule.d.ts +23 -0
  235. package/dist/blueprints/GLO_todoSchedule.js +79 -0
  236. package/dist/blueprints/GLO_tractionDistance.d.ts +6 -0
  237. package/dist/blueprints/GLO_tractionDistance.js +6 -0
  238. package/dist/blueprints/GLO_transportOrder.d.ts +4 -0
  239. package/dist/blueprints/GLO_transportOrder.js +4 -0
  240. package/dist/blueprints/GLO_transportPrice.d.ts +18 -0
  241. package/dist/blueprints/GLO_transportPrice.js +34 -0
  242. package/dist/blueprints/GLO_transportRequirement.d.ts +18 -0
  243. package/dist/blueprints/GLO_transportRequirement.js +32 -0
  244. package/dist/blueprints/GLO_transportRequirementContainer.d.ts +8 -0
  245. package/dist/blueprints/GLO_transportRequirementContainer.js +8 -0
  246. package/dist/blueprints/GLO_transportRequirementGoods.d.ts +33 -0
  247. package/dist/blueprints/GLO_transportRequirementGoods.js +51 -0
  248. package/dist/blueprints/GLO_transportScenarioExecutionLeg.d.ts +6 -0
  249. package/dist/blueprints/GLO_transportScenarioExecutionLeg.js +6 -0
  250. package/dist/blueprints/GLO_transportStock.d.ts +4 -0
  251. package/dist/blueprints/GLO_transportStock.js +4 -0
  252. package/dist/blueprints/GLO_visit.d.ts +9 -0
  253. package/dist/blueprints/GLO_visit.js +10 -0
  254. package/dist/blueprints/GLO_warehouseMove.d.ts +9 -0
  255. package/dist/blueprints/GLO_warehouseMove.js +9 -0
  256. package/dist/blueprints/GLO_warehouseOrderSubline.d.ts +6 -0
  257. package/dist/blueprints/GLO_warehouseOrderSubline.js +11 -0
  258. package/dist/blueprints/GLO_workflowLoggingTable.d.ts +20 -0
  259. package/dist/blueprints/GLO_workflowLoggingTable.js +20 -0
  260. package/dist/blueprints/GLO_workflowVerification.d.ts +10 -0
  261. package/dist/blueprints/GLO_workflowVerification.js +19 -0
  262. package/dist/blueprints/GLO_zone.d.ts +9 -0
  263. package/dist/blueprints/GLO_zone.js +9 -0
  264. package/dist/blueprints/GLO_zone_postalcode.d.ts +12 -0
  265. package/dist/blueprints/GLO_zone_postalcode.js +10 -0
  266. package/dist/blueprints/GLO_zone_type.d.ts +8 -0
  267. package/dist/blueprints/GLO_zone_type.js +7 -0
  268. package/dist/blueprints/GLT_goods.d.ts +2 -0
  269. package/dist/blueprints/GLT_goods.js +12 -0
  270. package/dist/commands/FOB_commands.d.ts +124 -0
  271. package/dist/commands/FOB_commands.js +211 -0
  272. package/dist/commands/GLJ_commands.d.ts +28 -0
  273. package/dist/commands/GLJ_commands.js +40 -0
  274. package/dist/commands/GLO_commands.d.ts +685 -0
  275. package/dist/commands/GLO_commands.js +2319 -0
  276. package/dist/commands/GLS_commands.d.ts +63 -0
  277. package/dist/commands/GLS_commands.js +103 -0
  278. package/dist/commands/GLT_commands.d.ts +78 -0
  279. package/dist/commands/GLT_commands.js +148 -0
  280. package/dist/commands/POR_commands.d.ts +85 -0
  281. package/dist/commands/POR_commands.js +122 -0
  282. package/dist/config.d.ts +9 -0
  283. package/dist/config.js +115 -0
  284. package/dist/index.d.ts +2 -0
  285. package/dist/index.js +15 -0
  286. package/dist/plugins/prometheusWriter.d.ts +15 -0
  287. package/dist/plugins/prometheusWriter.js +111 -0
  288. package/dist/register.d.ts +8 -0
  289. package/dist/register.js +23 -0
  290. package/dist/tsHelper.d.ts +161 -0
  291. package/dist/tsHelper.js +294 -0
  292. package/dist/types.d.ts +363 -0
  293. package/dist/types.js +4 -0
  294. package/dist/websocketDetector.d.ts +71 -0
  295. package/dist/websocketDetector.js +1593 -0
  296. package/package.json +10 -2
  297. package/template/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Command to switch to globscan in test and login with specified username.
6
+ * @param {string} username - Defaults to PR001 if not provided.
7
+ * @param {string} company - Name of the company.
8
+ */
9
+ GLS_login(username?: string, company?: string): void;
10
+ /**
11
+ * Command to use the main navigation.
12
+ * @param {string} value - Name visible on the button
13
+ */
14
+ GLS_mainNavigation(value: string): void;
15
+ /**
16
+ * Command to select a stock item by index.
17
+ * @param {string} formname - Name of the form
18
+ * @param {string} elementname - Name of the stock list element
19
+ * @param {number} index - The row index (ID) to click
20
+ */
21
+ GLS_selectStock(formname: string, elementname: string, index: number): void;
22
+ /**
23
+ * Command to store a value from a .gs-value container based on its label.
24
+ * @param {string} formName - Name of the form
25
+ * @param {string} elementName - Name of the element (data-cy)
26
+ * @param {string} label - The label text to look for (e.g., 'LPN:', 'Article:')
27
+ * @param {string} asValue - Alias name to store the text
28
+ * @param {boolean} log - Whether to log the value
29
+ */
30
+ GLS_storeValue(formName: string, elementName: string, label: string, asValue: string, log?: boolean): void;
31
+ /**
32
+ * Command to check a value in a .gs-value container based on its label.
33
+ * @param {string} formName - Name of the form
34
+ * @param {string} elementName - Name of the element (data-cy)
35
+ * @param {string} label - The label text to look for (e.g., 'LPN:', 'Article:')
36
+ * @param {customValueTypeUndefined} value - The expected value to check against
37
+ * @param {checkOperatorType} [operator='equal'] - Operator used to check the value
38
+ * @param {number} [timeOut] - How long to wait for the value to match, default: 10s
39
+ */
40
+ GLS_checkValue(formName: string, elementName: string, label: string, value: customValueTypeUndefined, operator?: checkOperatorType, timeOut?: number): void;
41
+ /**
42
+ * Verifies that a toast message appears and then disappears.
43
+ * @param {string} expectedMessage - The text to match inside the toast
44
+ */
45
+ GLS_verifyToast(expectedMessage: string): void;
46
+ /**
47
+ * Command to use the navigation bars (Top or Bottom).
48
+ * @param {'top' | 'bottom'} position - Which navigation bar to target
49
+ * @param {string} formname - Name of the form
50
+ * @param {string} value - Icon name ('left', 'right', 'home') or Button ID ('logout', 'undo')
51
+ */
52
+ GLS_navigation(position: 'top' | 'bottom', formname: string, value: string): void;
53
+ /**
54
+ * Command to get the value of a label within a form element.
55
+ * @param {string} formName - Name of the form
56
+ * @param {string} elementName - Name of the element within the form
57
+ * @param {string} label - The label text to search for (e.g. 'TO location:')
58
+ */
59
+ GLS_getLabelValue(formName: string, elementName: string, label: string): Cypress.Chainable<JQuery>;
60
+ }
61
+ }
62
+ }
63
+ export {};
@@ -0,0 +1,103 @@
1
+ import { contains, equal, notEqual, parseLocalizedNumber } from '../tsHelper.js';
2
+ Cypress.Commands.add('GLS_login', (username = 'PR001', company) => {
3
+ const u = new URL(Cypress.expose('globisUrl'));
4
+ const path = u.pathname.replace(/\/$/, '');
5
+ u.pathname = path.includes('/solution/') ? path.replace(/\/solution\/[^/?#]+/, '/solution/globscan') : `${path}/solution/globscan`;
6
+ cy.visit(u.toString());
7
+ cy.GLO_getElement(['globscan$svy_nav_login', 'txt_login'], { timeout: 120000 });
8
+ cy.GLO_checkLoadingIndicator();
9
+ cy.GLO_getElement(['globscan$svy_nav_login', 'txt_login']).find('input').eq(0).should('be.enabled').should('be.visible').clear().type(username);
10
+ if (company) {
11
+ cy.GLO_addInput(['globscan$svy_nav_login', 'company'], company);
12
+ }
13
+ cy.GLO_clickButton(['globscan$svy_nav_login', 'btn_login']);
14
+ cy.GLO_checkLoadingIndicator();
15
+ });
16
+ Cypress.Commands.add('GLS_mainNavigation', (value) => {
17
+ const scrollAndSearch = (attempts = 0) => {
18
+ if (attempts > 20) {
19
+ throw new Error(`Could not find menu item: ${value}`);
20
+ }
21
+ return cy
22
+ .get('.ag-body-viewport')
23
+ .first()
24
+ .then(($viewport) => {
25
+ const $label = $viewport.find('label').filter((_i, el) => el.innerText.trim() === value);
26
+ if ($label.length > 0 && $label.is(':visible')) {
27
+ return cy.contains('.ag-body-viewport label', value).click();
28
+ }
29
+ return cy
30
+ .get('.ag-center-cols-container [role="row"][tabindex="0"]')
31
+ .first()
32
+ .focus()
33
+ .realPress('ArrowDown')
34
+ .then(() => scrollAndSearch(attempts + 1));
35
+ });
36
+ };
37
+ scrollAndSearch().then(() => {
38
+ cy.GLO_checkLoadingIndicator();
39
+ });
40
+ });
41
+ Cypress.Commands.add('GLS_selectStock', (formName, elementName, index) => {
42
+ cy.GLO_getElement([formName, elementName]).find(`.item-container#${index}`).click();
43
+ cy.GLO_checkLoadingIndicator();
44
+ });
45
+ const getLabelValue = (formName, elementName, label) => {
46
+ return cy.GLO_getElement([formName, elementName]).contains('.item-label', label).parent().find('.gs-value');
47
+ };
48
+ Cypress.Commands.add('GLS_storeValue', (formName, elementName, label, asValue, log = false) => {
49
+ getLabelValue(formName, elementName, label)
50
+ .invoke('text')
51
+ .then((text) => {
52
+ cy.wrap(text.trim()).as(asValue);
53
+ if (log)
54
+ cy.GLO_log(`${asValue}: ${text.trim()}`);
55
+ });
56
+ });
57
+ Cypress.Commands.add('GLS_checkValue', (formName, elementName, label, value, operator = equal, timeOut = 10000) => {
58
+ if (value === undefined)
59
+ return;
60
+ const normalizedValue = typeof value === 'string' ? value.replace(/\s+/g, ' ').trim() : value;
61
+ getLabelValue(formName, elementName, label).then(($el) => {
62
+ cy.wrap($el, { timeout: timeOut }).should(($gsValue) => {
63
+ const textString = $gsValue.text().replace(/\s+/g, ' ').trim();
64
+ const numericText = typeof value === 'number' ? parseLocalizedNumber(textString) : textString;
65
+ const text = typeof value === 'number' ? numericText : textString;
66
+ if (operator === equal) {
67
+ expect(text).to.equal(normalizedValue);
68
+ }
69
+ else if (operator === notEqual) {
70
+ expect(text).to.not.equal(normalizedValue);
71
+ }
72
+ else if (operator === contains) {
73
+ expect(text).to.contain(normalizedValue);
74
+ }
75
+ else {
76
+ throw new Error('Incorrect operator for GLS_checkValue. Available operators: equal, notEqual, contains');
77
+ }
78
+ });
79
+ });
80
+ });
81
+ Cypress.Commands.add('GLS_verifyToast', (expectedMessage) => {
82
+ cy.get('#toast-container', { timeout: 15000 }).as('container');
83
+ cy.get('@container').contains(expectedMessage).should('be.visible');
84
+ cy.get('@container').contains(expectedMessage, { timeout: 15000 }).should('not.exist');
85
+ });
86
+ Cypress.Commands.add('GLS_navigation', (position, formName, value) => {
87
+ const navIconMap = {
88
+ left: 'fa-arrow-left',
89
+ right: 'fa-arrow-right'
90
+ };
91
+ if (position === 'top') {
92
+ const iconClass = navIconMap[value] ?? 'fa-home';
93
+ cy.GLO_getElement([formName, 'navbar']).parent('.navbar').find(`i.${iconClass}`).should('be.visible').click();
94
+ }
95
+ else {
96
+ const targetId = value === 'home' ? 'exit' : value;
97
+ cy.GLO_getElement([formName, 'navbar_bottom']).find(`#${targetId}`).scrollIntoView().click();
98
+ }
99
+ cy.GLO_checkLoadingIndicator();
100
+ });
101
+ Cypress.Commands.add('GLS_getLabelValue', (formName, elementName, label) => {
102
+ return getLabelValue(formName, elementName, label);
103
+ });
@@ -0,0 +1,78 @@
1
+ export {};
2
+ declare global {
3
+ namespace Cypress {
4
+ interface Chainable {
5
+ /**
6
+ * Command to switch to globtake in test and login with specified username.
7
+ *
8
+ * @param {string} username - Defaults to PR999 if not provided.
9
+ * @param {string} company - Name of the company.
10
+ */
11
+ GLT_login(username?: string, company?: string): void;
12
+ /**
13
+ * Command to use the main navigation.
14
+ *
15
+ * @param {string} formName - Name of the form
16
+ * @param {string} value - Name visible on the button
17
+ */
18
+ GLT_mainNavigation(formName: string, value: string): void;
19
+ /**
20
+ * Command to use the bottom navigation bar
21
+ *
22
+ * @param {string} value - Name visible on the button
23
+ */
24
+ GLT_bottomNavigation(value: string): void;
25
+ /**
26
+ * Command to enter gang.
27
+ *
28
+ * @param {string} customerCode - code of the customer (gt$main_menu_<<customerCode>>))
29
+ * @param {string} value - Gang value
30
+ */
31
+ GLT_enterGang(customerCode: string, value: string): void;
32
+ /**
33
+ * Command to search for something in the top bar.
34
+ *
35
+ * @param {string} formName - The formname where the search is performed
36
+ * @param {string} value - Value to be searched
37
+ */
38
+ GLT_searchHeader(formName: string, value: string): void;
39
+ /**
40
+ * Command to go to the homepage.
41
+ */
42
+ GLT_goHome(formname: string): void;
43
+ /**
44
+ * Command to go to the homepage.
45
+ */
46
+ GLT_closePopup(): void;
47
+ /**
48
+ * Clicks on a specific button in a button bar component.
49
+ * @param {string} formName - The name of the form (e.g., 'gt$receipt_goods_dtl').
50
+ * @param {string} title - The title attribute of the button to be clicked (e.g., 'Print labels').
51
+ */
52
+ GLT_clickButtonInButtonBar(formName: string, title: string): void;
53
+ /**
54
+ * Clicks a button within a specific form and ensures the dialog is closed.
55
+ * @param {string} buttonName - The name attribute of the button.
56
+ */
57
+ GLT_clickButton(buttonName: string): void;
58
+ /**
59
+ * Gets rows from a DevExtreme TreeList, auto-expanding collapsed nodes as needed.
60
+ * - article only → article row + all Lot & LPN descendants
61
+ * - article + lot → lot row + all LPN rows under it
62
+ * - article + lot + lpn → single matching LPN row
63
+ * - no filters → all visible rows
64
+ *
65
+ * @param {string} formName - The name of the form (e.g., 'receipt_goods_dtl')
66
+ * @param {string} elementName - The name of the tree element (e.g., 'dataTree')
67
+ * @param {TreeListFilters} filters - Optional filters
68
+ */
69
+ GLT_getTreeListRows(formName: string, elementName: string, filters?: TreeListFilters): Cypress.Chainable<JQuery>;
70
+ /**
71
+ * Command to add input to a dialog with an input field.
72
+ *
73
+ * @param {string} text - The option to be selected in the popup dialog.
74
+ */
75
+ GLT_addInputDialog(text: string): void;
76
+ }
77
+ }
78
+ }
@@ -0,0 +1,148 @@
1
+ Cypress.Commands.add('GLT_login', (username = 'PR999', company) => {
2
+ const u = new URL(Cypress.expose('globisUrl'));
3
+ const path = u.pathname.replace(/\/$/, '');
4
+ u.pathname = path.includes('/solution/') ? path.replace(/\/solution\/[^/?#]+/, '/solution/globtake') : `${path}/solution/globtake`;
5
+ cy.visit(u.toString());
6
+ cy.GLO_getElement(['mobile$svy_nav_login', 'txt_login'], { timeout: 120000 });
7
+ cy.GLO_checkLoadingIndicator();
8
+ cy.GLO_getElement(['mobile$svy_nav_login', 'txt_login']).find('input').eq(0).should('be.enabled').should('be.visible').clear().type(username);
9
+ cy.env(['password']).then(({ password }) => {
10
+ cy.GLO_getElement(['mobile$svy_nav_login', 'txt_password'])
11
+ .find('input')
12
+ .eq(0)
13
+ .clear()
14
+ .type(password, { log: false });
15
+ });
16
+ cy.GLO_addInput(['mobile$svy_nav_login', 'company'], company);
17
+ cy.GLO_clickButton(['mobile$svy_nav_login', 'btn_login']);
18
+ cy.GLO_getElement(['gt$sidebar$base', 'logout'], { timeout: 120000 }).should('exist');
19
+ });
20
+ Cypress.Commands.add('GLT_mainNavigation', (formName, value) => {
21
+ cy.GLO_getElement([formName, 'Main_Menu']).find('button').contains(value).click();
22
+ cy.GLO_checkLoadingIndicator();
23
+ });
24
+ Cypress.Commands.add('GLT_bottomNavigation', (value) => {
25
+ cy.get('[data-cy$="gt$main.navigation_bar"] .flow_step span').contains(value).click();
26
+ cy.GLO_checkLoadingIndicator();
27
+ });
28
+ Cypress.Commands.add('GLT_enterGang', (customerCode, value) => {
29
+ const formName = `gt$main_menu_${customerCode}`;
30
+ const elementName = 'gang';
31
+ cy.GLO_addInput([formName, elementName], value);
32
+ cy.get(`[data-cy$="${formName}.${elementName}"]`).should('not.exist');
33
+ });
34
+ Cypress.Commands.add('GLT_searchHeader', (formName, value) => {
35
+ cy.GLO_addInput([formName, 'search'], value);
36
+ cy.GLO_checkLoadingIndicator();
37
+ });
38
+ Cypress.Commands.add('GLT_goHome', (formname) => {
39
+ cy.GLO_clickButton([formname, 'close'], 'fa-home');
40
+ cy.GLO_checkLoadingIndicator();
41
+ });
42
+ Cypress.Commands.add('GLT_closePopup', () => {
43
+ cy.get('.svy-dialog .window-header .svy-dialog-close').click();
44
+ cy.get('.svy-dialog', { timeout: 60000 }).should('not.exist');
45
+ });
46
+ Cypress.Commands.add('GLT_clickButtonInButtonBar', (formName, title) => {
47
+ cy.GLO_getElement([formName, 'button_bar']).find(`button[title="${title}"]`).click();
48
+ cy.GLO_checkLoadingIndicator();
49
+ });
50
+ Cypress.Commands.add('GLT_clickButton', (buttonName) => {
51
+ cy.get(`globiscomponents-button[name="${buttonName}"] .dx-button-content`).should('be.visible').click();
52
+ cy.get(`globiscomponents-button[name="${buttonName}"] .dx-button-content`).should('not.exist');
53
+ cy.GLO_checkLoadingIndicator();
54
+ });
55
+ Cypress.Commands.add('GLT_getTreeListRows', (formName, elementName, filters) => {
56
+ const getAllRows = () => cy.GLO_getElement([formName, elementName]).find('.dx-data-row');
57
+ const getLevel = (el) => parseInt(el.getAttribute('aria-level') || '0', 10);
58
+ const getRowIndex = (el) => parseInt(el.getAttribute('aria-rowindex') || '-1', 10);
59
+ const rowText = (el) => Cypress.$(el).text().toLowerCase();
60
+ const expandIfNeeded = ($row) => {
61
+ if ($row.attr('aria-expanded') === 'false') {
62
+ return cy
63
+ .wrap($row)
64
+ .find('.dx-treelist-icon-container .dx-treelist-empty-space')
65
+ .first()
66
+ .click()
67
+ .then(() => {
68
+ cy.GLO_checkLoadingIndicator();
69
+ });
70
+ }
71
+ return cy.wrap($row);
72
+ };
73
+ const getImmediateChildren = (allRows, parentEl) => {
74
+ const parentLevel = getLevel(parentEl);
75
+ const parentIdx = allRows.findIndex((r) => getRowIndex(r) === getRowIndex(parentEl));
76
+ if (parentIdx === -1)
77
+ return [];
78
+ const children = [];
79
+ for (let i = parentIdx + 1; i < allRows.length; i++) {
80
+ const level = getLevel(allRows[i]);
81
+ if (level <= parentLevel)
82
+ break;
83
+ if (level === parentLevel + 1)
84
+ children.push(allRows[i]);
85
+ }
86
+ return children;
87
+ };
88
+ // Value 0 = every candidate matching key; value N (1-based) = the Nth matching
89
+ // candidate overall, in document order, across ALL current parents combined.
90
+ const selectByValue = (candidates, key, value) => {
91
+ const byKey = candidates.filter((el) => rowText(el).includes(key.toLowerCase()));
92
+ if (Array.isArray(value)) {
93
+ return byKey.filter((el) => value.some((v) => rowText(el).includes(v.toLowerCase())));
94
+ }
95
+ if (value === 0)
96
+ return byKey;
97
+ return byKey[value - 1] ? [byKey[value - 1]] : [];
98
+ };
99
+ if (!filters || !Object.keys(filters).length) {
100
+ return getAllRows()
101
+ .each(($row) => {
102
+ expandIfNeeded($row);
103
+ })
104
+ .then(() => getAllRows());
105
+ }
106
+ const entries = Object.entries(filters);
107
+ const processLevel = (parents, entryIdx) => {
108
+ const [key, value] = entries[entryIdx];
109
+ const level = entryIdx + 1;
110
+ const isLast = entryIdx === entries.length - 1;
111
+ return getAllRows().then(($rows) => {
112
+ const allRows = $rows.toArray();
113
+ const candidates = parents === null ? allRows.filter((r) => getLevel(r) === level) : parents.flatMap((p) => getImmediateChildren(allRows, p));
114
+ const matched = selectByValue(candidates, key, value);
115
+ if (!matched.length) {
116
+ throw new Error(`GLT_getTreeListRows: No rows found for key: "${key}"`);
117
+ }
118
+ if (isLast) {
119
+ const targetIndexes = matched.map((el) => getRowIndex(el));
120
+ return getAllRows().filter((_i, el) => targetIndexes.includes(getRowIndex(el)));
121
+ }
122
+ return cy
123
+ .wrap(Cypress.$(matched))
124
+ .each(($row) => {
125
+ expandIfNeeded($row);
126
+ })
127
+ .then(() => processLevel(matched, entryIdx + 1));
128
+ });
129
+ };
130
+ return processLevel(null, 0);
131
+ });
132
+ Cypress.Commands.add('GLT_addInputDialog', (text) => {
133
+ cy.get('.svy-dialog .window-body, .svy-message-dialog .window-body', { timeout: 15000 })
134
+ .should(($el) => {
135
+ expect($el.find('input').length + $el.find('select').length, 'input or select present').to.be.greaterThan(0);
136
+ })
137
+ .then(($el) => {
138
+ const $input = $el.find('input');
139
+ const $select = $el.find('select');
140
+ if ($input.length) {
141
+ cy.wrap($input.first()).clear().type(text);
142
+ }
143
+ else {
144
+ cy.wrap($select.first()).select(text).should('have.value', text);
145
+ }
146
+ });
147
+ });
148
+ export {};
@@ -0,0 +1,85 @@
1
+ declare global {
2
+ namespace Cypress {
3
+ interface Chainable {
4
+ /**
5
+ * Command to perform login using Okta authentication into a specific portal.
6
+ */
7
+ POR_portalLogin(): void;
8
+ /**
9
+ * Custom Cypress command to click on the first link within the side menu that matches the specified text.
10
+ * It searches through elements with the class `.main-items` within the `.sidemenu-main` container.
11
+ * For each `.main-items` element, it checks if there is at least one `.item-main` present.
12
+ * If an `.item-main` is found and it contains the specified link text, the command clicks the first occurrence.
13
+ *
14
+ * @param {string} headerText - The text content of the header to be clicked.
15
+ * @param {string} linkText - The text content of the link to be clicked. This command searches for this text within `<p>` tags inside `.item-main` elements.
16
+ */
17
+ POR_clickMenuItem(menuType: clickMenuType, headerText: string | null, linkText: string): void;
18
+ /**
19
+ * Custom Cypress command to click on the first link within the side menu that matches the specified text.
20
+ * It searches through elements with the class `.main-items` within the `.sidemenu-main` container.
21
+ * For each `.main-items` element, it checks if there is at least one `.item-main` present.
22
+ * If an `.item-main` is found and it contains the specified link text, the command clicks the first occurrence.
23
+ *
24
+ * @param {string} linkText - The text content of the link to be clicked. This command searches for this text within `<p>` tags inside `.item-main` elements.
25
+ */
26
+ POR_clickTopDropdownMenu(linkText: string): void;
27
+ /**
28
+ * Retrieves the container element that holds all the center-aligned columns of a grid table.
29
+ * This is particularly useful in the context of applications using Ag-Grid, where table columns are organized within specific containers.
30
+ */
31
+ POR_checkTableHasData(): Chainable;
32
+ /**
33
+ * Asserts that the previously selected jQuery object contains at least one element.
34
+ * This command is designed to be used in a chain following a Cypress query command
35
+ *
36
+ * @param {string} className - Name of the class of the descendants that represent the empty state
37
+ */
38
+ POR_isNotEmpty(className?: string): Chainable;
39
+ /**
40
+ * Custom Cypress command to click on a dropdown menu item based on the item's visible text.
41
+ * This command is designed to work with dropdown menus that utilize the '.dx-menu-base' class
42
+ * to identify the menu container. It finds the menu item within this container that contains
43
+ * the specified text and clicks on it.
44
+ *
45
+ * @param {string} itemName - The visible text of the dropdown menu item to click. This text should
46
+ * uniquely identify the menu item within its dropdown menu.
47
+ */
48
+ POR_clickDropdownMenu(itemName: string): void;
49
+ /**
50
+ * Command to perform logout. The logout button is located in different places for different portals,
51
+ * the optional company parameter can differentiate between them.
52
+ *
53
+ * @param {string} [company] - Optional parameter representing the company name.
54
+ */
55
+ POR_logout(company?: string): void;
56
+ /**
57
+ * Command to interact with a checklist based on the provided form name, element name and the checkbox name.
58
+ *
59
+ * @param {string} formName - The name of the form containing the dropdown element.
60
+ * @param {string} elementName - The name of the dropdown element.
61
+ * @param {string} checkboxName - The name of the checkbox
62
+ *
63
+ * @remark - Not program proof meaning that if sales order is render 2 times it will fail
64
+ */
65
+ POR_checklistCData(formName: string, elementName: string, checkboxName: string): void;
66
+ /**
67
+ * Command to check the value of a field based on the provided type, form name, element name, and value.
68
+ *
69
+ * @param {string} formName - The name of the form or element containing the field.
70
+ * @param {string} elementName - The name of the field element.
71
+ * @param {string} checkboxName - The name of the checkbox
72
+ * @param {customValueTypeUndefined} value - The expected value to be checked against the field's value.
73
+ * @param {checkOperatorType} [operator='equal'] - Operator used by the function to check the value.
74
+ */
75
+ POR_checkFieldChecklist(formName: string, elementName: string, checkboxName: string, value: string, operator?: checkOperatorType): void;
76
+ /**
77
+ * Command to check if the portal sidemenu corresponds to the supplied order in the parameters.
78
+ *
79
+ * @param {string[]} menuItems - Array of menuitem names in the order that they should be displayed to the user.
80
+ */
81
+ POR_checkPortalSideMenuCorrect(menuItems: string[]): void;
82
+ }
83
+ }
84
+ }
85
+ export {};
@@ -0,0 +1,122 @@
1
+ import { equal } from '../tsHelper.js';
2
+ import { clickButtonTextHelper } from './GLO_commands.js';
3
+ Cypress.Commands.add('POR_checkPortalSideMenuCorrect', (menuItems) => {
4
+ cy.GLO_getElement(['ep$main', 'sidemenu'])
5
+ .find('.main-items .item-main , .main-items .item-header')
6
+ .should('have.length.gt', 1)
7
+ .then((elements) => {
8
+ return Cypress.$.makeArray(elements).map((el) => el.innerText);
9
+ })
10
+ .should('deep.eq', menuItems);
11
+ cy.GLO_checkLoadingIndicator();
12
+ });
13
+ Cypress.Commands.add('POR_portalLogin', () => {
14
+ cy.visit(Cypress.expose('portalUrl'));
15
+ // biome-ignore plugin: wait for portal login redirect
16
+ cy.wait(2000);
17
+ cy.origin(Cypress.expose('oktaUrl'), () => {
18
+ cy.get('.o-form-input')
19
+ .find('[autocomplete="username"]')
20
+ .type(Cypress.expose('username'));
21
+ cy.get('[type="submit"]').click();
22
+ cy.env(['password']).then(({ password }) => {
23
+ cy.get('.o-form-input')
24
+ .find('[type="password"]', { timeout: 20000 })
25
+ .type(password, { log: false });
26
+ });
27
+ cy.get('[type="submit"]').click();
28
+ });
29
+ cy.get('[data-cy="ep$main.sidemenu"]', { timeout: 120000 }).should('exist');
30
+ });
31
+ Cypress.Commands.add('POR_clickMenuItem', (menuType, headerText, linkText) => {
32
+ let formName, elementName, headerClass, itemClass;
33
+ switch (menuType) {
34
+ case 'usermenu':
35
+ formName = 'ep$linked_portal_user_dtl';
36
+ elementName = 'button_bar';
37
+ itemClass = 'button.with-label';
38
+ break;
39
+ case 'sidemenu':
40
+ formName = 'ep$main';
41
+ elementName = 'sidemenu';
42
+ headerClass = '.main-items .item-header';
43
+ itemClass = '.item-main';
44
+ break;
45
+ default:
46
+ throw new Error('Incorrect type');
47
+ }
48
+ cy.GLO_getElement([formName, elementName]).then(($root) => {
49
+ let base = cy.wrap($root);
50
+ if (headerText && headerClass) {
51
+ base = base.find(headerClass).contains('.item-header-title', headerText).parents('.item-header').next('.indent');
52
+ }
53
+ base.find(itemClass)
54
+ .filter((_, element) => element.textContent.trim() === linkText)
55
+ .click();
56
+ });
57
+ cy.GLO_checkLoadingIndicator();
58
+ });
59
+ Cypress.Commands.add('POR_clickTopDropdownMenu', (linkText) => {
60
+ cy.GLO_clickButton(['ep$consignment', 'profile']);
61
+ cy.get('.dx-item-content.dx-menu-item-content')
62
+ .filter((_index, element) => element.textContent.trim() === linkText)
63
+ .click();
64
+ cy.GLO_checkLoadingIndicator();
65
+ });
66
+ Cypress.Commands.add('POR_checkTableHasData', () => {
67
+ cy.GLO_getElement(['ep$consignment_lst', 'shipments_grid']).within(() => {
68
+ cy.get('.ag-center-cols-container').POR_isNotEmpty();
69
+ });
70
+ });
71
+ Cypress.Commands.add('POR_isNotEmpty', { prevSubject: true }, (subject, className) => {
72
+ if (className) {
73
+ cy.wrap(subject).should('not.have.descendants', className);
74
+ }
75
+ else {
76
+ // Checks if the element has any child elements
77
+ cy.wrap(subject).children().should('have.length.gt', 0);
78
+ }
79
+ });
80
+ Cypress.Commands.add('POR_clickDropdownMenu', (itemName) => {
81
+ clickButtonTextHelper(itemName, '.dx-menu-base');
82
+ });
83
+ Cypress.Commands.add('POR_logout', (company) => {
84
+ if (company === 'Neovia') {
85
+ cy.GLO_getElement(['ep$consignment', 'profile']).click();
86
+ cy.get('.cm-profile-item').contains('Logoff').click();
87
+ }
88
+ else {
89
+ cy.GLO_getElement(['ep$main', 'sidemenu']).find('.footer').find('.clickable').click();
90
+ }
91
+ cy.get('.window-footer').then(($dialog) => {
92
+ if ($dialog.find('.svy-btn-primary:contains("Yes")').length > 0) {
93
+ cy.wrap($dialog).contains('Yes').click();
94
+ }
95
+ else if ($dialog.find('.svy-btn-primary:contains("Ja")').length > 0) {
96
+ cy.wrap($dialog).contains('Ja').click();
97
+ }
98
+ else {
99
+ throw new Error('Neither "Yes" nor "Ja" options found in the dialog box.');
100
+ }
101
+ });
102
+ cy.GLO_checkLoadingIndicator();
103
+ });
104
+ Cypress.Commands.add('POR_checklistCData', (formName, elementName, checkboxName) => {
105
+ cy.get(`[data-cy="${formName}.${elementName}"]`).scrollIntoView(); // Bring the textbox into view
106
+ cy.get(`[data-cy="${formName}.${elementName}"]`)
107
+ .find('.dx-checkbox-text')
108
+ .filter(':visible')
109
+ .filter(`:contains("${checkboxName}")`)
110
+ .scrollIntoView()
111
+ .then(($element) => {
112
+ cy.wrap($element).parents('.dx-checkbox-container').click();
113
+ });
114
+ });
115
+ Cypress.Commands.add('POR_checkFieldChecklist', (formName, elementName, checkboxName, value, operator = equal) => {
116
+ cy.get(`[data-cy="${formName}.${elementName}"]`)
117
+ .find('.dx-checkbox-text')
118
+ .filter(`:contains("${checkboxName}")`)
119
+ .then(($element) => {
120
+ cy.wrap($element).parents('dx-check-box').find('input').invoke('val').should(operator, value);
121
+ });
122
+ });
@@ -0,0 +1,9 @@
1
+ type TaskHandler = (...args: unknown[]) => unknown;
2
+ export interface DefineGlobisConfigOptions {
3
+ /** Scalar e2e overrides (viewport, timeouts, ...) and/or an extra setupNodeEvents hook, run after the core one. */
4
+ e2e?: Partial<Cypress.EndToEndConfigOptions>;
5
+ /** Extra `on('task', ...)` handlers to register alongside the core ones (log/bufferWsMetrics/flushWsMetrics/set/get). */
6
+ extraTasks?: Record<string, TaskHandler>;
7
+ }
8
+ export declare function defineGlobisConfig(overrides?: DefineGlobisConfigOptions): Cypress.ConfigOptions<any>;
9
+ export {};