software.cy.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import {
  2. beforeSetup,
  3. intercept,
  4. intoMenu,
  5. generateNetworkResult,
  6. successIntercept,
  7. validateTableSearch,
  8. validateTableList,
  9. validatePut,
  10. validateDelete,
  11. } from './utils';
  12. const basicData = {
  13. id: '45',
  14. equipmentCode: '3907060140030254',
  15. softwareCode: '3599020010010141',
  16. equipmentName: '分体式直流充电机;直流240kW;六路输出;偏矩阵;50-1000V;宝马定制版',
  17. softwareName: '科密EP-9000 一二维码有线USB扫描枪;科密EP-9000 收银农资',
  18. modifyUser: null,
  19. modifyTime: null,
  20. page: 0,
  21. limit: 0,
  22. };
  23. describe('软件类绑定', function() {
  24. beforeEach(function() {
  25. beforeSetup();
  26. intoMenu('基础资料', '软件类绑定');
  27. });
  28. beforeEach(function() {
  29. intercept(
  30. '/delivery/getEquipmentBindingSoftware',
  31. function({reply, search}) {
  32. generateNetworkResult({
  33. search,
  34. reply,
  35. basicData,
  36. title: 'equipmentCode',
  37. });
  38. },
  39. );
  40. successIntercept([
  41. '/delivery/addEquipmentBindingSoftware',
  42. '/delivery/updateEquipmentBindingSoftware',
  43. '/delivery/delEquipmentBindingSoftware',
  44. ]);
  45. });
  46. it('table', function() {
  47. validateTableSearch(
  48. 'software_bind_table',
  49. ['equipmentCode', 'softwareCode'],
  50. {url: '/delivery/getEquipmentBindingSoftware', toolId: 'sofware_filter'},
  51. );
  52. validateTableList('software_bind_table');
  53. });
  54. it('operation', function() {
  55. const {validateAdd, validateEdit} = validatePut(
  56. 'software_modal',
  57. 'software_bind_table',
  58. {label: '软件类绑定'},
  59. );
  60. validateAdd([
  61. {type: 'keySelect', id: 'materialCode'},
  62. {type: 'keySelect', id: 'softwareCode'},
  63. ]);
  64. validateEdit([
  65. {id: 'materialCode', type: 'select', value: 'page-1'},
  66. {id: 'softwareCode', type: 'select', value: basicData.softwareName},
  67. ]);
  68. validateDelete(
  69. 'software_bind_table',
  70. '软件类绑定',
  71. {title: basicData.equipmentName},
  72. );
  73. });
  74. });