rawInStream.cy.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {
  2. loginIntercept,
  3. menuIntercept,
  4. loginSetup,
  5. optionsIntercept,
  6. dictionaryIntercept,
  7. intoMenu,
  8. intercept,
  9. validateTableList,
  10. validateTableSearch,
  11. clickDatePicker,
  12. validateExport,
  13. exportIntercept,
  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/warehousingFlowing', function({search, reply}) {
  26. if (search.has('wllbCode') && search.get('wllbCode').length)
  27. return reply({fixture: 'raw-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: 'raw-in-stream/search2'});
  33. const page = search.get('page');
  34. reply({fixture: `raw-in-stream/list${page}`});
  35. });
  36. exportIntercept('/warehousing/export');
  37. });
  38. const TABLE_NAME = 'raw_in_stream_table';
  39. it('列表', function() {
  40. validateTableList(TABLE_NAME);
  41. const validate = validateTableSearch(TABLE_NAME);
  42. cy.get('#filter_rawMaterialCode').type('code');
  43. validate('search1');
  44. cy.get('#filter_rawMaterialCode').clear();
  45. clickDatePicker('date_filter_rawMaterialDates');
  46. validate('search2');
  47. validateExport();
  48. });
  49. });