semiDraw.cy.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {
  2. loginIntercept,
  3. menuIntercept,
  4. loginSetup,
  5. intoMenu,
  6. intercept,
  7. successIntercept,
  8. validateTableList,
  9. validateTableSearch,
  10. selectClick,
  11. tableBtnClick,
  12. validateModalOperation,
  13. } from './utils';
  14. describe('半成品出库申请', function () {
  15. beforeEach(function () {
  16. loginIntercept();
  17. menuIntercept();
  18. loginSetup();
  19. intoMenu('出库管理', '半成品领料单管理');
  20. });
  21. beforeEach(function () {
  22. intercept('/askGoods/getGoodsHalf', function ({search, reply}) {
  23. if (search.has('productionCode') && search.get('productionCode').length)
  24. return reply({fixture: 'semi-draw/search1'});
  25. if (search.has('type') && search.get('type').length)
  26. return reply({fixture: 'semi-draw/search2'});
  27. const page = search.get('page');
  28. reply({fixture: `semi-draw/list${page}`});
  29. });
  30. successIntercept('/warehousing/updateInventoryNotice');
  31. });
  32. const tableName = 'semi_draw_table';
  33. it('表格', function () {
  34. validateTableList(tableName);
  35. const validate = validateTableSearch(tableName);
  36. cy.get('#filter_semiDrawCode').type('code');
  37. validate('search1');
  38. cy.get('#filter_semiDrawCode').clear();
  39. selectClick('filter_semiDrawType', 1);
  40. validate('search2');
  41. });
  42. it('出库操作', function () {
  43. tableBtnClick(tableName, 0);
  44. cy.getTestId('field_semiDrawNum').should('have.value', '100');
  45. validateModalOperation('semi_draw_modal', '出库成功');
  46. });
  47. });