Commit d7f15c1c569886017a8198f780d44c9363397bab
1 parent
0571f514
提交并且覆盖之前的
Showing
22 changed files
with
364 additions
and
144 deletions
Show diff stats
src/main/java/com/buyer/testSuite/TestAddToCart.java
| @@ -24,9 +24,6 @@ public class TestAddToCart extends BaseTest { | @@ -24,9 +24,6 @@ public class TestAddToCart extends BaseTest { | ||
| 24 | public void setUp() { | 24 | public void setUp() { |
| 25 | initBuyer(); | 25 | initBuyer(); |
| 26 | loginBuyerValid(Model.getBuyerAccount(),Model.getBuyerPassword()); | 26 | loginBuyerValid(Model.getBuyerAccount(),Model.getBuyerPassword()); |
| 27 | -// loginBuyerValid("buyer51551@essa.cn","essa123"); | ||
| 28 | -// Model.setIsactivity(1); | ||
| 29 | -// Model.setSkuNo(""); | ||
| 30 | } | 27 | } |
| 31 | @AfterClass | 28 | @AfterClass |
| 32 | public void tearDown() { | 29 | public void tearDown() { |
src/main/java/com/essa/framework/EnvEnum.java
| @@ -8,10 +8,10 @@ import java.util.concurrent.ConcurrentHashMap; | @@ -8,10 +8,10 @@ import java.util.concurrent.ConcurrentHashMap; | ||
| 8 | import java.util.concurrent.atomic.AtomicReference; | 8 | import java.util.concurrent.atomic.AtomicReference; |
| 9 | 9 | ||
| 10 | public enum EnvEnum { | 10 | public enum EnvEnum { |
| 11 | + SIT("sit","SIT"), | ||
| 11 | DIT("dit","DIT"), | 12 | DIT("dit","DIT"), |
| 12 | HOTFIX("hotfix","HOTFIX"), | 13 | HOTFIX("hotfix","HOTFIX"), |
| 13 | UAT("uat","UAT"), | 14 | UAT("uat","UAT"), |
| 14 | - SIT("sit","SIT"), | ||
| 15 | EPD("epd","EPD"); | 15 | EPD("epd","EPD"); |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
src/main/java/com/essa/framework/Model.java
| @@ -13,12 +13,12 @@ public class Model { | @@ -13,12 +13,12 @@ public class Model { | ||
| 13 | public static String email = "buyer"+Tools.getTime()+"@essa.cn";//采购商邮箱 | 13 | public static String email = "buyer"+Tools.getTime()+"@essa.cn";//采购商邮箱 |
| 14 | public static String invateCode;//邀请码 | 14 | public static String invateCode;//邀请码 |
| 15 | public static String env;//所选环境 | 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 | public static int isactivity=0;//是否是活动商品 1:是 0:否 | 19 | public static int isactivity=0;//是否是活动商品 1:是 0:否 |
| 20 | public static String manager;//商品的类目经理 | 20 | public static String manager;//商品的类目经理 |
| 21 | - public static String serialNum;//待办流水号 | 21 | + public static String serialNum="RW2018060800058";//待办流水号 |
| 22 | public static String materialName;//物料名称 | 22 | public static String materialName;//物料名称 |
| 23 | public static String projectName;//项目立项书名称 | 23 | public static String projectName;//项目立项书名称 |
| 24 | 24 |
src/main/java/com/essa/pageObject/DocumentaryManage/BillingCenterPage.java
0 → 100644
| @@ -0,0 +1,161 @@ | @@ -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,9 +107,9 @@ public class POBoardPage extends BasePage { | ||
| 107 | String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy"); | 107 | String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy"); |
| 108 | sendKeys(inutLoadDate,date); | 108 | sendKeys(inutLoadDate,date); |
| 109 | click(loadDate); | 109 | click(loadDate); |
| 110 | - forceWait(3000); | 110 | + forceWait(1000); |
| 111 | click(submit); | 111 | click(submit); |
| 112 | - forceWait(2000); | 112 | +// forceWait(2000); |
| 113 | return new POBoardPage(driver); | 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,13 +63,13 @@ public class PODocumentaryListPage extends BasePage { | ||
| 63 | * @return | 63 | * @return |
| 64 | */ | 64 | */ |
| 65 | public PODocumentaryListPage toPoFollowDetail(){ | 65 | public PODocumentaryListPage toPoFollowDetail(){ |
| 66 | + forceWait(1000); | ||
| 66 | sendKeys(keySearch, Model.getPoNum()); | 67 | sendKeys(keySearch, Model.getPoNum()); |
| 67 | click(magnifierSearch); | 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 | click(followDetail); | 70 | click(followDetail); |
| 71 | - forceWait(8000); | ||
| 72 | - dynamicWait(By.xpath("//div[@class='panel-body']")); | 71 | + forceWait(3000); |
| 72 | + dynamicLoad(); | ||
| 73 | return new PODocumentaryListPage(driver); | 73 | return new PODocumentaryListPage(driver); |
| 74 | } | 74 | } |
| 75 | } | 75 | } |
src/main/java/com/essa/pageObject/DocumentaryManage/ReceiptCorePage.java
| 1 | package com.essa.pageObject.DocumentaryManage; | 1 | package com.essa.pageObject.DocumentaryManage; |
| 2 | 2 | ||
| 3 | import com.essa.framework.BasePage; | 3 | import com.essa.framework.BasePage; |
| 4 | +import com.essa.framework.Model; | ||
| 4 | import org.openqa.selenium.By; | 5 | import org.openqa.selenium.By; |
| 5 | import org.openqa.selenium.WebDriver; | 6 | import org.openqa.selenium.WebDriver; |
| 6 | import org.openqa.selenium.WebElement; | 7 | import org.openqa.selenium.WebElement; |
| @@ -97,15 +98,15 @@ public class ReceiptCorePage extends BasePage { | @@ -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 | dynamicWait(By.xpath("//tbody//tr[1]")); | 103 | dynamicWait(By.xpath("//tbody//tr[1]")); |
| 103 | 104 | ||
| 104 | click(advancedQuery); | 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 | click(Query); | 111 | click(Query); |
| 111 | // forceWait(3000); | 112 | // forceWait(3000); |
| @@ -115,20 +116,20 @@ public class ReceiptCorePage extends BasePage { | @@ -115,20 +116,20 @@ public class ReceiptCorePage extends BasePage { | ||
| 115 | // actionDoubleClick(document_code); // 双击元素 | 116 | // actionDoubleClick(document_code); // 双击元素 |
| 116 | // forceWait(1000); | 117 | // forceWait(1000); |
| 117 | String Fo = document_code.getText(); | 118 | String Fo = document_code.getText(); |
| 118 | - forceWait(1000); | 119 | +// forceWait(1000); |
| 119 | 120 | ||
| 120 | click(start_billing); | 121 | click(start_billing); |
| 121 | forceWait(1000); | 122 | forceWait(1000); |
| 122 | sendKeys(input_document_code,Fo); | 123 | sendKeys(input_document_code,Fo); |
| 123 | - forceWait(1000); | 124 | +// forceWait(1000); |
| 124 | 125 | ||
| 125 | click(search); | 126 | click(search); |
| 126 | - forceWait(1000); | 127 | + forceWait(500); |
| 127 | 128 | ||
| 128 | click(start_billing_1); | 129 | click(start_billing_1); |
| 129 | - forceWait(1000); | 130 | +// forceWait(1000); |
| 130 | // isVisibility(By.xpath("//*[contains(text(),'所选的工厂订单状态必须为“发单中”')]")); | 131 | // isVisibility(By.xpath("//*[contains(text(),'所选的工厂订单状态必须为“发单中”')]")); |
| 131 | - | 132 | + dynamicLoad(); |
| 132 | click(start_billing); | 133 | click(start_billing); |
| 133 | forceWait(1000); | 134 | forceWait(1000); |
| 134 | 135 |
src/main/java/com/essa/pageObject/HomePage.java
| 1 | package com.essa.pageObject; | 1 | package com.essa.pageObject; |
| 2 | 2 | ||
| 3 | +import com.essa.pageObject.DocumentaryManage.BillingCenterPage; | ||
| 3 | import com.essa.pageObject.DocumentaryManage.POBoardPage; | 4 | import com.essa.pageObject.DocumentaryManage.POBoardPage; |
| 4 | import com.essa.pageObject.DocumentaryManage.ReceiptCorePage; | 5 | import com.essa.pageObject.DocumentaryManage.ReceiptCorePage; |
| 5 | import com.essa.pageObject.GoodsManage.*; | 6 | import com.essa.pageObject.GoodsManage.*; |
| @@ -188,6 +189,10 @@ public class HomePage extends BasePage{ | @@ -188,6 +189,10 @@ public class HomePage extends BasePage{ | ||
| 188 | @FindBy (xpath = "//a[@name='child.text'][contains(text(),'装柜任务管理')]") | 189 | @FindBy (xpath = "//a[@name='child.text'][contains(text(),'装柜任务管理')]") |
| 189 | WebElement loadContainerTask; | 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,6 +402,7 @@ public class HomePage extends BasePage{ | ||
| 397 | * @return PO跟单列表页 | 402 | * @return PO跟单列表页 |
| 398 | */ | 403 | */ |
| 399 | public PODocumentaryListPage toPoDocumentaryListPage() { | 404 | public PODocumentaryListPage toPoDocumentaryListPage() { |
| 405 | + getHome(); | ||
| 400 | click(DocumentaryManage); | 406 | click(DocumentaryManage); |
| 401 | click(PODocumentary); | 407 | click(PODocumentary); |
| 402 | return new PODocumentaryListPage(driver); | 408 | return new PODocumentaryListPage(driver); |
| @@ -417,6 +423,7 @@ public class HomePage extends BasePage{ | @@ -417,6 +423,7 @@ public class HomePage extends BasePage{ | ||
| 417 | * @return 收货任务管理页面 | 423 | * @return 收货任务管理页面 |
| 418 | */ | 424 | */ |
| 419 | public GoodsReceiveTaskPage toGoodsReceiveTaskPage() { | 425 | public GoodsReceiveTaskPage toGoodsReceiveTaskPage() { |
| 426 | + getHome(); | ||
| 420 | click(StorageManage); | 427 | click(StorageManage); |
| 421 | click(goodsReceiveTask); | 428 | click(goodsReceiveTask); |
| 422 | return new GoodsReceiveTaskPage(driver); | 429 | return new GoodsReceiveTaskPage(driver); |
| @@ -437,10 +444,11 @@ public class HomePage extends BasePage{ | @@ -437,10 +444,11 @@ public class HomePage extends BasePage{ | ||
| 437 | * @return 返回装柜任务处理管理页面 | 444 | * @return 返回装柜任务处理管理页面 |
| 438 | */ | 445 | */ |
| 439 | public NeedDealtApplyPage toLoadContainer(){ | 446 | public NeedDealtApplyPage toLoadContainer(){ |
| 447 | + getHome(); | ||
| 440 | click(StorageManage); | 448 | click(StorageManage); |
| 441 | click(loadContainerTask); | 449 | click(loadContainerTask); |
| 442 | dynamicWait(By.xpath("//div[@class='loading ng-scope']")); | 450 | dynamicWait(By.xpath("//div[@class='loading ng-scope']")); |
| 443 | - forceWait(3000); | 451 | +// forceWait(3000); |
| 444 | return new NeedDealtApplyPage(driver); | 452 | return new NeedDealtApplyPage(driver); |
| 445 | } | 453 | } |
| 446 | 454 | ||
| @@ -508,4 +516,14 @@ public class HomePage extends BasePage{ | @@ -508,4 +516,14 @@ public class HomePage extends BasePage{ | ||
| 508 | click(quiryProject); | 516 | click(quiryProject); |
| 509 | return new ProjectListPage(driver); | 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 | \ No newline at end of file | 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,6 +33,9 @@ public class GoodsReceiveTaskPage extends BasePage { | ||
| 33 | 33 | ||
| 34 | @FindBy (xpath = "//button[contains(text(),'处理')]") | 34 | @FindBy (xpath = "//button[contains(text(),'处理')]") |
| 35 | WebElement deal;//处理 | 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,12 +45,22 @@ public class GoodsReceiveTaskPage extends BasePage { | ||
| 42 | * @return PO收货任务处理页 | 45 | * @return PO收货任务处理页 |
| 43 | */ | 46 | */ |
| 44 | public GoodsReceiveTaskPage dealReceive() { | 47 | public GoodsReceiveTaskPage dealReceive() { |
| 45 | - dynamicWait(By.xpath("//tbody/tr[1]")); | 48 | + forceWait(1000); |
| 49 | + dynamicWait(By.xpath("//tbody//tr[1]")); | ||
| 46 | sendKeys(keyword, Model.getPoNum()); | 50 | sendKeys(keyword, Model.getPoNum()); |
| 47 | click(search); | 51 | click(search); |
| 48 | - dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']")); | 52 | + dynamicLoad(); |
| 49 | click(firstResult); | 53 | click(firstResult); |
| 50 | click(deal); | 54 | click(deal); |
| 51 | return new GoodsReceiveTaskPage(driver); | 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,6 +46,7 @@ public class LoadContainerHandlePage extends BasePage { | ||
| 46 | * 页面方法 | 46 | * 页面方法 |
| 47 | */ | 47 | */ |
| 48 | public LoadContainerHandlePage loadTaskHandle(){ | 48 | public LoadContainerHandlePage loadTaskHandle(){ |
| 49 | + forceWait(1000); | ||
| 49 | jsExecutorRemoveAttribute(actLoadTime,"readonly"); | 50 | jsExecutorRemoveAttribute(actLoadTime,"readonly"); |
| 50 | String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); | 51 | String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); |
| 51 | sendKeys(actLoadTime,date); | 52 | sendKeys(actLoadTime,date); |
| @@ -58,13 +59,8 @@ public class LoadContainerHandlePage extends BasePage { | @@ -58,13 +59,8 @@ public class LoadContainerHandlePage extends BasePage { | ||
| 58 | // 对计算结果转换成string,并赋值给“实装柜数量” | 59 | // 对计算结果转换成string,并赋值给“实装柜数量” |
| 59 | String quantity = String.valueOf(tail); | 60 | String quantity = String.valueOf(tail); |
| 60 | sendKeys(actLoadQuantity,quantity); | 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 | return new LoadContainerHandlePage(driver); | 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,6 +3,7 @@ package com.essa.pageObject.StorageManage; | ||
| 3 | import com.essa.framework.BasePage; | 3 | import com.essa.framework.BasePage; |
| 4 | import com.essa.framework.Model; | 4 | import com.essa.framework.Model; |
| 5 | import net.bytebuddy.asm.Advice; | 5 | import net.bytebuddy.asm.Advice; |
| 6 | +import org.openqa.selenium.By; | ||
| 6 | import org.openqa.selenium.WebDriver; | 7 | import org.openqa.selenium.WebDriver; |
| 7 | import org.openqa.selenium.WebElement; | 8 | import org.openqa.selenium.WebElement; |
| 8 | import org.openqa.selenium.support.FindBy; | 9 | import org.openqa.selenium.support.FindBy; |
| @@ -39,12 +40,15 @@ public class LoadContainerManagePage extends BasePage { | @@ -39,12 +40,15 @@ public class LoadContainerManagePage extends BasePage { | ||
| 39 | * @return | 40 | * @return |
| 40 | */ | 41 | */ |
| 41 | public LoadContainerManagePage toLoadContainerDetail() { | 42 | public LoadContainerManagePage toLoadContainerDetail() { |
| 43 | + forceWait(1000); | ||
| 44 | + dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']")); | ||
| 42 | sendKeys(inputKeySearch, Model.getPoNum()); | 45 | sendKeys(inputKeySearch, Model.getPoNum()); |
| 43 | - forceWait(5000); | 46 | +// forceWait(5000); |
| 44 | click(keySearch); | 47 | click(keySearch); |
| 45 | - forceWait(2000); | 48 | +// forceWait(2000); |
| 49 | + dynamicLoad(); | ||
| 46 | click(firstPO); | 50 | click(firstPO); |
| 47 | - forceWait(2000); | 51 | +// forceWait(2000); |
| 48 | click(handle); | 52 | click(handle); |
| 49 | return new LoadContainerManagePage(driver); | 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,9 +62,15 @@ public class NoticeReceivePage extends BasePage { | ||
| 62 | dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']")); | 62 | dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']")); |
| 63 | click(set); | 63 | click(set); |
| 64 | forceWait(500); | 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 | click(confirm); | 74 | click(confirm); |
| 69 | forceWait(1000); | 75 | forceWait(1000); |
| 70 | click(sysch); | 76 | click(sysch); |
src/main/java/com/essa/pageObject/StorageManage/ReceiveTaskDealPage.java
| @@ -33,12 +33,14 @@ public class ReceiveTaskDealPage extends BasePage { | @@ -33,12 +33,14 @@ public class ReceiveTaskDealPage extends BasePage { | ||
| 33 | */ | 33 | */ |
| 34 | public GoodsReceiveTaskPage allReceive() { | 34 | public GoodsReceiveTaskPage allReceive() { |
| 35 | forceWait(1000); | 35 | forceWait(1000); |
| 36 | - dynamicWait(By.xpath("//div[@style='display: none;' and @id='mask']")); | 36 | + dynamicLoad(); |
| 37 | + moveHeightScroll("0"); | ||
| 37 | click(allReceive); | 38 | click(allReceive); |
| 38 | forceWait(500); | 39 | forceWait(500); |
| 39 | click(confirm); | 40 | click(confirm); |
| 40 | forceWait(1000); | 41 | forceWait(1000); |
| 41 | click(confirm); | 42 | click(confirm); |
| 43 | + dynamicLoad(); | ||
| 42 | return new GoodsReceiveTaskPage(driver); | 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,9 +57,11 @@ public class ProductInquiryTaskPage extends BasePage { | ||
| 57 | */ | 57 | */ |
| 58 | public ProductInquiryFeedbackPage toFeedback() { | 58 | public ProductInquiryFeedbackPage toFeedback() { |
| 59 | // mywait(firstRow); | 59 | // mywait(firstRow); |
| 60 | + dynamicWait(By.xpath("//*[@ng-table='tableParams1']/tbody/tr[1]")); | ||
| 60 | click(advancedQuery); | 61 | click(advancedQuery); |
| 61 | sendKeys(skuNoQuery, Model.getSkuNo()); | 62 | sendKeys(skuNoQuery, Model.getSkuNo()); |
| 62 | click(search); | 63 | click(search); |
| 64 | + forceWait(1000); | ||
| 63 | mywait(firstRow); | 65 | mywait(firstRow); |
| 64 | click(firstRow); | 66 | click(firstRow); |
| 65 | click(feedBack); | 67 | click(feedBack); |
src/main/java/com/essa/pageObject/needDealt/NeedDealtApplyPage.java
| @@ -144,10 +144,10 @@ public class NeedDealtApplyPage extends BasePage { | @@ -144,10 +144,10 @@ public class NeedDealtApplyPage extends BasePage { | ||
| 144 | */ | 144 | */ |
| 145 | public HomePage toClaimShippingMark(){ | 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 | if(isVisibility(By.xpath("//*[text()='认领']"))){ | 149 | if(isVisibility(By.xpath("//*[text()='认领']"))){ |
| 150 | - moveHeightScroll("100"); | 150 | + moveHeightScroll("0"); |
| 151 | click(claim); | 151 | click(claim); |
| 152 | } | 152 | } |
| 153 | forceWait(3000); | 153 | forceWait(3000); |
| @@ -164,6 +164,7 @@ public class NeedDealtApplyPage extends BasePage { | @@ -164,6 +164,7 @@ public class NeedDealtApplyPage extends BasePage { | ||
| 164 | sendKeys(inputShipperArriveDate,"11/10/2018"); | 164 | sendKeys(inputShipperArriveDate,"11/10/2018"); |
| 165 | //提交 | 165 | //提交 |
| 166 | click(submit); | 166 | click(submit); |
| 167 | + dynamicLoad(); | ||
| 167 | return new HomePage(driver); | 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 | package com.essa.testSuite; | 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 | import com.essa.pageObject.BaseTest; | 3 | import com.essa.pageObject.BaseTest; |
| 10 | -import com.essa.pageObject.HomePage; | 4 | +import com.essa.pageObject.DocumentaryManage.BillingCenterPage; |
| 11 | import com.essa.pageObject.DocumentaryManage.ConvertTailPage; | 5 | import com.essa.pageObject.DocumentaryManage.ConvertTailPage; |
| 12 | import com.essa.pageObject.DocumentaryManage.POBoardPage; | 6 | import com.essa.pageObject.DocumentaryManage.POBoardPage; |
| 13 | import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage; | 7 | import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage; |
| 8 | +import com.essa.pageObject.HomePage; | ||
| 14 | import com.essa.pageObject.StorageManage.GoodsReceiveTaskPage; | 9 | import com.essa.pageObject.StorageManage.GoodsReceiveTaskPage; |
| 15 | import com.essa.pageObject.StorageManage.NoticeReceivePage; | 10 | import com.essa.pageObject.StorageManage.NoticeReceivePage; |
| 16 | import com.essa.pageObject.StorageManage.ReceiveTaskDealPage; | 11 | import com.essa.pageObject.StorageManage.ReceiveTaskDealPage; |
| 17 | import com.essa.pageObject.needDealt.NeedDealtApplyPage; | 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 | WebDriver driver; | 21 | WebDriver driver; |
| 21 | 22 | ||
| 22 | @BeforeClass | 23 | @BeforeClass |
| 23 | public void setUp() { | 24 | public void setUp() { |
| 24 | initsetUp(); | 25 | initsetUp(); |
| 25 | - loginValid("yuwanhang"); | 26 | + loginValid("zhidanbu"); |
| 27 | +// loginValid("chenyijie"); | ||
| 26 | } | 28 | } |
| 27 | 29 | ||
| 28 | @AfterClass | 30 | @AfterClass |
| @@ -34,8 +36,9 @@ public class TestTail extends BaseTest { | @@ -34,8 +36,9 @@ public class TestTail extends BaseTest { | ||
| 34 | * 转尾货 | 36 | * 转尾货 |
| 35 | */ | 37 | */ |
| 36 | @Test | 38 | @Test |
| 37 | - public void testTail() { | 39 | + public void toTail() { |
| 38 | driver = getDriver(); | 40 | driver = getDriver(); |
| 41 | + loginValid("chenyijie"); | ||
| 39 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); | 42 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); |
| 40 | PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver, PODocumentaryListPage.class); | 43 | PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver, PODocumentaryListPage.class); |
| 41 | POBoardPage poBoardPage = PageFactory.initElements(driver, POBoardPage.class); | 44 | POBoardPage poBoardPage = PageFactory.initElements(driver, POBoardPage.class); |
| @@ -59,7 +62,36 @@ public class TestTail extends BaseTest { | @@ -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 | @Test | 96 | @Test |
| 65 | public void dealWithDelivery() { | 97 | public void dealWithDelivery() { |
| @@ -68,8 +100,10 @@ public class TestTail extends BaseTest { | @@ -68,8 +100,10 @@ public class TestTail extends BaseTest { | ||
| 68 | GoodsReceiveTaskPage goodsReceiveTaskPage = PageFactory.initElements(driver, GoodsReceiveTaskPage.class); | 100 | GoodsReceiveTaskPage goodsReceiveTaskPage = PageFactory.initElements(driver, GoodsReceiveTaskPage.class); |
| 69 | ReceiveTaskDealPage receiveTaskDealPage = PageFactory.initElements(driver, ReceiveTaskDealPage.class); | 101 | ReceiveTaskDealPage receiveTaskDealPage = PageFactory.initElements(driver, ReceiveTaskDealPage.class); |
| 70 | homePage.toGoodsReceiveTaskPage(); | 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,9 +112,24 @@ public class TestTail extends BaseTest { | ||
| 78 | @Test | 112 | @Test |
| 79 | public void confirmSailingDate() { | 113 | public void confirmSailingDate() { |
| 80 | driver = getDriver(); | 114 | driver = getDriver(); |
| 115 | + loginValid("yuwanhang"); | ||
| 81 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); | 116 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); |
| 82 | NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); | 117 | NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); |
| 83 | homePage.toSailingDateConfirmPage(); | 118 | homePage.toSailingDateConfirmPage(); |
| 84 | needDealtApplyPage.confirmSailingDate(); | 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,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,9 +34,9 @@ public class TestReceiptCore extends BaseTest { | ||
| 34 | HomePage homePage = PageFactory.initElements(driver,HomePage.class); | 34 | HomePage homePage = PageFactory.initElements(driver,HomePage.class); |
| 35 | homePage.toReceiptCore(); | 35 | homePage.toReceiptCore(); |
| 36 | ReceiptCorePage receiptCorePage = PageFactory.initElements(driver,ReceiptCorePage.class); | 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 | SoftAssert softAssert = new SoftAssert(); | 41 | SoftAssert softAssert = new SoftAssert(); |
| 42 | boolean SucceedElement = receiptCorePage.isSucceed(); | 42 | boolean SucceedElement = receiptCorePage.isSucceed(); |
src/main/java/com/essa/testSuite/TestShippingMark.java
| 1 | package com.essa.testSuite; | 1 | package com.essa.testSuite; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.essa.framework.BasePage; | ||
| 5 | import com.essa.pageObject.BaseTest; | 4 | import com.essa.pageObject.BaseTest; |
| 6 | import com.essa.pageObject.HomePage; | 5 | import com.essa.pageObject.HomePage; |
| 7 | import com.essa.pageObject.needDealt.NeedDealtApplyPage; | 6 | import com.essa.pageObject.needDealt.NeedDealtApplyPage; |
| 8 | -import org.openqa.selenium.By; | ||
| 9 | import org.openqa.selenium.WebDriver; | 7 | import org.openqa.selenium.WebDriver; |
| 10 | import org.openqa.selenium.support.PageFactory; | 8 | import org.openqa.selenium.support.PageFactory; |
| 11 | import org.testng.annotations.AfterClass; | 9 | import org.testng.annotations.AfterClass; |
| 12 | import org.testng.annotations.BeforeClass; | 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,10 +31,9 @@ public class TestShippingMark extends BaseTest{ | ||
| 32 | /** | 31 | /** |
| 33 | * 登记备选船期 | 32 | * 登记备选船期 |
| 34 | */ | 33 | */ |
| 35 | - @org.testng.annotations.Test(description = "登记备选船期待办") | 34 | + @Test(description = "登记备选船期待办") |
| 36 | public void ShippingMarkWait(){ | 35 | public void ShippingMarkWait(){ |
| 37 | this.driver = getDriver(); | 36 | this.driver = getDriver(); |
| 38 | - | ||
| 39 | HomePage homePage = PageFactory.initElements(driver,HomePage.class); | 37 | HomePage homePage = PageFactory.initElements(driver,HomePage.class); |
| 40 | homePage.toShippingMarkWait(); | 38 | homePage.toShippingMarkWait(); |
| 41 | NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver,NeedDealtApplyPage.class); | 39 | NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver,NeedDealtApplyPage.class); |
src/main/java/swing/SwingMain.java
| @@ -240,31 +240,10 @@ public class SwingMain { | @@ -240,31 +240,10 @@ public class SwingMain { | ||
| 240 | //场景选择,插入对应的值,并打印在日志上 | 240 | //场景选择,插入对应的值,并打印在日志上 |
| 241 | final JComboBox selectSystem = new JComboBox<String>(); | 241 | final JComboBox selectSystem = new JComboBox<String>(); |
| 242 | selectSystem.setBounds(102, 51, 114, 20); | 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 | selectSystem.setFont(new Font("微软雅黑", Font.PLAIN, 14)); | 243 | selectSystem.setFont(new Font("微软雅黑", Font.PLAIN, 14)); |
| 261 | for (EnvEnum envEnum : EnvEnum.values()) { | 244 | for (EnvEnum envEnum : EnvEnum.values()) { |
| 262 | selectSystem.addItem(envEnum.getCode()); | 245 | selectSystem.addItem(envEnum.getCode()); |
| 263 | } | 246 | } |
| 264 | - /* selectSystem.addItem("SIT"); | ||
| 265 | - selectSystem.addItem("HOTFIX"); | ||
| 266 | - selectSystem.addItem("UAT"); | ||
| 267 | - selectSystem.addItem("DIT");*/ | ||
| 268 | frmvBy.getContentPane().add(selectSystem); | 247 | frmvBy.getContentPane().add(selectSystem); |
| 269 | 248 | ||
| 270 | //添加市场商品 | 249 | //添加市场商品 |
| @@ -623,6 +602,7 @@ public class SwingMain { | @@ -623,6 +602,7 @@ public class SwingMain { | ||
| 623 | case "新增开发商品": | 602 | case "新增开发商品": |
| 624 | Model.setPicPath(picPath.getText()); | 603 | Model.setPicPath(picPath.getText()); |
| 625 | suites.add(SuitesEnum.ADD_DEV_GOODS.getSuiteName()); | 604 | suites.add(SuitesEnum.ADD_DEV_GOODS.getSuiteName()); |
| 605 | + break; | ||
| 626 | } | 606 | } |
| 627 | testNG.setTestSuites(suites); | 607 | testNG.setTestSuites(suites); |
| 628 | testNG.run(); | 608 | testNG.run(); |
| @@ -630,6 +610,7 @@ public class SwingMain { | @@ -630,6 +610,7 @@ public class SwingMain { | ||
| 630 | switch (Scene){ | 610 | switch (Scene){ |
| 631 | default: //默认新增原厂商品 | 611 | default: //默认新增原厂商品 |
| 632 | case "新增市场商品": | 612 | case "新增市场商品": |
| 613 | + case "新增开发商品": | ||
| 633 | case "发布团购": | 614 | case "发布团购": |
| 634 | no = Model.getSkuNo(); | 615 | no = Model.getSkuNo(); |
| 635 | if (no != null) { | 616 | if (no != null) { |
| @@ -0,0 +1,43 @@ | @@ -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,5 +21,14 @@ | ||
| 21 | </class> | 21 | </class> |
| 22 | </classes> | 22 | </classes> |
| 23 | </test> | 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 | </suite> | 33 | </suite> |
| 25 | 34 |