소스 검색

测试新增 售前项目完成

XuZinan 2 년 전
부모
커밋
47ea78c249
1개의 변경된 파일92개의 추가작업 그리고 7개의 파일을 삭제
  1. 92 7
      src/pages/PurchaseAdmin/PurchaseList/Approval/test/ListAdd.test.js

+ 92 - 7
src/pages/PurchaseAdmin/PurchaseList/Approval/test/ListAdd.test.js

@@ -85,12 +85,97 @@ describe('ListAdd', () => {
 
     //项目类别  售前
 
-/*
-    /html/body/div[4]/div/div/div/div[2]/div[1]/div/div/div[1]/div
-    /html/body/div[5]/div/div/div/div[2]/div[1]/div/div/div[1]/div
-    
-    body > div:nth-child(7) > div > div > div > div.rc-virtual-list > div.rc-virtual-list-holder > div > div > div.ant-select-item.ant-select-item-option.ant-select-item-option-active > div
-    body > div:nth-child(8) > div > div > div > div.rc-virtual-list > div.rc-virtual-list-holder > div > div > div.ant-select-item.ant-select-item-option.ant-select-item-option-active > div
-*/
+    /*
+    项目类别
+    body > div:nth-child(6) > div > div > div > div.rc-virtual-list > div.rc-virtual-list-holder > div > div
+
+    行业名称
+    body > div:nth-child(7) > div > div > div > div.rc-virtual-list > div.rc-virtual-list-holder > div > div
+
+    项目地区
+    body > div:nth-child(8) > div > div > div > div > div > div.ant-select-tree-list > div.ant-select-tree-list-holder > div > div
+
+    项目期数
+    body > div:nth-child(9) > div > div > div > div.rc-virtual-list > div.rc-virtual-list-holder > div > div
+
+    需按类别->名称->地区->期数顺序点击,否则nth-child顺序会改变
+    */
+
+    await page.click('.addModal form > div:nth-child(2) .ant-select-selector');
+    await page.waitFor(500);
+    await page.click('body > div:nth-child(6) .rc-virtual-list-holder .ant-select-item');
+    await page.waitFor(500);
+    input = await page.$eval(
+      '.addModal form > div:nth-child(2) .ant-select-selector .ant-select-selection-item',
+      e => e.innerHTML
+    );
+    expect(input).toMatch('投资');
+
+    input = await page.$eval(
+      '.addModal form > div:nth-child(3) .ant-select-selector .ant-select-selection-item',
+      e => e.innerHTML
+    );
+    expect(input).toBe('销售立项');
+
+    //行业名称
+    await page.click('.addModal form > div:nth-child(5) .ant-select-selector');
+    await page.waitFor(500);
+    await page.click('body > div:nth-child(7) .rc-virtual-list-holder .ant-select-item');
+    await page.waitFor(500);
+    input = await page.$eval(
+      '.addModal form > div:nth-child(5) .ant-select-selector .ant-select-selection-item',
+      e => e.innerHTML
+    );
+    expect(input).toMatch('市政');
+
+    //项目地区
+    await page.click('.addModal form > div:nth-child(6) .ant-select-selector');
+    await page.waitFor(500);
+    await page.click('.ant-select-tree-list-holder-inner :nth-child(5) :nth-child(2)');
+    await page.waitFor(500);
+    await page.click('.ant-select-tree-list-holder-inner :nth-child(6)');
+    await page.waitFor(500);
+    input = await page.$eval(
+      '.addModal form > div:nth-child(6) .ant-select-selector .ant-select-selection-item',
+      e => e.innerHTML
+    );
+    expect(input).toMatch('合肥');
+
+    //项目期数
+    await page.click('.addModal form > div:nth-child(8) .ant-select-selector');
+    await page.waitFor(500);
+    await page.click('body > div:nth-child(9) .rc-virtual-list-holder .ant-select-item');
+    await page.waitFor(500);
+    input = await page.$eval(
+      '.addModal form > div:nth-child(8) .ant-select-selector .ant-select-selection-item',
+      e => e.innerHTML
+    );
+    expect(input).toMatch('一期');
+
+    //项目编号确认
+    input = await page.$eval(
+      '.addModal form > div:nth-child(9) .ant-form-item-control-input-content',
+      e => e.innerHTML
+    );
+    expect(input).toMatch('IV-MU-551-TST-1');
+
+    //新建项目通过
+    await page.click('.addModal button.ant-btn.ant-btn-primary');
+    await page.waitFor(500);
+
+    do {
+      input = await page.$('.ant-spin-spinning');
+      await page.waitFor(500);
+    } while (input);
+
+    //确认新新项目信息
+    input = await page.$eval('.ant-table-row :nth-child(1)', e => e.innerHTML);
+    expect(input).toBe('IVMU551TST1');
+    input = await page.$eval('.ant-table-row :nth-child(2)', e => e.innerHTML);
+    expect(input).toBe('页面测试');
+    input = await page.$eval('.ant-table-row :nth-child(3)', e => e.innerHTML);
+    expect(input).toMatch('投资');
+    input = await page.$eval('.ant-table-row :nth-child(4)', e => e.innerHTML);
+    expect(input).toBe('销售立项');
   });
 });