123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- import {
- loginIntercept,
- menuIntercept,
- loginSetup,
- optionsIntercept,
- dictionaryIntercept,
- menuTrigger,
- intercept,
- successIntercept,
- selectClick,
- validateTableList,
- validateTableSearch,
- validatePut,
- validateSelect,
- } from './utils';
- describe('物料管理', function() {
- beforeEach(function() {
- loginIntercept();
- menuIntercept();
- loginSetup();
- optionsIntercept();
- dictionaryIntercept();
- menuTrigger(2, 2);
- });
- beforeEach(function() {
- intercept('/dictionary/getDictionaryPage', function({search, reply}) {
- if (search.has('name') && search.get('name').length)
- return reply({fixture: 'dictonary/search1'});
- if (search.has('code') && search.get('code').length)
- return reply({fixture: 'dictonary/search2'});
- const page = search.get('page');
- reply({fixture: `dictonary/list${page}`});
- });
- successIntercept('/materialClass/updateMaterial');
- });
- const TABLE_NAME = 'goods_table',
- MODAL_NAME = 'goods_modal';
- it('表单', function() {
- validateTableList(TABLE_NAME);
- const validate = validateTableSearch(TABLE_NAME);
- cy.get('#filter_goodsName').type('name');
- validate('search1');
- cy.get('#filter_goodsName').clear();
- cy.get('#filter_goodsCode').type('code');
- validate('search2');
- });
- it.only('修改操作', function() {
- const {validateEdit} = validatePut(MODAL_NAME, '物料');
- validateEdit(TABLE_NAME, function() {
- validateSelect('select_goodsType', '546');
- cy.getTestId('field_goodsSize').should('have.value', '1');
- validateSelect('select_goodsMixin', '是');
- });
- });
- });
|