@things-factory/operato-wms 4.1.41 → 4.2.0

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 (62) hide show
  1. package/.eslintrc.json +11 -0
  2. package/client/pages/constants/index.js +1 -0
  3. package/client/pages/constants/inventory-item-change.js +10 -0
  4. package/client/pages/constants/order.js +5 -0
  5. package/client/pages/constants/picking-strategy.js +4 -0
  6. package/client/pages/constants/setting.js +1 -0
  7. package/client/pages/inbound/serial-number-list-popup.js +0 -1
  8. package/client/pages/inventory/inventory-adjustment-approval.js +34 -3
  9. package/client/pages/inventory/inventory-adjustment.js +144 -5
  10. package/client/pages/inventory/serial-number-list-popup.js +468 -0
  11. package/client/pages/master/pallet-list.js +24 -0
  12. package/client/pages/order/arrival-notice/edit-product-popup.js +13 -0
  13. package/client/pages/order/release-order/b2b/b2b-order-list.js +24 -1
  14. package/client/pages/order/release-order/batch-picking-popup.js +8 -0
  15. package/client/pages/outbound/inventory-assign-popup.js +3 -24
  16. package/client/pages/outbound/inventory-auto-assign-popup.js +25 -50
  17. package/client/pages/outbound/loading-product.js +3 -3
  18. package/client/pages/outbound/merged-outbound-worksheet.js +83 -16
  19. package/client/pages/outbound/packing-product.js +109 -9
  20. package/client/pages/outbound/picking-product.js +21 -8
  21. package/client/pages/outbound/picking-replacement-popup.js +5 -0
  22. package/client/pages/outbound/return-pallet-check-popup.js +7 -1
  23. package/client/pages/outbound/route-label-popup.js +464 -0
  24. package/client/pages/outbound/serial-number-popup.js +55 -26
  25. package/client/pages/outbound/single-outbound-worksheet.js +78 -11
  26. package/client/pages/outbound/sorting-product.js +125 -34
  27. package/client/pages/outbound/worksheet-batch-picking.js +3 -15
  28. package/client/pages/outbound/worksheet-picking.js +2 -6
  29. package/cypress/fixtures/globals.json +3 -0
  30. package/cypress/fixtures/master-data/location.json +31 -0
  31. package/cypress/fixtures/master-data/pallet.json +129 -0
  32. package/cypress/fixtures/master-data/palletImport.xlsx +0 -0
  33. package/cypress/fixtures/master-data/transport-driver.json +22 -0
  34. package/cypress/fixtures/master-data/transport-vehicle.json +24 -0
  35. package/cypress/fixtures/master-data/transportDriverDeletedImport.xlsx +0 -0
  36. package/cypress/fixtures/master-data/transportDriverImport.xlsx +0 -0
  37. package/cypress/fixtures/master-data/transportVehicleDeletedImport.xlsx +0 -0
  38. package/cypress/fixtures/master-data/transportVehicleImport.xlsx +0 -0
  39. package/cypress/fixtures/master-data/transportVehicleNameSizeImport.xlsx +0 -0
  40. package/cypress/fixtures/master-data/transportVehicleNameStatusImport.xlsx +0 -0
  41. package/cypress/fixtures/master-data/warehouse.json +20 -0
  42. package/cypress/fixtures/master-data/warehouseImport.xlsx +0 -0
  43. package/cypress/integration/master-data/location.spec.js +31 -0
  44. package/cypress/integration/master-data/pallet.spec.js +176 -0
  45. package/cypress/integration/master-data/transport-driver.spec.js +131 -0
  46. package/cypress/integration/master-data/transport-vehicle.spec.js +165 -0
  47. package/cypress/integration/master-data/warehouse.spec.js +135 -0
  48. package/cypress/plugins/index.js +22 -0
  49. package/cypress/support/commands.js +425 -0
  50. package/cypress/support/index.js +31 -0
  51. package/cypress.json +9 -0
  52. package/dist-server/graphql/resolvers/board-setting/board-settings.js +2 -1
  53. package/dist-server/graphql/resolvers/board-setting/board-settings.js.map +1 -1
  54. package/dist-server/opa-app-setting-constants.js +2 -1
  55. package/dist-server/opa-app-setting-constants.js.map +1 -1
  56. package/package.json +20 -10
  57. package/server/graphql/resolvers/board-setting/board-settings.ts +4 -2
  58. package/server/opa-app-setting-constants.ts +2 -1
  59. package/translations/en.json +13 -4
  60. package/translations/ko.json +12 -2
  61. package/translations/ms.json +11 -2
  62. package/translations/zh.json +11 -2
