Commit 71af73f2a6f9ef450c84d768abbdddda5aaab57f
1 parent
aaa54ba4
lana update
Showing
5 changed files
with
252 additions
and
2 deletions
Show diff stats
src/main/java/com/essa/pageObject/HomePage.java
| @@ -23,8 +23,9 @@ import com.essa.pageObject.buyerManage.InvateCodePage; | @@ -23,8 +23,9 @@ import com.essa.pageObject.buyerManage.InvateCodePage; | ||
| 23 | import com.essa.pageObject.inquiryManage.ProductInquiryTaskPage; | 23 | import com.essa.pageObject.inquiryManage.ProductInquiryTaskPage; |
| 24 | import com.essa.pageObject.marketingManage.GroupControlPage; | 24 | import com.essa.pageObject.marketingManage.GroupControlPage; |
| 25 | import com.essa.pageObject.marketingManage.GroupSettingPage; | 25 | import com.essa.pageObject.marketingManage.GroupSettingPage; |
| 26 | -import com.essa.pageObject.needDealt.NeedDealtApplyPage; | ||
| 27 | - | 26 | +import com.essa.pageObject.needDealt.NeedDealtApplyPage; |
| 27 | +import pageObiect.CabinetTask.CabineTaskManagemenPage; | ||
| 28 | + | ||
| 28 | /** | 29 | /** |
| 29 | * @author Administrator | 30 | * @author Administrator |
| 30 | *bpms后台首页 | 31 | *bpms后台首页 |
| @@ -203,6 +204,16 @@ public class HomePage extends BasePage{ | @@ -203,6 +204,16 @@ public class HomePage extends BasePage{ | ||
| 203 | @FindBy (xpath = "//*[@id='essa-left-menu']/div/dl[1]/dd[2]") | 204 | @FindBy (xpath = "//*[@id='essa-left-menu']/div/dl[1]/dd[2]") |
| 204 | WebElement skippBoard; | 205 | WebElement skippBoard; |
| 205 | 206 | ||
| 207 | + //装柜通知(lana) | ||
| 208 | + @FindBy (xpath = "//a[@name='child.text'][contains(text(),'装柜通知')]") | ||
| 209 | + WebElement CabinetsNotice; | ||
| 210 | + | ||
| 211 | + //装柜务务管理(lana) | ||
| 212 | + @FindBy (xpath = "//a[contains(text(),'装柜任务管理')]") | ||
| 213 | + WebElement CabineTaskManagemen; | ||
| 214 | + | ||
| 215 | + | ||
| 216 | + | ||
| 206 | 217 | ||
| 207 | /* | 218 | /* |
| 208 | * 方法 | 219 | * 方法 |
| @@ -548,4 +559,14 @@ public class HomePage extends BasePage{ | @@ -548,4 +559,14 @@ public class HomePage extends BasePage{ | ||
| 548 | return new LogisticsShippPage(driver); | 559 | return new LogisticsShippPage(driver); |
| 549 | } | 560 | } |
| 550 | 561 | ||
| 562 | + /** | ||
| 563 | + * 进入装柜任务管理 | ||
| 564 | + * @return装柜任务管理 | ||
| 565 | + */ | ||
| 566 | + public CabineTaskManagemenPage toCabineTaskManagemenPage() { | ||
| 567 | + click(StorageManage); | ||
| 568 | + click(CabineTaskManagemen); | ||
| 569 | + return new CabineTaskManagemenPage(driver); | ||
| 570 | + } | ||
| 571 | + | ||
| 551 | } | 572 | } |
| 552 | \ No newline at end of file | 573 | \ No newline at end of file |
src/main/java/com/essa/testSuite/TestConfirmCabinet.java
0 → 100644
| @@ -0,0 +1,62 @@ | @@ -0,0 +1,62 @@ | ||
| 1 | +package com.essa.testSuite; | ||
| 2 | + | ||
| 3 | +/** | ||
| 4 | + * Created by Administrator on 2018/10/26 0026. | ||
| 5 | + */ | ||
| 6 | + | ||
| 7 | +import com.essa.pageObject.BaseTest; | ||
| 8 | +import com.essa.pageObject.HomePage; | ||
| 9 | +import org.openqa.selenium.WebDriver; | ||
| 10 | +import org.openqa.selenium.support.PageFactory; | ||
| 11 | +import org.testng.annotations.AfterClass; | ||
| 12 | +import org.testng.annotations.BeforeClass; | ||
| 13 | +import org.testng.annotations.Test; | ||
| 14 | +import pageObiect.CabinetTask.CabineTaskManagemenPage; | ||
| 15 | +import pageObiect.CabinetTask.HandlingLoadingOrders; | ||
| 16 | + | ||
| 17 | +import java.io.IOException; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | +* @author lana | ||
| 21 | +* 测试用例:装柜确认操作 | ||
| 22 | +**/ | ||
| 23 | +public class TestConfirmCabinet extends BaseTest { | ||
| 24 | + WebDriver driver; | ||
| 25 | + | ||
| 26 | + @BeforeClass | ||
| 27 | + public void setUp() throws IOException { | ||
| 28 | + initsetUp(); | ||
| 29 | + loginValid("chenyijie"); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | +// @AfterClass | ||
| 33 | +// public void tearDown() { | ||
| 34 | +// driver.quit(); | ||
| 35 | +// } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 查到存在有装柜任务,进入处理页面 | ||
| 39 | + */ | ||
| 40 | + @Test(description="根据PO单号,确认装柜") | ||
| 41 | + public void ConfirmCabinet(){ | ||
| 42 | + driver = getDriver(); | ||
| 43 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 44 | + homePage.toCabineTaskManagemenPage(); | ||
| 45 | + CabineTaskManagemenPage searchCabineTaskManagemenPage = PageFactory.initElements(driver, CabineTaskManagemenPage.class); | ||
| 46 | + searchCabineTaskManagemenPage.setWareHouse(); | ||
| 47 | + HandlingLoadingOrders handlingLoadingOrders = PageFactory.initElements(driver, HandlingLoadingOrders.class); | ||
| 48 | + handlingLoadingOrders.setHandlingCabinet(); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + /** | ||
| 52 | + * 进入处理页面(默认单号可以装柜) | ||
| 53 | + */ | ||
| 54 | +// @Test(description="进入装柜操作页面,进行操作") | ||
| 55 | +// public void handlingLoadingOrders(){ | ||
| 56 | +// driver = getDriver(); | ||
| 57 | +// //已进入处理页面 | ||
| 58 | +// | ||
| 59 | +// } | ||
| 60 | + | ||
| 61 | +} | ||
| 62 | + |
src/main/java/pageObiect/CabinetTask/CabineTaskManagemenPage.java
0 → 100644
| @@ -0,0 +1,67 @@ | @@ -0,0 +1,67 @@ | ||
| 1 | +package pageObiect.CabinetTask; | ||
| 2 | + | ||
| 3 | +import com.essa.framework.BasePage; | ||
| 4 | +import com.essa.framework.Model; | ||
| 5 | +import org.openqa.selenium.By; | ||
| 6 | +import org.openqa.selenium.WebDriver; | ||
| 7 | +import org.openqa.selenium.WebElement; | ||
| 8 | +import org.openqa.selenium.support.FindBy; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * Created by lana on 2018/10/26 0026. | ||
| 12 | + * 装柜任务管理页 | ||
| 13 | + */ | ||
| 14 | +public class CabineTaskManagemenPage extends BasePage{ | ||
| 15 | + | ||
| 16 | + public CabineTaskManagemenPage(WebDriver driver) { | ||
| 17 | + super(driver); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + /* | ||
| 21 | + * 元素定位 | ||
| 22 | + */ | ||
| 23 | + | ||
| 24 | + @FindBy(xpath = "//input[@name='selectKey']") | ||
| 25 | + WebElement selectKey;//关键字查询 | ||
| 26 | + | ||
| 27 | + @FindBy (xpath = "//button[contains(@ng-click,'search')]") | ||
| 28 | + WebElement search;//查询按钮 | ||
| 29 | + | ||
| 30 | + @FindBy(xpath ="//button[contains(@ng-click,'goCompleteTask')]" ) | ||
| 31 | + WebElement handle;//处理按钮 | ||
| 32 | + | ||
| 33 | + @FindBy(xpath ="//tbody/tr[1]") | ||
| 34 | + WebElement firstTr;//定位第一行 | ||
| 35 | + | ||
| 36 | + @FindBy (xpath = "//button[contains(text(),'处理')]") | ||
| 37 | + WebElement deal;//处理 | ||
| 38 | + | ||
| 39 | + /* | ||
| 40 | + * 页面参数 | ||
| 41 | + * */ | ||
| 42 | + String poNo=""; | ||
| 43 | + | ||
| 44 | + /* | ||
| 45 | + * 页面方法 | ||
| 46 | + */ | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 设置装柜处理查询 | ||
| 50 | + */ | ||
| 51 | + public CabineTaskManagemenPage setWareHouse() { | ||
| 52 | + dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']")); | ||
| 53 | + if(Model.getPoNum()!=""|| Model.getPoNum()!=null){ | ||
| 54 | + poNo="B180828T9165"; | ||
| 55 | + sendKeys(selectKey, poNo); | ||
| 56 | + }else{ | ||
| 57 | + sendKeys(selectKey, Model.getPoNum()); | ||
| 58 | + } | ||
| 59 | + click(search); | ||
| 60 | + forceWait(1000); | ||
| 61 | + click(firstTr); | ||
| 62 | + click(deal); | ||
| 63 | + return new CabineTaskManagemenPage(driver); | ||
| 64 | + | ||
| 65 | + } | ||
| 66 | + | ||
| 67 | +} |
src/main/java/pageObiect/CabinetTask/CabinetsNoticePage.java
0 → 100644
| @@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
| 1 | +package pageObiect.CabinetTask; | ||
| 2 | + | ||
| 3 | +import com.essa.framework.BasePage; | ||
| 4 | +import org.openqa.selenium.WebDriver; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * Created by Administrator on 2018/10/26 0026. | ||
| 8 | + */ | ||
| 9 | +public class CabinetsNoticePage extends BasePage{ | ||
| 10 | + | ||
| 11 | + public CabinetsNoticePage(WebDriver driver) { | ||
| 12 | + super(driver); | ||
| 13 | + } | ||
| 14 | +} |
src/main/java/pageObiect/CabinetTask/HandlingLoadingOrders.java
0 → 100644
| @@ -0,0 +1,86 @@ | @@ -0,0 +1,86 @@ | ||
| 1 | +package pageObiect.CabinetTask; | ||
| 2 | + | ||
| 3 | +import com.essa.framework.BasePage; | ||
| 4 | +import org.openqa.selenium.By; | ||
| 5 | +import org.openqa.selenium.WebDriver; | ||
| 6 | +import org.openqa.selenium.WebElement; | ||
| 7 | +import org.openqa.selenium.support.FindBy; | ||
| 8 | + | ||
| 9 | +import java.text.SimpleDateFormat; | ||
| 10 | +import java.util.ArrayList; | ||
| 11 | +import java.util.Date; | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +import static jdk.nashorn.internal.objects.Global.print; | ||
| 15 | + | ||
| 16 | +import com.essa.framework.BasePage; | ||
| 17 | +import com.essa.framework.LogType; | ||
| 18 | +import com.essa.framework.Logger; | ||
| 19 | + | ||
| 20 | + | ||
| 21 | +/** | ||
| 22 | + * Created by Administrator on 2018/10/30 0030. | ||
| 23 | + */ | ||
| 24 | +public class HandlingLoadingOrders extends BasePage { | ||
| 25 | + public HandlingLoadingOrders(WebDriver driver) { | ||
| 26 | + super(driver); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + WebDriver webDriver; | ||
| 30 | + /* | ||
| 31 | + * 元素定位 | ||
| 32 | + */ | ||
| 33 | + | ||
| 34 | + //实际装柜日期 | ||
| 35 | + @FindBy(xpath = "//input[@id='loadCompleteDate']") | ||
| 36 | + WebElement loadCompleteDate; | ||
| 37 | + | ||
| 38 | + //获取装柜商品列表 | ||
| 39 | + //@FindBy(xpath ="//td[@ng-repeat='item in taskInfo.skuList']") | ||
| 40 | + //WebElement tdList; | ||
| 41 | + @FindBy(xpath = "//tbody[2]/tr[1]/td[6]") | ||
| 42 | + WebElement firstTr;//定位第一行 | ||
| 43 | + | ||
| 44 | +// //获取元素列表循环读取值 | ||
| 45 | +// public ArrayList<String> getTrtd() { | ||
| 46 | +// String trs=testtrList.getText(); | ||
| 47 | +// | ||
| 48 | +// WebElement temp; | ||
| 49 | +// for (int kk=0;kk<0;kk++){ | ||
| 50 | +// temp= driver.findElement(By.xpath("//tbody[2]/tr["+kk+"]/td[6]")); | ||
| 51 | +// temp.getText(); | ||
| 52 | +// | ||
| 53 | +// } | ||
| 54 | + | ||
| 55 | +// ArrayList arryList = new ArrayList(); | ||
| 56 | +// //arryList.set(0,trs); | ||
| 57 | +// System.out.print(trs+"123456789---------"); | ||
| 58 | +// return arryList; | ||
| 59 | +// } | ||
| 60 | + | ||
| 61 | + //输入实装箱数 | ||
| 62 | + @FindBy(xpath = "//input[@id='actLoadBoxQuantity']") | ||
| 63 | + WebElement realNumber; | ||
| 64 | + | ||
| 65 | + //提交 | ||
| 66 | + @FindBy(xpath = "//*[text()='提交']") | ||
| 67 | + WebElement submit; | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 设置装柜处理参数 | ||
| 71 | + */ | ||
| 72 | + public HandlingLoadingOrders setHandlingCabinet() { | ||
| 73 | + dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']")); | ||
| 74 | + //设置实际装柜日期 | ||
| 75 | + jsExecutorRemoveAttribute(loadCompleteDate, "readonly"); | ||
| 76 | + loadCompleteDate.click(); | ||
| 77 | + forceWait(500); | ||
| 78 | + SimpleDateFormat zs=new SimpleDateFormat("MM/dd/yyyy"); | ||
| 79 | + String s =zs.format(new Date()); | ||
| 80 | + sendKeys(loadCompleteDate,s); | ||
| 81 | + click(submit); | ||
| 82 | + return new HandlingLoadingOrders(driver); | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + | ||
| 86 | +} |