Commit d7f15c1c569886017a8198f780d44c9363397bab

Authored by zengjin
1 parent 0571f514

提交并且覆盖之前的

src/main/java/com/buyer/testSuite/TestAddToCart.java
... ... @@ -24,9 +24,6 @@ public class TestAddToCart extends BaseTest {
24 24 public void setUp() {
25 25 initBuyer();
26 26 loginBuyerValid(Model.getBuyerAccount(),Model.getBuyerPassword());
27   -// loginBuyerValid("buyer51551@essa.cn","essa123");
28   -// Model.setIsactivity(1);
29   -// Model.setSkuNo("");
30 27 }
31 28 @AfterClass
32 29 public void tearDown() {
... ...
src/main/java/com/essa/framework/EnvEnum.java
... ... @@ -8,10 +8,10 @@ import java.util.concurrent.ConcurrentHashMap;
8 8 import java.util.concurrent.atomic.AtomicReference;
9 9  
10 10 public enum EnvEnum {
  11 + SIT("sit","SIT"),
11 12 DIT("dit","DIT"),
12 13 HOTFIX("hotfix","HOTFIX"),
13 14 UAT("uat","UAT"),
14   - SIT("sit","SIT"),
15 15 EPD("epd","EPD");
16 16  
17 17 /**
... ...
src/main/java/com/essa/framework/Model.java
... ... @@ -13,12 +13,12 @@ public class Model {
13 13 public static String email = "buyer"+Tools.getTime()+"@essa.cn";//采购商邮箱
14 14 public static String invateCode;//邀请码
15 15 public static String env;//所选环境
16   - public static String buyerAccount;//采购商账号
17   - public static String buyerPassword;//采购商密码
18   - public static String poNum;//po单号
  16 + public static String buyerAccount="meng18@essa.cn";//采购商账号
  17 + public static String buyerPassword="essa123";//采购商密码
  18 + public static String poNum="A181115T9194I";//po单号
19 19 public static int isactivity=0;//是否是活动商品 1:是 0:否
20 20 public static String manager;//商品的类目经理
21   - public static String serialNum;//待办流水号
  21 + public static String serialNum="RW2018060800058";//待办流水号
22 22 public static String materialName;//物料名称
23 23 public static String projectName;//项目立项书名称
24 24  
... ...
src/main/java/com/essa/pageObject/DocumentaryManage/BillingCenterPage.java 0 → 100644
... ... @@ -0,0 +1,161 @@
  1 +package com.essa.pageObject.DocumentaryManage;
  2 +
  3 +import com.essa.framework.BasePage;
  4 +import com.essa.framework.Model;
  5 +import com.essa.pageObject.HomePage;
  6 +import org.openqa.selenium.By;
  7 +import org.openqa.selenium.WebDriver;
  8 +import org.openqa.selenium.WebElement;
  9 +import org.openqa.selenium.support.FindBy;
  10 +import org.testng.asserts.SoftAssert;
  11 +
  12 +/**
  13 +* @Description: 发单中心页面
  14 +* @Author: ZengJin
  15 +* @CreateTime: 2018/10/31
  16 +*/
  17 +public class BillingCenterPage extends BasePage {
  18 + /**
  19 + * 构造方法
  20 + *
  21 + * @param driver
  22 + */
  23 + public BillingCenterPage(WebDriver driver) {
  24 + super(driver);
  25 + }
  26 + /**
  27 + * 元素定位
  28 + */
  29 + @FindBy (xpath = "//*[@ng-model='query.params.keyword']")
  30 + WebElement keyword;//关键字搜索框
  31 +
  32 + @FindBy (xpath = "//*[text()='高级查询']")
  33 + WebElement advancedSearch;//高级查询
  34 +
  35 + @FindBy (xpath = "//*[@ng-model='query.params.poCode']")
  36 + WebElement PONum;//根据PO单号查询
  37 +
  38 + @FindBy (xpath = "//*[@ng-click='richSearch()']")
  39 + WebElement search;//高级查询:查询按钮
  40 +
  41 + @FindBy (xpath = "//*[text()='开始发单']")
  42 + WebElement send;//开始发单按钮
  43 +
  44 + @FindBy (xpath = "//*[text()='登记接单']")
  45 + WebElement accept;//登记接单按钮
  46 +
  47 + @FindBy (xpath = "//tbody//tr[1]/td[1]")
  48 + WebElement firstFo;//第一个FO单编号
  49 +
  50 + @FindBy (xpath = "//tbody//tr[1]/td[3]")
  51 + WebElement status;//第一个FO单发单状态
  52 +
  53 + @FindBy (xpath = "//*[@ng-model='scanValue']")
  54 + WebElement FOKeyword;//弹框里的FO单号查询输入框
  55 +
  56 + @FindBy (xpath = "//*[@ng-click='clickBtn()']")
  57 + WebElement FOSearch;//FO查询搜索框
  58 +
  59 + @FindBy (xpath = "//*[@ng-click='sendBill()']")
  60 + WebElement sendBill;//开始发单按钮
  61 +
  62 + @FindBy (xpath = "//*[@ng-click='acceptBill()']")
  63 + WebElement acceptBill;//接单完成
  64 +
  65 + @FindBy (xpath = "//div[@class='left ng-scope']//span[2]")
  66 + WebElement total;//一共有多少个FO单
  67 +
  68 + @FindBy (xpath = "//button[contains(text(),'50')]")
  69 + WebElement show50;//分页展示50个
  70 +
  71 + /**
  72 + * 页面方法
  73 + */
  74 + /**
  75 + *单个Fo单的发单方法
  76 + * @param
  77 + * @return homePage
  78 + */
  79 + public HomePage Billing(){
  80 + forceWait(2000);
  81 + sendKeys(keyword,"程序仍在进行,等待页面加载完成中……");
  82 + forceWait(4000);
  83 + dynamicLoad(By.xpath("//*[text()='对不起!没有查询到相关数据。']"));
  84 + clear(keyword);
  85 + click(advancedSearch);
  86 + sendKeys(PONum,Model.getPoNum());
  87 + click(search);
  88 + dynamicLoad();
  89 + String FO = firstFo.getText();
  90 + click(send);
  91 + sendKeys(FOKeyword,FO);
  92 + click(FOSearch);
  93 + forceWait(500);
  94 + click(sendBill);
  95 + forceWait(500);
  96 + SoftAssert softAssert = new SoftAssert();
  97 + softAssert.assertEquals(status.getText(),"发单中","发单失败!");
  98 + click(accept);
  99 + sendKeys(FOKeyword,FO);
  100 + click(FOSearch);
  101 + forceWait(500);
  102 + click(acceptBill);
  103 + forceWait(500);
  104 + softAssert.assertEquals(status.getText(),"已接单","接单失败!");
  105 + softAssert.assertAll();
  106 + return new HomePage(driver);
  107 + }
  108 + /**
  109 + *多个FO单时的发单
  110 + * @param
  111 + * @return
  112 + */
  113 + public HomePage MoreBilling(){
  114 + forceWait(2000);
  115 + sendKeys(keyword,"程序仍在进行,等待页面加载完成中……");
  116 + forceWait(4000);
  117 + dynamicLoad(By.xpath("//*[text()='对不起!没有查询到相关数据。']"));
  118 + clear(keyword);
  119 + click(advancedSearch);
  120 + sendKeys(PONum,Model.getPoNum());
  121 + click(search);
  122 + dynamicLoad();
  123 + int totalNum = Integer.parseInt(total.getText());//根据分页获取FO单总数
  124 + if (totalNum>10){
  125 + click(show50);
  126 + forceWait(1000);
  127 + }
  128 + for(int i=1;i<=totalNum;i++){
  129 + WebElement FOs = driver.findElement(By.xpath("//tbody//tr["+i+"]/td[1]"));//获取Fo单号
  130 + WebElement FoStatus = driver.findElement(By.xpath("//tbody//tr["+i+"]/td[3]"));//当前FO单状态
  131 + String FO = FOs.getText();
  132 + switch (FoStatus.getText()){
  133 + case "制单中" :
  134 + click(send);
  135 + sendKeys(FOKeyword,FO);
  136 + click(FOSearch);
  137 + forceWait(500);
  138 + click(sendBill);
  139 + forceWait(500);
  140 + click(accept);
  141 + sendKeys(FOKeyword,FO);
  142 + click(FOSearch);
  143 + forceWait(500);
  144 + click(acceptBill);
  145 + forceWait(500);
  146 + break;
  147 + case "发单中" :
  148 + click(accept);
  149 + sendKeys(FOKeyword,FO);
  150 + click(FOSearch);
  151 + forceWait(500);
  152 + click(acceptBill);
  153 + forceWait(500);
  154 + break;
  155 + default :
  156 + break;
  157 + }
  158 + }
  159 + return new HomePage(driver);
  160 + }
  161 +}
... ...
src/main/java/com/essa/pageObject/DocumentaryManage/POBoardPage.java
... ... @@ -107,9 +107,9 @@ public class POBoardPage extends BasePage {
107 107 String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy");
108 108 sendKeys(inutLoadDate,date);
109 109 click(loadDate);
110   - forceWait(3000);
  110 + forceWait(1000);
111 111 click(submit);
112   - forceWait(2000);
  112 +// forceWait(2000);
113 113 return new POBoardPage(driver);
114 114 }
115 115  
... ...
src/main/java/com/essa/pageObject/DocumentaryManage/PODocumentaryListPage.java
... ... @@ -63,13 +63,13 @@ public class PODocumentaryListPage extends BasePage {
63 63 * @return
64 64 */
65 65 public PODocumentaryListPage toPoFollowDetail(){
  66 + forceWait(1000);
66 67 sendKeys(keySearch, Model.getPoNum());
67 68 click(magnifierSearch);
68   - forceWait(8000);
69   - dynamicWait(By.xpath("//div[@class='row xxrow-header-bg row-border-bottom no-margin padding-horizontal-5']"));
  69 + dynamicLoad();
70 70 click(followDetail);
71   - forceWait(8000);
72   - dynamicWait(By.xpath("//div[@class='panel-body']"));
  71 + forceWait(3000);
  72 + dynamicLoad();
73 73 return new PODocumentaryListPage(driver);
74 74 }
75 75 }
... ...
src/main/java/com/essa/pageObject/DocumentaryManage/ReceiptCorePage.java
1 1 package com.essa.pageObject.DocumentaryManage;
2 2  
3 3 import com.essa.framework.BasePage;
  4 +import com.essa.framework.Model;
4 5 import org.openqa.selenium.By;
5 6 import org.openqa.selenium.WebDriver;
6 7 import org.openqa.selenium.WebElement;
... ... @@ -97,15 +98,15 @@ public class ReceiptCorePage extends BasePage {
97 98 * 前台发单中心页面
98 99 */
99 100  
100   - public void BillOrder(String PO_Code) {
  101 + public void BillOrder() {
101 102  
102 103 dynamicWait(By.xpath("//tbody//tr[1]"));
103 104  
104 105 click(advancedQuery);
105   - forceWait(1000);
  106 +// forceWait(1000);
106 107  
107   - sendKeys(PO_numbers,PO_Code);
108   - forceWait(1000);
  108 + sendKeys(PO_numbers, Model.getPoNum());
  109 +// forceWait(1000);
109 110  
110 111 click(Query);
111 112 // forceWait(3000);
... ... @@ -115,20 +116,20 @@ public class ReceiptCorePage extends BasePage {
115 116 // actionDoubleClick(document_code); // 双击元素
116 117 // forceWait(1000);
117 118 String Fo = document_code.getText();
118   - forceWait(1000);
  119 +// forceWait(1000);
119 120  
120 121 click(start_billing);
121 122 forceWait(1000);
122 123 sendKeys(input_document_code,Fo);
123   - forceWait(1000);
  124 +// forceWait(1000);
124 125  
125 126 click(search);
126   - forceWait(1000);
  127 + forceWait(500);
127 128  
128 129 click(start_billing_1);
129   - forceWait(1000);
  130 +// forceWait(1000);
130 131 // isVisibility(By.xpath("//*[contains(text(),'所选的工厂订单状态必须为“发单中”')]"));
131   -
  132 + dynamicLoad();
132 133 click(start_billing);
133 134 forceWait(1000);
134 135  
... ...
src/main/java/com/essa/pageObject/HomePage.java
1 1 package com.essa.pageObject;
2 2  
  3 +import com.essa.pageObject.DocumentaryManage.BillingCenterPage;
3 4 import com.essa.pageObject.DocumentaryManage.POBoardPage;
4 5 import com.essa.pageObject.DocumentaryManage.ReceiptCorePage;
5 6 import com.essa.pageObject.GoodsManage.*;
... ... @@ -188,6 +189,10 @@ public class HomePage extends BasePage{
188 189 @FindBy (xpath = "//a[@name='child.text'][contains(text(),'装柜任务管理')]")
189 190 WebElement loadContainerTask;
190 191  
  192 + //前台发单中心
  193 + @FindBy (xpath = "//*[text()='前台发单中心']")
  194 + WebElement billingCenter;
  195 +
191 196  
192 197 /*
193 198 * 方法
... ... @@ -397,6 +402,7 @@ public class HomePage extends BasePage{
397 402 * @return PO跟单列表页
398 403 */
399 404 public PODocumentaryListPage toPoDocumentaryListPage() {
  405 + getHome();
400 406 click(DocumentaryManage);
401 407 click(PODocumentary);
402 408 return new PODocumentaryListPage(driver);
... ... @@ -417,6 +423,7 @@ public class HomePage extends BasePage{
417 423 * @return 收货任务管理页面
418 424 */
419 425 public GoodsReceiveTaskPage toGoodsReceiveTaskPage() {
  426 + getHome();
420 427 click(StorageManage);
421 428 click(goodsReceiveTask);
422 429 return new GoodsReceiveTaskPage(driver);
... ... @@ -437,10 +444,11 @@ public class HomePage extends BasePage{
437 444 * @return 返回装柜任务处理管理页面
438 445 */
439 446 public NeedDealtApplyPage toLoadContainer(){
  447 + getHome();
440 448 click(StorageManage);
441 449 click(loadContainerTask);
442 450 dynamicWait(By.xpath("//div[@class='loading ng-scope']"));
443   - forceWait(3000);
  451 +// forceWait(3000);
444 452 return new NeedDealtApplyPage(driver);
445 453 }
446 454  
... ... @@ -508,4 +516,14 @@ public class HomePage extends BasePage{
508 516 click(quiryProject);
509 517 return new ProjectListPage(driver);
510 518 }
  519 + /**
  520 + *进入前台发单中心
  521 + * @param
  522 + * @return 前台发单中心页面
  523 + */
  524 + public BillingCenterPage toBillingCenterPage() {
  525 + click(DocumentaryManage);
  526 + click(billingCenter);
  527 + return new BillingCenterPage(driver);
  528 + }
511 529 }
512 530 \ No newline at end of file
... ...
src/main/java/com/essa/pageObject/StorageManage/GoodsReceiveTaskPage.java
... ... @@ -33,6 +33,9 @@ public class GoodsReceiveTaskPage extends BasePage {
33 33  
34 34 @FindBy (xpath = "//button[contains(text(),'处理')]")
35 35 WebElement deal;//处理
  36 +
  37 + @FindBy (xpath = "//tbody//tr[1]/td[8]")
  38 + WebElement status;//第一个结果的状态
36 39  
37 40 /*
38 41 * 页面方法
... ... @@ -42,12 +45,22 @@ public class GoodsReceiveTaskPage extends BasePage {
42 45 * @return PO收货任务处理页
43 46 */
44 47 public GoodsReceiveTaskPage dealReceive() {
45   - dynamicWait(By.xpath("//tbody/tr[1]"));
  48 + forceWait(1000);
  49 + dynamicWait(By.xpath("//tbody//tr[1]"));
46 50 sendKeys(keyword, Model.getPoNum());
47 51 click(search);
48   - dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']"));
  52 + dynamicLoad();
49 53 click(firstResult);
50 54 click(deal);
51 55 return new GoodsReceiveTaskPage(driver);
52 56 }
  57 + /**
  58 + *判断是否全部收货完成:true完成,false未完成
  59 + * @param
  60 + * @return boolean
  61 + */
  62 + public boolean isFinish(){
  63 + forceWait(500);
  64 + return status.getText().equals("完成");
  65 + }
53 66 }
... ...
src/main/java/com/essa/pageObject/StorageManage/LoadContainerHandlePage.java
... ... @@ -46,6 +46,7 @@ public class LoadContainerHandlePage extends BasePage {
46 46 * 页面方法
47 47 */
48 48 public LoadContainerHandlePage loadTaskHandle(){
  49 + forceWait(1000);
49 50 jsExecutorRemoveAttribute(actLoadTime,"readonly");
50 51 String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy");
51 52 sendKeys(actLoadTime,date);
... ... @@ -58,13 +59,8 @@ public class LoadContainerHandlePage extends BasePage {
58 59 // 对计算结果转换成string,并赋值给“实装柜数量”
59 60 String quantity = String.valueOf(tail);
60 61 sendKeys(actLoadQuantity,quantity);
61   - forceWait(1000);
62   -// // 上传装柜图片
63   -// click(actPicture);
64   -// uploadFile(Model.getPicPath());
65   -// forceWait(1000);
66   -// click(submit);
67   -// forceWait(2000);
  62 + click(submit);
  63 + dynamicLoad();
68 64 return new LoadContainerHandlePage(driver);
69 65 }
70 66 }
... ...
src/main/java/com/essa/pageObject/StorageManage/LoadContainerManagePage.java
... ... @@ -3,6 +3,7 @@ package com.essa.pageObject.StorageManage;
3 3 import com.essa.framework.BasePage;
4 4 import com.essa.framework.Model;
5 5 import net.bytebuddy.asm.Advice;
  6 +import org.openqa.selenium.By;
6 7 import org.openqa.selenium.WebDriver;
7 8 import org.openqa.selenium.WebElement;
8 9 import org.openqa.selenium.support.FindBy;
... ... @@ -39,12 +40,15 @@ public class LoadContainerManagePage extends BasePage {
39 40 * @return
40 41 */
41 42 public LoadContainerManagePage toLoadContainerDetail() {
  43 + forceWait(1000);
  44 + dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']"));
42 45 sendKeys(inputKeySearch, Model.getPoNum());
43   - forceWait(5000);
  46 +// forceWait(5000);
44 47 click(keySearch);
45   - forceWait(2000);
  48 +// forceWait(2000);
  49 + dynamicLoad();
46 50 click(firstPO);
47   - forceWait(2000);
  51 +// forceWait(2000);
48 52 click(handle);
49 53 return new LoadContainerManagePage(driver);
50 54 }
... ...
src/main/java/com/essa/pageObject/StorageManage/NoticeReceivePage.java
... ... @@ -62,9 +62,15 @@ public class NoticeReceivePage extends BasePage {
62 62 dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']"));
63 63 click(set);
64 64 forceWait(500);
65   - click(wareHouse);
66   - click(zone);
67   - click(shelf);
  65 + jsExecutorClick(wareHouse);
  66 + jsExecutorClick(zone);
  67 + jsExecutorClick(shelf);
  68 +// click(wareHouse);
  69 +// forceWait(1000);
  70 +// click(zone);
  71 +// forceWait(1000);
  72 +// click(shelf);
  73 +// forceWait(1000);
68 74 click(confirm);
69 75 forceWait(1000);
70 76 click(sysch);
... ...
src/main/java/com/essa/pageObject/StorageManage/ReceiveTaskDealPage.java
... ... @@ -33,12 +33,14 @@ public class ReceiveTaskDealPage extends BasePage {
33 33 */
34 34 public GoodsReceiveTaskPage allReceive() {
35 35 forceWait(1000);
36   - dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']"));
  36 + dynamicLoad();
  37 + moveHeightScroll("0");
37 38 click(allReceive);
38 39 forceWait(500);
39 40 click(confirm);
40 41 forceWait(1000);
41 42 click(confirm);
  43 + dynamicLoad();
42 44 return new GoodsReceiveTaskPage(driver);
43 45 }
44 46 }
... ...
src/main/java/com/essa/pageObject/inquiryManage/ProductInquiryTaskPage.java
... ... @@ -57,9 +57,11 @@ public class ProductInquiryTaskPage extends BasePage {
57 57 */
58 58 public ProductInquiryFeedbackPage toFeedback() {
59 59 // mywait(firstRow);
  60 + dynamicWait(By.xpath("//*[@ng-table='tableParams1']/tbody/tr[1]"));
60 61 click(advancedQuery);
61 62 sendKeys(skuNoQuery, Model.getSkuNo());
62 63 click(search);
  64 + forceWait(1000);
63 65 mywait(firstRow);
64 66 click(firstRow);
65 67 click(feedBack);
... ...
src/main/java/com/essa/pageObject/needDealt/NeedDealtApplyPage.java
... ... @@ -144,10 +144,10 @@ public class NeedDealtApplyPage extends BasePage {
144 144 */
145 145 public HomePage toClaimShippingMark(){
146 146  
147   - mywait(checkpoint);
148   - forceWait(5000);
  147 + dynamicWait(By.xpath("//*[contains(text(),'待办工作')]"));
  148 + Model.setSerialNum(partialStr(serialNumber.getText(), "流水号:"));
149 149 if(isVisibility(By.xpath("//*[text()='认领']"))){
150   - moveHeightScroll("100");
  150 + moveHeightScroll("0");
151 151 click(claim);
152 152 }
153 153 forceWait(3000);
... ... @@ -164,6 +164,7 @@ public class NeedDealtApplyPage extends BasePage {
164 164 sendKeys(inputShipperArriveDate,"11/10/2018");
165 165 //提交
166 166 click(submit);
  167 + dynamicLoad();
167 168 return new HomePage(driver);
168 169 }
169 170  
... ...
src/main/java/com/essa/testSuite/TestTail.java renamed to src/main/java/com/essa/testSuite/TestLoadContainer.java
1 1 package com.essa.testSuite;
2 2  
3   -import org.openqa.selenium.WebDriver;
4   -import org.openqa.selenium.support.PageFactory;
5   -import org.testng.annotations.AfterClass;
6   -import org.testng.annotations.BeforeClass;
7   -import org.testng.annotations.Test;
8   -
9 3 import com.essa.pageObject.BaseTest;
10   -import com.essa.pageObject.HomePage;
  4 +import com.essa.pageObject.DocumentaryManage.BillingCenterPage;
11 5 import com.essa.pageObject.DocumentaryManage.ConvertTailPage;
12 6 import com.essa.pageObject.DocumentaryManage.POBoardPage;
13 7 import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage;
  8 +import com.essa.pageObject.HomePage;
14 9 import com.essa.pageObject.StorageManage.GoodsReceiveTaskPage;
15 10 import com.essa.pageObject.StorageManage.NoticeReceivePage;
16 11 import com.essa.pageObject.StorageManage.ReceiveTaskDealPage;
17 12 import com.essa.pageObject.needDealt.NeedDealtApplyPage;
  13 +import org.openqa.selenium.WebDriver;
  14 +import org.openqa.selenium.support.PageFactory;
  15 +import org.testng.annotations.AfterClass;
  16 +import org.testng.annotations.BeforeClass;
  17 +import org.testng.annotations.Test;
  18 +import org.testng.asserts.SoftAssert;
18 19  
19   -public class TestTail extends BaseTest {
  20 +public class TestLoadContainer extends BaseTest {
20 21 WebDriver driver;
21 22  
22 23 @BeforeClass
23 24 public void setUp() {
24 25 initsetUp();
25   - loginValid("yuwanhang");
  26 + loginValid("zhidanbu");
  27 +// loginValid("chenyijie");
26 28 }
27 29  
28 30 @AfterClass
... ... @@ -34,8 +36,9 @@ public class TestTail extends BaseTest {
34 36 * 转尾货
35 37 */
36 38 @Test
37   - public void testTail() {
  39 + public void toTail() {
38 40 driver = getDriver();
  41 + loginValid("chenyijie");
39 42 HomePage homePage = PageFactory.initElements(driver, HomePage.class);
40 43 PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver, PODocumentaryListPage.class);
41 44 POBoardPage poBoardPage = PageFactory.initElements(driver, POBoardPage.class);
... ... @@ -59,7 +62,36 @@ public class TestTail extends BaseTest {
59 62 }
60 63  
61 64 /**
62   - * 收货通知处理
  65 + * 通知收货、装柜
  66 + */
  67 + @Test(description = "通知收货、装柜")
  68 + public void NoticeReceiveAndLoad(){
  69 + this.driver = getDriver();
  70 + HomePage homePage = PageFactory.initElements(driver,HomePage.class);
  71 + homePage.toPoDocumentaryListPage();
  72 + PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class);
  73 + POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class);
  74 + poDocumentaryListPage.toPoFollowDetail();
  75 +
  76 + //通知收货
  77 + poBoardPage.noticeReceive();
  78 +
  79 + //断言:通知收货是否成功
  80 + boolean actualReceive = poBoardPage.isNoticeReceSucceed();
  81 + SoftAssert softAssert = new SoftAssert();
  82 + softAssert.assertEquals(actualReceive,true,"通知收货失败!");
  83 + //通知装柜
  84 + poBoardPage.noticeLoad();
  85 +
  86 + //断言:通知装柜是否成功
  87 + boolean actualLoae = poBoardPage.isNoticeLoadSucceed();
  88 + softAssert.assertEquals(actualLoae,true,"通知装柜失败!");
  89 + softAssert.assertAll();
  90 +// homePage.logout();
  91 + }
  92 +
  93 + /**
  94 + * 收货任务管理,处理
63 95 */
64 96 @Test
65 97 public void dealWithDelivery() {
... ... @@ -68,8 +100,10 @@ public class TestTail extends BaseTest {
68 100 GoodsReceiveTaskPage goodsReceiveTaskPage = PageFactory.initElements(driver, GoodsReceiveTaskPage.class);
69 101 ReceiveTaskDealPage receiveTaskDealPage = PageFactory.initElements(driver, ReceiveTaskDealPage.class);
70 102 homePage.toGoodsReceiveTaskPage();
71   - goodsReceiveTaskPage.dealReceive();
72   - receiveTaskDealPage.allReceive();
  103 + while (!goodsReceiveTaskPage.isFinish()) {
  104 + goodsReceiveTaskPage.dealReceive();
  105 + receiveTaskDealPage.allReceive();
  106 + }
73 107 }
74 108  
75 109 /**
... ... @@ -78,9 +112,24 @@ public class TestTail extends BaseTest {
78 112 @Test
79 113 public void confirmSailingDate() {
80 114 driver = getDriver();
  115 + loginValid("yuwanhang");
81 116 HomePage homePage = PageFactory.initElements(driver, HomePage.class);
82 117 NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class);
83 118 homePage.toSailingDateConfirmPage();
84 119 needDealtApplyPage.confirmSailingDate();
85 120 }
  121 + /**
  122 + *制单部发单
  123 + * @param
  124 + * @return
  125 + */
  126 + @Test
  127 + public void Billing(){
  128 + this.driver = getDriver();
  129 + HomePage homePage = PageFactory.initElements(driver, HomePage.class);
  130 + BillingCenterPage billingCenterPage = PageFactory.initElements(driver,BillingCenterPage.class);
  131 + homePage.toBillingCenterPage();
  132 + billingCenterPage.MoreBilling();
  133 + homePage.logout();
  134 + }
86 135 }
... ...
src/main/java/com/essa/testSuite/TestNoticeReceiveAndLoad.java deleted
... ... @@ -1,61 +0,0 @@
1   -package com.essa.testSuite;
2   -
3   -import com.essa.pageObject.BaseTest;
4   -import com.essa.pageObject.HomePage;
5   -import com.essa.pageObject.DocumentaryManage.POBoardPage;
6   -import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage;
7   -import org.openqa.selenium.WebDriver;
8   -import org.openqa.selenium.support.PageFactory;
9   -import org.testng.annotations.AfterClass;
10   -import org.testng.annotations.BeforeClass;
11   -import org.testng.annotations.Test;
12   -import org.testng.asserts.SoftAssert;
13   -
14   -public class TestNoticeReceiveAndLoad extends BaseTest{
15   -
16   - WebDriver driver;
17   -
18   - @BeforeClass
19   - public void setUp(){
20   - initsetUp();
21   - loginValid("chenyijie");
22   - }
23   -
24   - @AfterClass
25   - public void tearDown(){
26   - driver.quit();
27   - }
28   -
29   - /**
30   - * 通知收货、装柜
31   - */
32   - @Test(description = "通知收货、装柜")
33   - public void NoticeReceiveAndLoad(){
34   - this.driver = getDriver();
35   - HomePage homePage = PageFactory.initElements(driver,HomePage.class);
36   - homePage.toPoDocumentaryListPage();
37   - PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class);
38   - POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class);
39   - poDocumentaryListPage.toPoFollowDetail();
40   -
41   - //通知收货
42   - poBoardPage.noticeReceive();
43   -
44   - //断言:通知收货是否成功
45   - boolean actualReceive = poBoardPage.isNoticeReceSucceed();
46   - SoftAssert softAssert = new SoftAssert();
47   - softAssert.assertEquals(actualReceive,true,"通知收货失败!");
48   - softAssert.assertAll();
49   -
50   - //通知装柜
51   - poBoardPage.noticeLoad();
52   -
53   - //断言:通知收货是否成功
54   - boolean actualLoae = poBoardPage.isNoticeReceSucceed();
55   - SoftAssert anAssert = new SoftAssert();
56   - anAssert.assertEquals(actualLoae,true,"通知装柜失败!");
57   - anAssert.assertAll();
58   - homePage.logout();
59   - }
60   -
61   -}
src/main/java/com/essa/testSuite/TestReceiptCore.java
... ... @@ -34,9 +34,9 @@ public class TestReceiptCore extends BaseTest {
34 34 HomePage homePage = PageFactory.initElements(driver,HomePage.class);
35 35 homePage.toReceiptCore();
36 36 ReceiptCorePage receiptCorePage = PageFactory.initElements(driver,ReceiptCorePage.class);
37   - String PO = LinkSQL.SQLQuery();
  37 +// String PO = LinkSQL.SQLQuery();
38 38  
39   - receiptCorePage.BillOrder(PO);
  39 + receiptCorePage.BillOrder();
40 40  
41 41 SoftAssert softAssert = new SoftAssert();
42 42 boolean SucceedElement = receiptCorePage.isSucceed();
... ...
src/main/java/com/essa/testSuite/TestShippingMark.java
1 1 package com.essa.testSuite;
2 2  
3 3  
4   -import com.essa.framework.BasePage;
5 4 import com.essa.pageObject.BaseTest;
6 5 import com.essa.pageObject.HomePage;
7 6 import com.essa.pageObject.needDealt.NeedDealtApplyPage;
8   -import org.openqa.selenium.By;
9 7 import org.openqa.selenium.WebDriver;
10 8 import org.openqa.selenium.support.PageFactory;
11 9 import org.testng.annotations.AfterClass;
12 10 import org.testng.annotations.BeforeClass;
  11 +import org.testng.annotations.Test;
13 12  
14 13 /**
15 14 * 测试用例:登记备选船期
... ... @@ -32,10 +31,9 @@ public class TestShippingMark extends BaseTest{
32 31 /**
33 32 * 登记备选船期
34 33 */
35   - @org.testng.annotations.Test(description = "登记备选船期待办")
  34 + @Test(description = "登记备选船期待办")
36 35 public void ShippingMarkWait(){
37 36 this.driver = getDriver();
38   -
39 37 HomePage homePage = PageFactory.initElements(driver,HomePage.class);
40 38 homePage.toShippingMarkWait();
41 39 NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver,NeedDealtApplyPage.class);
... ...
src/main/java/swing/SwingMain.java
... ... @@ -240,31 +240,10 @@ public class SwingMain {
240 240 //场景选择,插入对应的值,并打印在日志上
241 241 final JComboBox selectSystem = new JComboBox<String>();
242 242 selectSystem.setBounds(102, 51, 114, 20);
243   -// selectSystem.addActionListener(new ActionListener() {
244   -// public void actionPerformed(ActionEvent e) {
245   -// if ("SIT".equals((String) selectSystem.getSelectedItem())) {
246   -// Model.setEnv("SIT");
247   -// ja.append(getCurrentTime() + "已选择环境:SIT\r\n");
248   -// } else if ("DIT".equals((String) selectSystem.getSelectedItem())) {
249   -// Model.setEnv("DIT");
250   -// ja.append(getCurrentTime() + "已选择环境:DIT\r\n");
251   -// } else if ("HOTFIX".equals((String) selectSystem.getSelectedItem())) {
252   -// Model.setEnv("HOTFIX");
253   -// ja.append(getCurrentTime() + "已选择环境:HOTFIX\r\n");
254   -// } else if ("UAT".equals((String) selectSystem.getSelectedItem())) {
255   -// Model.setEnv("UAT");
256   -// ja.append(getCurrentTime() + "已选择环境:UAT\r\n");
257   -// }
258   -// }
259   -// });
260 243 selectSystem.setFont(new Font("微软雅黑", Font.PLAIN, 14));
261 244 for (EnvEnum envEnum : EnvEnum.values()) {
262 245 selectSystem.addItem(envEnum.getCode());
263 246 }
264   - /* selectSystem.addItem("SIT");
265   - selectSystem.addItem("HOTFIX");
266   - selectSystem.addItem("UAT");
267   - selectSystem.addItem("DIT");*/
268 247 frmvBy.getContentPane().add(selectSystem);
269 248  
270 249 //添加市场商品
... ... @@ -623,6 +602,7 @@ public class SwingMain {
623 602 case "新增开发商品":
624 603 Model.setPicPath(picPath.getText());
625 604 suites.add(SuitesEnum.ADD_DEV_GOODS.getSuiteName());
  605 + break;
626 606 }
627 607 testNG.setTestSuites(suites);
628 608 testNG.run();
... ... @@ -630,6 +610,7 @@ public class SwingMain {
630 610 switch (Scene){
631 611 default: //默认新增原厂商品
632 612 case "新增市场商品":
  613 + case "新增开发商品":
633 614 case "发布团购":
634 615 no = Model.getSkuNo();
635 616 if (no != null) {
... ...
src/main/resources/suites/LoadContainer.xml 0 → 100644
... ... @@ -0,0 +1,43 @@
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
  3 +<suite name="装柜">
  4 + <!--<test name="generatePO">
  5 + <classes>
  6 + <class name="com.buyer.testSuite.TestAddToCart">
  7 + <methods>
  8 + <include name="addSku"/>
  9 + </methods>
  10 + </class>
  11 + <class name="com.essa.testSuite.TestProductInquiry">
  12 + <methods>
  13 + <include name="productInquiry"/>
  14 + </methods>
  15 + </class>
  16 + <class name="com.buyer.testSuite.TestSendPO">
  17 + <methods>
  18 + <include name="conslidation"/>
  19 + <include name="sendPO"/>
  20 + </methods>
  21 + </class>
  22 + <class name="com.essa.testSuite.TestPOInquiry">
  23 + <methods>
  24 + <include name="POInquiry"/>
  25 + </methods>
  26 + </class>
  27 + </classes>
  28 + </test>-->
  29 + <test name="loadContainer">
  30 + <classes>
  31 + <class name="com.essa.testSuite.TestLoadContainer">
  32 + <methods>
  33 + <include name="Billing"/>
  34 + <include name="toTail"/>
  35 + <include name="NoticeReceiveAndLoad"/>
  36 + <include name="noticReceive"/>
  37 + <include name="dealWithDelivery"/>
  38 + </methods>
  39 + </class>
  40 + </classes>
  41 + </test>
  42 +</suite>
  43 +
... ...
src/main/resources/suites/sendPO.xml
... ... @@ -21,5 +21,14 @@
21 21 </class>
22 22 </classes>
23 23 </test>
  24 + <test name="PoInquiry">
  25 + <classes>
  26 + <class name="com.essa.testSuite.TestPOInquiry">
  27 + <methods>
  28 + <include name="POInquiry"/>
  29 + </methods>
  30 + </class>
  31 + </classes>
  32 + </test>
24 33 </suite>
25 34  
... ...