@@ -497,6 +497,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
497
497
  name
498
498
  sku
499
499
  description
500
+ pickingStrategy
500
501
  }
501
502
  bizplace {
502
503
  id
@@ -531,6 +532,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
531
532
  name
532
533
  sku
533
534
  description
535
+ pickingStrategy
534
536
  }
535
537
  bizplace {
536
538
  id
@@ -981,6 +983,7 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
981
983
  .productId="${this._selectedProduct.product.id}"
982
984
  .productName="${this._selectedProduct.product.name}"
983
985
  .productSku="${this._selectedProduct.product.sku}"
986
+ .productPickingStrategy="${this._selectedProduct.product.pickingStrategy}"
984
987
  .bizplaceId="${this._selectedProduct.bizplaceId}"
985
988
  .worksheetType="${this._worksheetType}"
986
989
  .packingType="${this._selectedProduct.packingType}"
@@ -992,13 +995,6 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
992
995
  this._spinner(true)
993
996
 
994
997
  await this.fetchOrderInventories()
995
- // await this.fetchWorksheetDetails(
996
- // this._worksheetNo,
997
- // this._selectedProduct.batchId,
998
- // this._selectedProduct.product.name,
999
- // this._selectedProduct.product.sku,
1000
- // this._selectedProduct.packingType
1001
- // )
1002
998
 
1003
999
  this._selectedProduct.completed = true
1004
1000
 
@@ -1033,14 +1029,6 @@ class WorksheetBatchPicking extends localize(i18next)(PageView) {
1033
1029
  this._spinner(true)
1034
1030
 
1035
1031
  await this.fetchOrderInventories()
1036
- // await this.fetchWorksheetDetails(
1037
- // this._worksheetNo,
1038
- // this._selectedProduct?.batchId,
1039
- // this._selectedProduct?.product?.name,
1040
- // this._selectedProduct?.product?.sku,
1041
- // this._selectedProduct?.packingType,
1042
- // this._selectedProduct.packingSize
1043
- // )
1044
1032
 
1045
1033
  this._spinner(false)
1046
1034
 
@@ -669,6 +669,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
669
669
  description
670
670
  sku
671
671
  brand
672
+ pickingStrategy
672
673
  }
673
674
  packingType
674
675
  packingSize
@@ -824,12 +825,6 @@ class WorksheetPicking extends localize(i18next)(PageView) {
824
825
  this.worksheetDetailData = { records: [] }
825
826
  }
826
827
 
827
- // this code segment is already called inside _updateGristConfig().
828
- // if (this.worksheetDetailData.records.some(e => e.cartonId)) {
829
- // const palletIdColumnIdx = this.preWsdGristConfig.columns.map(c => c.name).indexOf('palletId')
830
- // this.preWsdGristConfig.columns.splice(palletIdColumnIdx, 1, cartonIdColumnConfig)
831
- // }
832
-
833
828
  this._updateGristConfig()
834
829
  this.updateContext()
835
830
  }
