Browse Source

feat: 增加逾期采购单测试

xyh 2 years atrás
parent
commit
bc94d85379
1 changed files with 41 additions and 0 deletions
  1. 41 0
      cypress/e2e/receiveTimeout.cy.ts

+ 41 - 0
cypress/e2e/receiveTimeout.cy.ts

@@ -0,0 +1,41 @@
+import {
+  loginIntercept,
+  menuIntercept,
+  loginSetup,
+  optionsIntercept,
+  dictionaryIntercept,
+  intoMenu,
+  intercept,
+  validateTableList,
+  validateTableSearch,
+} from './utils';
+
+describe('逾期采购单列表', function() {
+  beforeEach(function() {
+    loginIntercept();
+    menuIntercept();
+    loginSetup();
+    optionsIntercept();
+    dictionaryIntercept();
+    intoMenu('采购单管理', '逾期采购单列表');
+  });
+
+  beforeEach(function() {
+    intercept('/receiveGoods/getPastReceiveGoods', function({search, reply}) {
+      if (search.has('orderCode') && search.get('orderCode').length)
+        return reply({fixture: 'receive/search1'});
+
+      const page = search.get('page');
+      reply({fixture: `receive/list${page}`});
+    });
+  });
+
+  it('列表', function() {
+    validateTableList('receive_timeout_table');
+
+    const validate = validateTableSearch('receive_timeout_table');
+
+    cy.get('#filter_receiveCode').type('searchCode');
+    validate('search1');
+  });
+});