import { loginIntercept, menuIntercept, loginSetup, intoMenu, intercept, successIntercept, validateTableList, validateTableSearch, selectClick, clickDatePicker, tableBtnClick, validateModalOperation, } from './utils'; describe('半成品入库申请', function () { beforeEach(function () { loginIntercept(); menuIntercept(); loginSetup(); intoMenu('入库管理', '半成品报工单管理'); }); beforeEach(function () { intercept('/warehousing/getNotice', function ({search, reply}) { if (search.has('materialCode') && search.get('materialCode').length) return reply({fixture: 'semi-report/search1'}); if (search.has('type') && search.get('type').length) return reply({fixture: 'semi-report/search2'}); if ( search.has('startTime') && search.get('startTime').length && search.has('endTime') && search.get('endTime').length ) return reply({fixture: 'semi-report/search3'}); const page = search.get('page'); reply({fixture: `semi-report/list${page}`}); }); successIntercept('/warehousing/addInventoryNotice'); }); const tableName = 'semi_report_table'; it('表格', function () { validateTableList(tableName); const validate = validateTableSearch(tableName); cy.get('#filter_semiReportCode').type('code'); validate('search1'); cy.get('#filter_semiReportCode').clear(); selectClick('filter_semiReportType', 1); validate('search2'); selectClick('filter_semiReportType', 0); clickDatePicker('date_filter_rawMaterialDates'); validate('search3'); }); it('入库操作', function () { tableBtnClick(tableName, 0); cy.getTestId('field_putInStoragenum').should('have.value', '80'); validateModalOperation('semi_report_modal', '入库成功'); }); });