agv.cy.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import {
  2. beforeSetup,
  3. generateNetworkResult,
  4. intercept,
  5. intoMenu,
  6. successIntercept,
  7. tableBtnClick,
  8. validateDialog,
  9. validateMessageContent,
  10. validatePut,
  11. validateTableList,
  12. validateTableSearch,
  13. } from './utils';
  14. const basicData = {
  15. id: '1',
  16. station: 'ZK-15',
  17. type: '1',
  18. modifyUser: 'yunwei',
  19. modifyTime: '2023-06-08 14:49:37',
  20. page: 0,
  21. limit: 0,
  22. editType: null,
  23. };
  24. const options = [
  25. {
  26. id: '1',
  27. station: 'ZK-16及内侧线体共用',
  28. type: null,
  29. modifyUser: null,
  30. modifyTime: null,
  31. page: 0,
  32. limit: 0,
  33. editType: null,
  34. },
  35. {
  36. id: '2',
  37. station: 'ZK-15',
  38. type: null,
  39. modifyUser: null,
  40. modifyTime: null,
  41. page: 0,
  42. limit: 0,
  43. editType: null,
  44. },
  45. ];
  46. describe('agv', function() {
  47. beforeEach(function() {
  48. beforeSetup();
  49. intoMenu('出库管理', 'AGV管理');
  50. });
  51. beforeEach(function() {
  52. successIntercept(['/agv/editAgv']);
  53. intercept('/agv/getAgvStation', function({reply, search}) {
  54. generateNetworkResult({search, reply, basicData, title: 'station'});
  55. });
  56. intercept('/agv/getAgvPoint', function({reply}) {
  57. reply({
  58. body: {
  59. msg: '200',
  60. data: options,
  61. },
  62. });
  63. });
  64. });
  65. it('table', function() {
  66. validateTableList('agv_table');
  67. validateTableSearch(
  68. 'agv_table',
  69. [
  70. {type: 'select', id: 'type', value: '0'},
  71. {type: 'select', id: 'station', value: 'ZK-16及内侧线体共用'},
  72. ],
  73. {toolId: 'agv_filter', url: '/agv/getAgvStation'},
  74. );
  75. });
  76. it('options', function() {
  77. const {validateAdd} = validatePut(
  78. 'agv_modal',
  79. 'agv_table',
  80. {
  81. label: '调度任务',
  82. },
  83. );
  84. validateAdd([{id: 'station', type: 'select'}]);
  85. tableBtnClick('agv_table', 0);
  86. validateDialog('确认收货', '你确定此任务已收货吗?', {confirm: true});
  87. validateMessageContent('已确认收货');
  88. });
  89. });