semiOutStream.cy.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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') && search.get('startTime').length
  26. && search.has('endTime') && search.get('endTime').length
  27. )
  28. return reply({fixture: 'semi-out-stream/search2'});
  29. const page = search.get('page');
  30. reply({fixture: `semi-out-stream/list${page}`});
  31. });
  32. exportIntercept('/askGoods/getRemovalHalfProductExcel');
  33. });
  34. it('列表', function() {
  35. validateTableList('semi_out_stream_table');
  36. const validate = validateTableSearch('semi_out_stream_table');
  37. cy.get('#filter_semiOutCode').type('code');
  38. validate('search1');
  39. cy.get('#filter_semiOutCode').clear();
  40. clickDatePicker('date_filter_semiOutDates');
  41. validate('search2');
  42. validateExport();
  43. });
  44. });