@@ -1199,6 +1194,7 @@ class WorksheetPicking extends localize(i18next)(PageView) {
1199
1194
  .productId="${this._selectedProduct.product.id}"
1200
1195
  .productName="${this._selectedProduct.product.name}"
1201
1196
  .productSku="${this._selectedProduct.product.sku}"
1197
+ .productPickingStrategy="${this._selectedProduct.product.pickingStrategy}"
1202
1198
  .worksheetType="${this.worksheetType}"
1203
1199
  .bizplaceId="${this._selectedProduct.bizplaceId}"
1204
1200
  .packingType="${this._selectedProduct.packingType}"
@@ -0,0 +1,3 @@
1
+ {
2
+ "fileTypes": ["json", "csv", "xlsx", "xls"]
3
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "add1": {
3
+ "name": "C2B-03-04-2",
4
+ "type": "BUFFER",
5
+ "zone": "C2B",
6
+ "row": "03",
7
+ "column": "04",
8
+ "shelf": "2",
9
+ "status": "FULL"
10
+ },
11
+
12
+ "deleteOne": {
13
+ "name": "C2A-02-03-2",
14
+ "type": "BIN",
15
+ "zone": "C2A",
16
+ "row": "02",
17
+ "column": "03",
18
+ "shelf": "2",
19
+ "status": "FULL"
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+ }
29
+
30
+
31
+ }
@@ -0,0 +1,129 @@
1
+ {
2
+ "add1": {
3
+ "ref no.": "TEST1",
4
+ "owner": "CARZO",
5
+ "holder": "EAGLE EFFECT",
6
+ "status": "ACTIVE"
7
+ },
8
+ "add2": {
9
+ "ref no.": "TEST2",
10
+ "owner": "ENG WAH TRADING",
11
+ "holder": "EVERGREEN SPEED"
12
+ },
13
+ "add3": {
14
+ "ref no.": "TEST3",
15
+ "owner": "HIAP LIONG",
16
+ "status": "ACTIVE"
17
+ },
18
+ "add4": {
19
+ "ref no.": "TEST4",
20
+ "holder": "GREENFIELDS DAIRY MALAYSIA",
21
+ "status": "ACTIVE"
22
+ },
23
+ "add5": {
24
+ "ref no.": "TEST5",
25
+ "status": "ACTIVE"
26
+ },
27
+ "add6": {
28
+ "ref no.": "TEST6",
29
+ "owner": "HOME TEAM TRADING"
30
+ },
31
+ "add7": {
32
+ "owner": "IKHWAN INDUSTRY",
33
+ "holder": "LAY HONG FOOD CORPORATION",
34
+ "status": "ACTIVE"
35
+ },
36
+ "add8": {
37
+ "holder": "MBG FRUITS",
38
+ "status": "ACTIVE"
39
+ },
40
+ "add9": {
41
+ "ref no.": "m01",
42
+ "owner": "EL COLD CHAIN WAREHOUSE",
43
+ "holder": "EL COLD CHAIN WAREHOUSE",
44
+ "status": "ACTIVE"
45
+ },
46
+ "add10": {
47
+ "ref no.": "M01",
48
+ "owner": "EL COLD CHAIN WAREHOUSE",
49
+ "holder": "EL COLD CHAIN WAREHOUSE",
50
+ "status": "ACTIVE"
51
+ },
52
+ "delete1": {
53
+ "ref no.": "DELETE1",
54
+ "owner": "MTS FRUITS KL",
55
+ "holder": "SIN LEE RESOURCES",
56
+ "status": "ACTIVE"
57
+ },
58
+ "deleteMultiple": [
59
+ {
60
+ "ref no.": "DELETE2",
61
+ "owner": "STAND OUT MARKETING",
62
+ "holder": "TIAN AN TRADING",
63
+ "status": "ACTIVE"
64
+ },
65
+ {
66
+ "ref no.": "DELETE3",
67
+ "owner": "UNI GROUP OF COMPANIES",
68
+ "holder": "RAINBOWFRUIT",
69
+ "status": "ACTIVE"
70
+ },
71
+ {
72
+ "ref no.": "DELETE4",
73
+ "owner": "THE SEEDS AND SHORES",
74
+ "holder": "TCW GLOBAL",
75
+ "status": "ACTIVE"
76
+ }
77
+ ],
78
+ "addDeleted": {
79
+ "ref no.": "DELETED",
80
+ "owner": "THE SEEDS AND SHORES",
81
+ "holder": "TCW GLOBAL",
82
+ "status": "ACTIVE"
83
+ },
84
+ "filter1": {
85
+ "ref no.": "M04"
86
+ },
87
+ "filter2": {
88
+ "ref no.": "DAMAGED1",
89
+ "status": "DAMAGED"
90
+ },
91
+ "importNew": [
92
+ {
93
+ "ref no.": "XLSX1",
94
+ "owner": "THE SEEDS AND SHORES",
95
+ "holder": "TCW GLOBAL",
96
+ "status": "ACTIVE"
97
+ },
98
+ {
99
+ "ref no.": "XLSX2",
100
+ "owner": "THE SEEDS AND SHORES",
101
+ "holder": "TCW GLOBAL",
102
+ "status": "ACTIVE"
103
+ },
104
+ {
105
+ "ref no.": "XLSX3",
106
+ "owner": "THE SEEDS AND SHORES",
107
+ "holder": "TCW GLOBAL",
108
+ "status": "ACTIVE"
109
+ }
110
+ ],
111
+ "DELETED2": {
112
+ "ref no.": "DELETED2",
113
+ "owner": "THE SEEDS AND SHORES",
114
+ "holder": "TCW GLOBAL",
115
+ "status": "TERMINATED"
116
+ },
117
+ "DELETED3": {
118
+ "ref no.": "DELETED3",
119
+ "owner": "THE SEEDS AND SHORES",
120
+ "holder": "TCW GLOBAL",
121
+ "status": "TERMINATED"
122
+ },
123
+ "DELETED4": {
124
+ "ref no.": "DELETED4",
125
+ "owner": "THE SEEDS AND SHORES",
126
+ "holder": "TCW GLOBAL",
127
+ "status": "TERMINATED"
128
+ }
129
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "nameLetterCase": { "name": "SYAHRUL", "description": "EL Cargo Handler Sdn Bhd", "driver code": "BNW5063" },
3
+ "driverLetterCase": { "name": "HARI", "description": "EL Cargo Handler Sdn Bhd", "driver code": "VFL4872" },
4
+ "importNew": [
5
+ { "name": "EE", "description": "McDonald's Malaysia", "driver code": "VSC1234" },
6
+ { "name": "FARIS", "description": "SK Hynix", "driver code": "ABC4872" },
7
+ { "name": "WENYUN", "description": "ELC", "driver code": "WPL3321" }
8
+ ],
9
+ "importDeleted": [
10
+ { "name": "CHLOE", "description": "Rolex", "driver code": "VSC1234" },
11
+ { "name": "NAAV", "description": "KFC", "driver code": "ABC4872" },
12
+ { "name": "SUM", "description": "Samsung", "driver code": "WPL3321" }
13
+ ],
14
+ "add1": { "name": "Pierre", "description": "The Product Engineer Intern", "driver code": "PIE-01" },
15
+ "add2": { "name": "sHiVa", "description": "Test 2", "driver code": "vfp1594" },
16
+ "add3": { "name": "SHIVA", "description": "Test 3", "driver code": "VFP1594" },
17
+ "add4": { "name": "SHIVA", "description": "Test 4", "driver code": "BPW4890" },
18
+ "add5": { "name": "ALI", "description": "Test 5", "driver code": "BQR5438" },
19
+ "delete1": { "name": "DEVAN" },
20
+ "deleteMultiple": ["HARI", "GOBI", "SEEVA"],
21
+ "edit1": { "name": "AIDIL", "newName": "AIDIL MH" }
22
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "regNumberLetterCase": { "regNumber": "VHA5242", "size": "5TON", "status": "IN_USE" },
3
+ "sizeLetterCase": { "regNumber": "BMY3158", "size": "3TON", "status": "IN_USE" },
4
+ "statusLetterCase": { "regNumber": "TEST9283", "size": "CYPRESS", "status": "TEST STATUS" },
5
+ "add1": { "regNumber": "JUS123", "description": "YUSRI", "size": "Bezza", "status": "IN_USE" },
6
+ "add2": { "regNumber": "bqr5438", "description": "deven", "size": "5ton", "status": "IN_USE" },
7
+ "add3": { "regNumber": "BQR5438", "description": "DEVEN", "size": "5TON", "status": "IN_USE" },
8
+ "delete1": ["VHA5242"],
9
+ "deleteMultiple": ["VEV2847", "BNW5063", "BNP4757"],
10
+ "edit1": { "oldVal": "VFL4872", "newVal": "QQT1234" },
11
+ "edit2": { "oldVal": "SHIVA", "newVal": "CHRIS" },
12
+ "edit3": { "oldVal": "3TON", "newVal": "Kancil" },
13
+ "edit4": { "oldVal": "TEST STATUS", "newVal": "EDITED STATUS" },
14
+ "importNew": [
15
+ { "regNumber": "XLSX1234", "description": "Import Vehicle 1", "size": "Kancil", "status": "Custom" },
16
+ { "regNumber": "XLSX2345", "description": "Import Vehicle 2", "size": "Viva", "status": "IN_USE" },
17
+ { "regNumber": "XLSX3456", "description": "Import Vehicle 3", "size": "Axia", "status": "Car" }
18
+ ],
19
+ "importDeleted": [
20
+ { "regNumber": "DELETED1", "description": "deleted vehicle 1", "size": "Medium", "status": "DELETED STATUS" },
21
+ { "regNumber": "DELETED2", "description": "deleted vehicle 2", "size": "Small", "status": "DELETED STATUS" },
22
+ { "regNumber": "DELETED3", "description": "deleted vehicle 3", "size": "Big", "status": "DELETED STATUS" }
23
+ ]
24
+ }
@@ -0,0 +1,20 @@
1
+ {
2
+ "nameLetterCase": { "name": "BUFFER ROOM", "description": "BUFFER ZONE", "type": "BUFFER" },
3
+ "add1": { "name": "TEST CHILLER", "description": "TEST ADD 1", "type": "CHILLER" },
4
+ "add2": { "name": "CHILLER ROOM 1", "description": "TEST ADD 2", "type": "CHILLER" },
5
+ "add3": { "name": "chiller room 2", "description": "TEST ADD 3", "type": "CHILLER" },
6
+ "add4": { "name": "CHILLER ROOM 3", "description": "TEST ADD 4", "type": "AMBIENT" },
7
+ "add5": { "name": "chiller room 4", "description": "TEST ADD 5", "type": "AMBIENT" },
8
+ "addMultiple": [
9
+ { "name": "TEST ROOM 1", "description": "TEST MULTIPLE ADD", "type": "AMBIENT" },
10
+ { "name": "TEST ROOM 2", "description": "TEST MULTIPLE ADD", "type": "CHILLER" },
11
+ { "name": "TEST ROOM 3", "description": "TEST MULTIPLE ADD", "type": "FREEZER" }
12
+ ],
13
+ "delete1": { "name": "FREEZER ROOM 1", "description": "FREEZER -25°C", "type": "FREEZER" },
14
+ "deleteMultiple": ["FREEZER ROOM 2", "BUFFER ROOM"],
15
+ "importNew": [
16
+ { "name": "XLSX1", "description": "Importing warehouse through XLSX", "type": "CHILLER" },
17
+ { "name": "XLSX2", "description": "Testing XLSX Import", "type": "FREEZER" },
18
+ { "name": "XLSX3", "description": "Importing XLSX test", "type": "AMBIENT" }
19
+ ]
20
+ }
@@ -0,0 +1,31 @@
1
+ /// <reference types="cypress" />
2
+
3
+ describe('location', () => {
4
+ beforeEach(() => {
5
+ cy.fixture('globals').as('globals')
6
+ cy.fixture('master-data/location').as('location')
7
+ cy.visit('/domain/el-cold-chain-warehouse/locations/4fae1820-b80c-4395-a13b-c09303d2d933?name=BUFFER%20ROOM')
8
+ cy.waitGristLoad()
9
+ })
10
+
11
+ it('adds location', function () {
12
+ const data = this.location.add1
13
+ cy.addLocation(data)
14
+ cy.clickSaveButton()
15
+ cy.contains('span', 'data updated successfully').should('be.visible')
16
+ cy.recordExists(data)
17
+
18
+ it('delete a location', function () {
19
+ const data = this.location.deleteOne
20
+ cy.checkLocationRecords([data.name])
21
+ cy.clickDeleteButton()
22
+ cy.clickPopupButton('delete')
23
+ cy.contains('span', 'data deleted succesfully').should('be.visible')
24
+ cy.contains('span', data.name).should('not.exist')
25
+ })
26
+
27
+
28
+
29
+ })
30
+ })
31
+
@@ -0,0 +1,176 @@
1
+ /// <reference types="cypress" />
2
+
3
+ const path = require('path')
4
+
5
+ describe('pallet', () => {
6
+ beforeEach(() => {
7
+ cy.fixture('master-data/pallet').as('pallet')
8
+ cy.visit('/domain/el-cold-chain-warehouse/pallets')
9
+ cy.waitGristLoad()
10
+ })
11
+
12
+ it('adds a pallet [ref no., owner, holder, status]', function () {
13
+ const data = this.pallet.add1
14
+ cy.addPallet(data)
15
+ cy.clickSaveButton()
16
+ cy.toastContains('data updated successfully')
17
+ cy.palletExists(data)
18
+ })
19
+
20
+ it('adds a pallet [ref no., owner, holder]', function () {
21
+ const data = this.pallet.add2
22
+ cy.addPallet(data)
23
+ cy.clickSaveButton()
24
+ cy.toastContains('null value in column "status"')
25
+ cy.searchGrist()
26
+ cy.palletNotExists(data)
27
+ })
28
+
29
+ it('adds a pallet [ref no., owner, status]', function () {
30
+ const data = this.pallet.add3
31
+ cy.addPallet(data)
32
+ cy.clickSaveButton()
33
+ cy.toastContains('holder field is empty')
34
+ cy.searchGrist()
35
+ cy.palletNotExists(data)
36
+ })
37
+
38
+ it('adds a pallet [ref no., holder, status]', function () {
39
+ const data = this.pallet.add4
40
+ cy.addPallet(data)
41
+ cy.clickSaveButton()
42
+ cy.toastContains('owner field is empty')
43
+ cy.searchGrist()
44
+ cy.palletNotExists(data)
45
+ })
46
+
47
+ it('adds a pallet [ref no., status]', function () {
48
+ const data = this.pallet.add5
49
+ cy.addPallet(this.pallet['5'])
50
+ cy.clickSaveButton()
51
+ cy.toastContains('owner field is empty')
52
+ cy.searchGrist()
53
+ cy.palletNotExists(this.pallet['5']['ref no.'])
54
+ })
55
+
56
+ it('adds a pallet [ref no., owner]', function () {
57
+ const data = this.pallet.add6
58
+ cy.addPallet(this.pallet['6'])
59
+ cy.clickSaveButton()
60
+ cy.toastContains('holder field is empty')
61
+ cy.searchGrist()
62
+ cy.palletNotExists(this.pallet['6'])
63
+ })
64
+
65
+ it('adds a pallet [owner, holder, status]', function () {
66
+ const data = this.pallet.add7
67
+ cy.addPallet(data)
68
+ cy.clickSaveButton()
69
+ cy.toastContains('null value in column "name"')
70
+ cy.searchGrist()
71
+ cy.palletNotExists(data)
72
+ })
73
+
74
+ it('adds a pallet [holder, status]', function () {
75
+ const data = this.pallet.add8
76
+ cy.addPallet(data)
77
+ cy.clickSaveButton()
78
+ cy.toastContains('null value in column "name"')
79
+ cy.searchGrist()
80
+ cy.palletNotExists(data)
81
+ })
82
+
83
+ it('adds a duplicate pallet ref no. with a different letter case', function () {
84
+ const data = this.pallet.add9
85
+ cy.addPallet(data)
86
+ cy.clickSaveButton()
87
+ cy.toastContains('data updated successfully')
88
+ cy.palletExists(data)
89
+ })
90
+
91
+ it('adds a duplicate pallet ref no. with the same letter case', function () {
92
+ const data = this.pallet.add10
93
+ cy.addPallet(data)
94
+ cy.clickSaveButton()
95
+ cy.toastContains('duplicate key value')
96
+ })
97
+
98
+ it('deletes a pallet', function () {
99
+ const data = this.pallet.delete1
100
+ cy.checkGristRecords([data])
101
+ cy.clickDeleteButton()
102
+ cy.clickPopupButton('delete')
103
+ cy.toastContains('data deleted successfully')
104
+ cy.palletNotExists(data)
105
+ })
106
+
107
+ it('deletes 3 pallets', function () {
108
+ const pallets = this.pallet.deleteMultiple
109
+ cy.checkGristRecords(pallets)
110
+ cy.clickDeleteButton()
111
+ cy.clickPopupButton('delete')
112
+ cy.toastContains('data deleted successfully')
113
+ for (const pallet of pallets) {
114
+ cy.palletNotExists(pallet)
115
+ }
116
+ })
117
+
118
+ it('adds a deleted pallet', function () {
119
+ const data = this.pallet.addDeleted
120
+ cy.addPallet(data)
121
+ cy.clickSaveButton()
122
+ cy.toastContains('duplicate key value')
123
+ cy.searchGrist()
124
+ cy.palletNotExists(data)
125
+ })
126
+
127
+ it('filters the grist by ref no with the same letter case', function () {
128
+ const data = this.pallet.filter1
129
+ cy.get('input[name="name"]').type(`${data['ref no.']}{enter}`)
130
+ cy.palletExists(data)
131
+ cy.get('data-grid-footer').within(() => {
132
+ cy.contains('span', 'total 1 records.', { timeout: 10000 }).should('exist')
133
+ })
134
+ })
135
+
136
+ it('filters the grist by ref no with a different letter case', function () {
137
+ const data = this.pallet.filter1
138
+ cy.get('input[name="name"]').type(`${data['ref no.'].toLowerCase()}{enter}`)
139
+ cy.palletExists(data)
140
+ cy.get('data-grid-footer').within(() => {
141
+ cy.contains('span', 'total 1 records.', { timeout: 10000 }).should('exist')
142
+ })
143
+ })
144
+
145
+ it('filters the grist by status', function () {
146
+ const data = this.pallet.filter2
147
+ cy.get('select[name="status"]').select(data['status'], { force: true }).type('{enter}')
148
+ cy.palletExists(data)
149
+ cy.get('data-grid-footer').within(() => {
150
+ cy.contains('span', 'total 1 records.', { timeout: 10000 }).should('exist')
151
+ })
152
+ })
153
+
154
+ it('downloads the json, csv, xlsx, xls files', () => {
155
+ const fileTypes = this.globals.fileTypes
156
+ cy.exportGrist(path, fileTypes, 'pallet')
157
+ })
158
+
159
+ it('imports pallets from an xlsx file', function () {
160
+ const pallets = this.pallet.importNew
161
+ cy.importGrist('master-data/palletImport.xlsx')
162
+ cy.importAllPopup()
163
+ for (const pallet of pallets) {
164
+ cy.palletExists(pallet)
165
+ }
166
+ })
167
+
168
+ it('imports already deleted pallets from an xlsx file', function () {
169
+ cy.importGrist('master-data/palletDeletedImport.xlsx')
170
+ cy.importAllPopup()
171
+ cy.log('false positive')
172
+ // pending fix for import function
173
+ // code for next assertion steps goes here
174
+ // will return false positive!
175
+ })
176
+ })
@@ -0,0 +1,131 @@
1
+ /// <reference types="cypress" />
2
+
3
+ const path = require('path')
4
+
5
+ describe('transport driver', () => {
6
+ beforeEach(() => {
7
+ cy.fixture('globals').as('globals')
8
+ cy.fixture('master-data/transport-driver').as('transportDriver')
9
+ cy.visit('/domain/el-cold-chain-warehouse/transport_driver')
10
+ cy.waitGristLoad()
11
+ })
12
+
13
+ it('filters the grist by name with the same letter case', function () {
14
+ const data = this.transportDriver.nameLetterCase
15
+ cy.get('input[name="name"]').type(`${data['name']}{enter}`)
16
+ cy.waitOneRecord()
17
+ cy.recordExists(data)
18
+ })
19
+
20
+ it('filters the grist by name with a different letter case', function () {
21
+ const data = this.transportDriver.nameLetterCase
22
+ cy.get('input[name="name"]').type(`${data['name'].toLowerCase()}{enter}`)
23
+ cy.waitOneRecord()
24
+ cy.recordExists(data)
25
+ })
26
+
27
+ it('filters the grist by driver code the same letter case', function () {
28
+ const data = this.transportDriver.driverLetterCase
29
+ cy.get('input[name="driverCode"]').type(`${data['driver code']}{enter}`)
30
+ cy.waitOneRecord()
31
+ cy.recordExists(data)
32
+ })
33
+
34
+ it('filters the grist by driver code with a different letter case', function () {
35
+ const data = this.transportDriver.driverLetterCase
36
+ cy.get('input[name="driverCode"]').type(`${data['driver code'].toLowerCase()}{enter}`)
37
+ cy.waitOneRecord()
38
+ cy.recordExists(data)
39
+ })
40
+
41
+ it('downloads the json, csv, xlsx, xls files', function () {
42
+ const fileTypes = this.globals.fileTypes
43
+ cy.exportGrist(path, fileTypes, 'transport driver')
44
+ })
45
+
46
+ it('imports new drivers from an xlsx file', function () {
47
+ const data = this.transportDriver.importNew
48
+ cy.importGrist('master-data/transportDriverImport.xlsx')
49
+ cy.importAllPopup()
50
+ for (const i of data) {
51
+ cy.recordExists(i)
52
+ }
53
+ })
54
+
55
+ it('imports deleted drivers from an xlsx file', function () {
56
+ const data = this.transportDriver.importDeleted
57
+ cy.importGrist('master-data/transportDriverDeletedImport.xlsx')
58
+ cy.importAllPopup()
59
+ cy.log('false positive')
60
+ // pending fix for import function
61
+ // code for next assertion steps goes here
62
+ // will return false positive!
63
+ })
64
+
65
+ it('adds transport driver', function () {
66
+ const data = this.transportDriver.add1
67
+ cy.addTransportDriver(data)
68
+ cy.clickSaveButton()
69
+ cy.contains('span', 'data updated successfully').should('be.visible')
70
+ cy.recordExists(data)
71
+ })
72
+
73
+ it('adds duplicate [name, driver code], different letter case', function () {
74
+ const data = this.transportDriver.add2
75
+ cy.addTransportDriver(data)
76
+ cy.clickSaveButton()
77
+ cy.contains('span', 'data updated successfully').should('be.visible')
78
+ cy.recordExists(data)
79
+ })
80
+
81
+ it('adds duplicate [name, driver code], same letter case', function () {
82
+ const data = this.transportDriver.add3
83
+ cy.addTransportDriver(data)
84
+ cy.clickSaveButton()
85
+ cy.contains('span', 'duplicate key value violates unique constraint "ix_transport-driver_0"').should('be.visible')
86
+ })
87
+
88
+ it('adds duplicate name, different driver code', function () {
89
+ const data = this.transportDriver.add4
90
+ cy.addTransportDriver(data)
91
+ cy.clickSaveButton()
92
+ cy.contains('span', 'data updated successfully').should('be.visible')
93
+ cy.recordExists(data)
94
+ })
95
+
96
+ it('adds different name, duplicate driver code', function () {
97
+ const data = this.transportDriver.add5
98
+ cy.addTransportDriver(data)
99
+ cy.clickSaveButton()
100
+ cy.contains('span', 'data updated successfully').should('be.visible')
101
+ cy.recordExists(data)
102
+ })
103
+
104
+ it('deletes a transport driver', function () {
105
+ const data = this.transportDriver.delete1
106
+ cy.checkGristRecords([data.name])
107
+ cy.clickDeleteButton()
108
+ cy.clickPopupButton('delete')
109
+ cy.contains('span', 'data deleted successfully').should('be.visible')
110
+ cy.contains('span', data.name).should('not.exist')
111
+ })
112
+
113
+ it('deletes 3 transport drivers', function () {
114
+ const names = this.transportDriver.deleteMultiple
115
+ cy.checkGristRecords(names)
116
+ cy.clickDeleteButton()
117
+ cy.clickPopupButton('delete')
118
+ cy.contains('span', 'data deleted successfully').should('be.visible')
119
+ for (const name of names) {
120
+ cy.contains('span', name).should('not.exist')
121
+ }
122
+ })
123
+
124
+ it('edits a transport driver', function () {
125
+ const data = this.transportDriver.edit
126
+ cy.editField(data.oldVal, data.newVal)
127
+ cy.clickSaveButton()
128
+ cy.contains('span', 'data updated successfully').should('be.visible')
129
+ cy.contains('span', data.newName).should('exist')
130
+ })
131
+ })