rawInStream.cy.ts 1.5 KB

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