productInStream.cy.ts 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. import {
  2. loginIntercept,
  3. menuIntercept,
  4. loginSetup,
  5. optionsIntercept,
  6. dictionaryIntercept,
  7. intoMenu,
  8. intercept,
  9. validateTableList,
  10. exportIntercept,
  11. validateExport,
  12. validateTableSearch,
  13. clickDatePicker,
  14. } from './utils';
  15. describe('产成品入库流水', function() {
  16. beforeEach(function() {
  17. loginIntercept();
  18. menuIntercept();
  19. loginSetup();
  20. optionsIntercept();
  21. dictionaryIntercept();
  22. intoMenu('流水管理', '产成品入库流水列表');
  23. });
  24. beforeEach(function() {
  25. intercept('/warehousing/getHalf', function({search, reply}) {
  26. if (search.has('wllbCode') && search.get('wllbCode').length)
  27. return reply({fixture: 'product-in-stream/search1'});
  28. if (
  29. search.has('startTime') && search.get('startTime').length
  30. && search.has('endTime') && search.get('endTime').length
  31. )
  32. return reply({fixture: 'product-in-stream/search2'});
  33. const page = search.get('page');
  34. reply({fixture: `product-in-stream/list${page}`});
  35. });
  36. exportIntercept('/warehousing/getRemovalHalfExcel');
  37. });
  38. it('表格', function() {
  39. const tableName = 'product_in_stream_table';
  40. validateTableList(tableName);
  41. const validate = validateTableSearch(tableName);
  42. cy.get('#filter_finishProductInCode').type('code');
  43. validate('search1');
  44. cy.get('#filter_finishProductInCode').clear();
  45. clickDatePicker('date_filter_finishProductInDates');
  46. validate('search2');
  47. validateExport();
  48. });
  49. });