import { loginIntercept, menuIntercept, loginSetup, intoMenu, intercept, successIntercept, validateTableList, validateTableSearch, selectClick, tableBtnClick, validateModalOperation, } from './utils'; describe('半成品出库申请', function () { beforeEach(function () { loginIntercept(); menuIntercept(); loginSetup(); intoMenu('出库管理', '半成品领料单管理'); }); beforeEach(function () { intercept('/askGoods/getGoodsHalf', function ({search, reply}) { if (search.has('productionCode') && search.get('productionCode').length) return reply({fixture: 'semi-draw/search1'}); if (search.has('type') && search.get('type').length) return reply({fixture: 'semi-draw/search2'}); const page = search.get('page'); reply({fixture: `semi-draw/list${page}`}); }); successIntercept('/warehousing/updateInventoryNotice'); }); const tableName = 'semi_draw_table'; it('表格', function () { validateTableList(tableName); const validate = validateTableSearch(tableName); cy.get('#filter_semiDrawCode').type('code'); validate('search1'); cy.get('#filter_semiDrawCode').clear(); selectClick('filter_semiDrawType', 1); validate('search2'); }); it('出库操作', function () { tableBtnClick(tableName, 0); cy.getTestId('field_semiDrawNum').should('have.value', '100'); validateModalOperation('semi_draw_modal', '出库成功'); }); });