productInStream.cy.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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') &&
  30. search.get('startTime').length &&
  31. search.has('endTime') &&
  32. search.get('endTime').length
  33. )
  34. return reply({fixture: 'product-in-stream/search2'});
  35. const page = search.get('page');
  36. reply({fixture: `product-in-stream/list${page}`});
  37. });
  38. exportIntercept('/warehousing/getRemovalHalfExcel');
  39. });
  40. it('表格', function () {
  41. const tableName = 'product_in_stream_table';
  42. validateTableList(tableName);
  43. const validate = validateTableSearch(tableName);
  44. cy.get('#filter_finishProductInCode').type('code');
  45. validate('search1');
  46. cy.get('#filter_finishProductInCode').clear();
  47. clickDatePicker('date_filter_finishProductInDates');
  48. validate('search2');
  49. validateExport();
  50. });
  51. });