Jelajahi Sumber

feat: 入库流水增加测试

xyh 2 tahun lalu
induk
melakukan
6b5c988050

+ 59 - 0
cypress/e2e/rawInStream.cy.ts

@@ -0,0 +1,59 @@
+import {
+  loginIntercept,
+  menuIntercept,
+  loginSetup,
+  optionsIntercept,
+  dictionaryIntercept,
+  intoMenu,
+  intercept,
+  validateTableList,
+  validateTableSearch,
+  clickDatePicker,
+  validateExport,
+  exportIntercept,
+} from './utils';
+
+describe('入库流水管理', function() {
+  beforeEach(function() {
+    loginIntercept();
+    menuIntercept();
+    loginSetup();
+    optionsIntercept();
+    dictionaryIntercept();
+    intoMenu('流水管理', '入库流水列表');
+  });
+
+  beforeEach(function() {
+    intercept('/warehousing/warehousingFlowing', function({search, reply}) {
+      if (search.has('wllbCode') && search.get('wllbCode').length)
+        return reply({fixture: 'raw-in-stream/search1'});
+      if (
+        search.has('startTime') && search.get('startTime').length
+          && search.has('endTime') && search.get('endTime').length
+      )
+        return reply({fixture: 'raw-in-stream/search2'});
+
+      const page = search.get('page');
+      reply({fixture: `raw-in-stream/list${page}`});
+    });
+
+    exportIntercept('/warehousing/export');
+  });
+
+  const TABLE_NAME = 'raw_in_stream_table';
+
+  it('列表', function() {
+    validateTableList(TABLE_NAME);
+
+    const validate = validateTableSearch(TABLE_NAME);
+
+    cy.get('#filter_rawMaterialCode').type('code');
+    validate('search1');
+
+    cy.get('#filter_rawMaterialCode').clear();
+    clickDatePicker('date_filter_rawMaterialDates');
+    validate('search2');
+
+    validateExport();
+  });
+});

+ 1 - 1
cypress/fixtures/menu/basic.json

@@ -81,7 +81,7 @@
     },
     {
       "id": "54",
-      "name": "入库流水",
+      "name": "入库流水列表",
       "url": "/stream/rawin",
       "pId": "53",
       "idCode": null,

+ 98 - 0
cypress/fixtures/raw-in-stream/list1.json

@@ -0,0 +1,98 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "21",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "22",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "23",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 74 - 0
cypress/fixtures/raw-in-stream/list2.json

@@ -0,0 +1,74 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "21",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "22",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 98 - 0
cypress/fixtures/raw-in-stream/search1.json

@@ -0,0 +1,98 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "21",
+        "wllbCode": "search1",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "22",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "23",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}

+ 98 - 0
cypress/fixtures/raw-in-stream/search2.json

@@ -0,0 +1,98 @@
+{
+  "msg": "200",
+  "data": {
+    "total": 12,
+    "list": [
+      {
+        "id": "21",
+        "wllbCode": "search2",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "22",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      },
+      {
+        "id": "23",
+        "wllbCode": "123",
+        "supplierId": null,
+        "supplierName": "供应商1",
+        "serial": "1",
+        "producDate": "20221020",
+        "producBatch": "20221020",
+        "capacity": "320",
+        "process": null,
+        "seq": "0",
+        "type": "1",
+        "userId": null,
+        "departmentId": null,
+        "storageLocationCode": null,
+        "scrq": "2023-03-06 15:38:19",
+        "userName": "admin",
+        "departmentName": "仓储部门",
+        "storageLocationName": "1号库位",
+        "startTime": null,
+        "endTime": null,
+        "page": 0,
+        "limit": 0
+      }
+    ],
+    "pageNum": 1,
+    "pageSize": 10,
+    "size": 1,
+    "startRow": 1,
+    "endRow": 1,
+    "pages": 1,
+    "prePage": 0,
+    "nextPage": 0,
+    "isFirstPage": true,
+    "isLastPage": true,
+    "hasPreviousPage": false,
+    "hasNextPage": false,
+    "navigatePages": 8,
+    "navigatepageNums": [
+      1
+    ],
+    "navigateFirstPage": 1,
+    "navigateLastPage": 1
+  }
+}