import { loginIntercept, menuIntercept, loginSetup, intoMenu, intercept, validateTableList, validateTableSearch, clickDatePicker, validateExport, exportIntercept, } from './utils'; describe('半成品出库流水', function () { beforeEach(function () { loginIntercept(); menuIntercept(); loginSetup(); intoMenu('出库管理', '半成品出库流水列表'); }); beforeEach(function () { intercept('/askGoods/getRemovalHalfProduct', function ({search, reply}) { if (search.has('wllbCode') && search.get('wllbCode').length) return reply({fixture: 'semi-out-stream/search1'}); if ( search.has('startTime') && search.get('startTime').length && search.has('endTime') && search.get('endTime').length ) return reply({fixture: 'semi-out-stream/search2'}); const page = search.get('page'); reply({fixture: `semi-out-stream/list${page}`}); }); exportIntercept('/askGoods/getRemovalHalfProductExcel'); }); it('列表', function () { validateTableList('semi_out_stream_table'); const validate = validateTableSearch('semi_out_stream_table'); cy.get('#filter_semiOutCode').type('code'); validate('search1'); cy.get('#filter_semiOutCode').clear(); clickDatePicker('date_filter_semiOutDates'); validate('search2'); validateExport(); }); });