semiOutStream.cy.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {
  2. loginIntercept,
  3. menuIntercept,
  4. loginSetup,
  5. intoMenu,
  6. intercept,
  7. validateTableList,
  8. validateTableSearch,
  9. clickDatePicker,
  10. validateExport,
  11. exportIntercept,
  12. } from './utils';
  13. describe('半成品出库流水', function () {
  14. beforeEach(function () {
  15. loginIntercept();
  16. menuIntercept();
  17. loginSetup();
  18. intoMenu('出库管理', '半成品出库流水列表');
  19. });
  20. beforeEach(function () {
  21. intercept('/askGoods/getRemovalHalfProduct', function ({search, reply}) {
  22. if (search.has('wllbCode') && search.get('wllbCode').length)
  23. return reply({fixture: 'semi-out-stream/search1'});
  24. if (
  25. search.has('startTime') &&
  26. search.get('startTime').length &&
  27. search.has('endTime') &&
  28. search.get('endTime').length
  29. )
  30. return reply({fixture: 'semi-out-stream/search2'});
  31. const page = search.get('page');
  32. reply({fixture: `semi-out-stream/list${page}`});
  33. });
  34. exportIntercept('/askGoods/getRemovalHalfProductExcel');
  35. });
  36. it('列表', function () {
  37. validateTableList('semi_out_stream_table');
  38. const validate = validateTableSearch('semi_out_stream_table');
  39. cy.get('#filter_semiOutCode').type('code');
  40. validate('search1');
  41. cy.get('#filter_semiOutCode').clear();
  42. clickDatePicker('date_filter_semiOutDates');
  43. validate('search2');
  44. validateExport();
  45. });
  46. });