From d688c3f83e16cb058882ee9b0c64ed92a2ed0fd3 Mon Sep 17 00:00:00 2001 From: hanlei <364767929> Date: Wed, 31 Oct 2018 16:13:23 +0800 Subject: [PATCH] 船务 --- src/main/java/com/essa/pageObject/HomePage.java | 22 ++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java | 23 +++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java | 127 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 495 insertions(+), 0 deletions(-) create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java create mode 100644 src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java diff --git a/src/main/java/com/essa/pageObject/HomePage.java b/src/main/java/com/essa/pageObject/HomePage.java index 06024b4..ccef8b3 100644 --- a/src/main/java/com/essa/pageObject/HomePage.java +++ b/src/main/java/com/essa/pageObject/HomePage.java @@ -4,6 +4,7 @@ import com.essa.pageObject.DocumentaryManage.BillingCenterPage; import com.essa.pageObject.DocumentaryManage.POBoardPage; import com.essa.pageObject.DocumentaryManage.ReceiptCorePage; import com.essa.pageObject.GoodsManage.*; +import com.essa.pageObject.LogisticShipp.LogisticsShippPage; import org.openqa.selenium.By; import com.essa.pageObject.SupplierManage.SupplierOperationsTrackPage; import com.essa.pageObject.productDev.AddMatterialPage; @@ -194,6 +195,15 @@ public class HomePage extends BasePage{ WebElement billingCenter; + //物流船务 + @FindBy (xpath = "//*[text()='物流船务']") + WebElement LogisticsskippBoard; + + //船务看板 + @FindBy (xpath = "//*[@id='essa-left-menu']/div/dl[1]/dd[2]") + WebElement skippBoard; + + /* * 方法 */ @@ -526,4 +536,16 @@ public class HomePage extends BasePage{ click(billingCenter); return new BillingCenterPage(driver); } + + /** + *进入船务看板界面 + */ + public LogisticsShippPage toLogisticsShippPage(){ + mywait(LogisticsskippBoard); + click(LogisticsskippBoard); + mywait(skippBoard); + click(skippBoard); + return new LogisticsShippPage(driver); + } + } \ No newline at end of file diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java new file mode 100644 index 0000000..224287b --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java @@ -0,0 +1,63 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//订车页面 +public class BookingCarPage extends BasePage { + + public BookingCarPage(WebDriver driver) { + super(driver); + } + + //订车看板 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/ul/li[4]") + WebElement BookingCarBoard; + + //查询条件 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form/div/div/input") + WebElement SetQuery; + + //查询按钮 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form/div/div/span/button/i") + WebElement QueryBtn; + + //查询数据 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/table/tbody/tr/td[1]") + WebElement QueryRsult; + + //订车按钮 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/div[1]/button[1]") + WebElement BookingCarBtn; + + //订车类型 + @FindBy(xpath = "//*[text()='贷代订车']") + WebElement BookingCarSeclType; + + //预计到车日期 + @FindBy(xpath = "//*[@name='expectTruckArrivingDate']") + WebElement BookingCarDate; + + //确定按钮 + @FindBy(xpath = "//button[@data-bb-handler='submit']") + WebElement SubmitBtn; + + public BookingCarPage toBookingCarPage() { + mywait(BookingCarBoard); + click(BookingCarBoard); + SetQuery.sendKeys("D180411T0278"); + click(QueryBtn); + forceWait(1000); + click(QueryRsult); + click(BookingCarBtn); + mywait(BookingCarSeclType); + click(BookingCarSeclType); + mywait(BookingCarDate); + jsExecutorRemoveAttribute(BookingCarDate, "readonly"); + sendKeys(BookingCarDate, "2018/10/23"); + click(SubmitBtn); + return new BookingCarPage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java new file mode 100644 index 0000000..2954cae --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java @@ -0,0 +1,81 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//船务看板-订舱-待订舱-订舱录入界面 +public class CabinInfoPage extends BasePage { + public CabinInfoPage(WebDriver driver) { + super(driver); + } + + public String FilePath = "C:\\Users\\hanlei\\Desktop\\1.png"; + + //订舱看板 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/ul/li[3]") + WebElement BookingCabin; + + //记录 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/table/tbody/tr[1]/td/table/tbody/tr[1]") + WebElement FirstDate; + + //输入框 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form[1]/div/div/input") + WebElement SetQuery; + + //查询按钮 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form[1]/div/div/span/button") + WebElement QueryBtn; + + //选择订舱条目 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/table/tbody/tr[1]/td/table/tbody/tr[1]/td[1]/input") + WebElement SelectFirstDate; + + //订舱按钮 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/div[1]/button[1]") + WebElement BookingCabinBtn; + + //订舱S/O号 + @FindBy(xpath = "/html/body/div[6]/div/div/div[2]/div/form/div/div[1]/div/div[2]/div/div/input") + WebElement SetCabinSONo; + + //最后装柜日期 + @FindBy(xpath = "//*[@id='lastLoadTime']") + WebElement LastLoadTimeSet; + + //选择文件 + @FindBy(xpath = "//*[text()='点击选择文件...']") + WebElement FileUp; + + //确定 + @FindBy(xpath = "//button[@data-bb-handler='submit' and @type='button']") + WebElement CommitBtn; + + //窗体 + @FindBy(xpath = "/html/body/div[6]/div/div/div[2]/div") + WebElement Body; + + public CabinInfoPage toCabinInfoPage() { + click(BookingCabin); + mywait(FirstDate); + SetQuery.sendKeys("D180411T0278"); + click(QueryBtn); + mywait(SelectFirstDate); + click(SelectFirstDate); + click(BookingCabinBtn); + mywait(SetCabinSONo); + SetCabinSONo.sendKeys("TestCabinNo"); + jsExecutorRemoveAttribute(LastLoadTimeSet, "readonly"); + sendKeys(LastLoadTimeSet,"10/23/2018"); +// LastLoadTimeSet.sendKeys("10/23/2018"); + click(Body); +// jsExecutorClick(FileUp); + actionClick(FileUp); + uploadFile(FilePath); + forceWait(2000); + click(CommitBtn); + return new CabinInfoPage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java new file mode 100644 index 0000000..d764f3d --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java @@ -0,0 +1,23 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//大跟单确认备选船期待办界面 +public class LargeDcofdPage extends BasePage { + public LargeDcofdPage (WebDriver driver) { + super(driver); + } + + // 确认登记备选船期 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div[4]/span[1]/button[2]") + WebElement ConfirmationShipDate; + + public LargeDcofdPage toLargeDcofdPage(){ + mywait(ConfirmationShipDate); + click(ConfirmationShipDate); + return new LargeDcofdPage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java new file mode 100644 index 0000000..3bacd58 --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java @@ -0,0 +1,61 @@ +package com.essa.pageObject.LogisticShipp; + + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//船务看板-通知确认船务资料界面 +public class LogisticsShippPage extends BasePage { + public LogisticsShippPage(WebDriver driver) { + super(driver); + } + + // 通知确认船务资料看板 + @FindBy(xpath = "//a[text()='通知确认船务资料']") + WebElement NoticeBoard; + + //等待数据结构 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/table/tbody/tr[1]") + WebElement resultDate; + + //订单编号输入框 + @FindBy (xpath = "//input[@type='text' and @ng-model ='query.keyword']") + WebElement setPono; + + //高级查询按钮 + @FindBy (xpath = "//i[@class='iconfont icon-search']") + WebElement querySubBtn; + + //查询结果 + @FindBy (xpath = "//input[@type ='checkbox' and @checklist-value='item']") + WebElement selectedpo; + + //点击通知确认船务资料 + @FindBy (xpath = "//button[text()='通知确认船务资料']") + WebElement skippSubBtn; + + //点击确认按钮 + @FindBy (xpath = "//html/body/div[5]/div/div/div[2]/div/div/button[1]") + WebElement submitSubBtn; + + //点击退出登录 + @FindBy (xpath="//*[text()='退出']") + WebElement logout; + + //搜索并通知业务补充船务资料 + public LogisticsShippPage isSucceed() { + click(NoticeBoard); + mywait(resultDate); + setPono.sendKeys("D180411T0278"); + click(querySubBtn); + mywait(selectedpo); + click(selectedpo); + mywait(selectedpo); + click(skippSubBtn); + mywait(submitSubBtn); + click(submitSubBtn); + return new LogisticsShippPage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java b/src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java new file mode 100644 index 0000000..18e9d53 --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java @@ -0,0 +1,53 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//认领登记备选船期待办页面 +public class RegisOptShpDatePage extends BasePage { + public RegisOptShpDatePage (WebDriver driver) { + super(driver); + } + + // 认领登记备选船期任务 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div[4]/button") + WebElement ClaimTask; + + // 添加船务信息 + @FindBy(xpath = "//*[@id='wf_content']/div/div/button[1]") + WebElement AddShippInfo; + + // 添加船公司 + @FindBy(xpath = "//*[@id='wf_content']/form/table/tbody/tr/td/ng-form/div/div[1]/input") + WebElement AddShippCompanyInfo; + + // 设置开船日期 + @FindBy(xpath = "//*[@id='deliveryDate0']") + WebElement SetdeliveryDate0; + + // 设置到岗日期 + @FindBy(xpath = "//*[@id='estimatedArrivalDate0']") + WebElement SetEstimatedArrivalDate0; + + // 提交 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div[4]/span[1]/button[2]") + WebElement SubmitBtn; + + public RegisOptShpDatePage toRegisOptShpDatePage(){ + mywait(ClaimTask); + forceWait(1000); + click(ClaimTask); + mywait(AddShippInfo); + click(AddShippInfo); + mywait(AddShippCompanyInfo); + AddShippCompanyInfo.sendKeys("TestShippCompanyInfo"); + jsExecutorRemoveAttribute(SetdeliveryDate0, "readonly"); + sendKeys(SetdeliveryDate0,"10/23/2018"); + jsExecutorRemoveAttribute(SetEstimatedArrivalDate0, "readonly"); + sendKeys(SetEstimatedArrivalDate0,"10/23/2018"); + click(SubmitBtn); + return new RegisOptShpDatePage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java new file mode 100644 index 0000000..ba23158 --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java @@ -0,0 +1,127 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//业务员补充船务资料待办页面 +public class SellerFillInfoPage extends BasePage { + public SellerFillInfoPage(WebDriver driver) { + super(driver); + } + + //选择货代来源 + @FindBy(xpath = "//*[text()='ESSA指定']") + WebElement AppointSet; + + //选择报关 + @FindBy(xpath = "//*[@id='shippingPanel1']/div[2]/div/div/label[2]") + WebElement DeclareSet; + + //选择货代 + @FindBy(xpath = "//*[text()='请选择货代']") + WebElement AppointCompanySet; + + //选择货代 + @FindBy(xpath = "//*[text()='中外运']") + WebElement AppointCompanySec; + + //确定选择货代 + @FindBy(xpath = "//*[text()='确定']") + WebElement CommitAppointCompanySec; + + //目标港口 + @FindBy(xpath = "//*[@id='shippingPanel2']/div[2]/div/div/input") + WebElement TargetPortSet; + + //发货人公司 + @FindBy(xpath = "//*[text()='汕头伊斯卡玩具有限公司']") + WebElement ConsignmentCompany; + + //收货公司 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[1]/ng-form/div/div/div[1]/div/div/input") + WebElement HarvestCompany; + + //收货电话 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[1]/ng-form/div/div/div[3]/div/div/input") + WebElement HarvestMobile; + + //收货传真 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[1]/ng-form/div/div/div[4]/div/div/input") + WebElement HarvestFax; + + //收货邮编 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[1]/ng-form/div/div/div[5]/div/div/input") + WebElement HarvestZipcode; + + //通知方公司 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[2]/ng-form/div/div/div[1]/div/div/input") + WebElement SetNoticeCompany; + + //通知方电话号码 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[2]/ng-form/div/div/div[3]/div/div/input") + WebElement SetNoticeMobile; + + //通知方邮编 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[2]/ng-form/div/div/div[5]/div/div/input") + WebElement SetNoticeZipcode; + + //通知方传真 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[2]/ng-form/div/div/div[4]/div/div/input") + WebElement SetNoticeFix; + + //寄单公司名称 + @FindBy(xpath = "//*[@id='shippingPanel5']/div[7]/div/div/div[1]/div/div/input") + WebElement MailCompanyName; + + //寄单联系人名称 + @FindBy(xpath = "//*[@id='shippingPanel5']/div[7]/div/div/div[2]/div/div/input") + WebElement MailConnecter; + + //寄单联系人名称 + @FindBy(xpath = "//*[@id='shippingPanel5']/div[7]/div/div/div[3]/div/div/input") + WebElement MailPhone; + + //寄单邮编 + @FindBy(xpath = "//*[@id='shippingPanel5']/div[7]/div/div/div[4]/div/div/input") + WebElement MailZipcode; + + //寄单传真 + @FindBy(xpath = "//*[@id='shippingPanel4']/div[2]/ng-form/div/div/div[4]/div/div/input") + WebElement MailFax; + + //寄单邮编 + @FindBy(xpath = "//*[text()='确认']") + WebElement SubmitBtn; + + public SellerFillInfoPage toSellerFillInfo() { + mywait(AppointSet); + click(AppointSet); + click(DeclareSet); + click(AppointCompanySet); + mywait(AppointCompanySec); + click(AppointCompanySec); + click(CommitAppointCompanySec); + mywait(TargetPortSet); + TargetPortSet.sendKeys("TestPort"); + click(ConsignmentCompany); + HarvestCompany.sendKeys("TestCompany"); + HarvestMobile.sendKeys("15888889999"); + HarvestFax.sendKeys("TestFax@test.com"); + HarvestZipcode.sendKeys("000000"); + + SetNoticeCompany.sendKeys("TestNoticeCompany"); + SetNoticeMobile.sendKeys("15888889999"); + SetNoticeFix.sendKeys("TestNoticeFix@test.com"); + SetNoticeZipcode.sendKeys("000000"); + + MailCompanyName.sendKeys("TestMailCompanyName"); + MailConnecter.sendKeys("TestMailConnecter"); + MailPhone.sendKeys("TestMailPhone"); + MailZipcode.sendKeys("TestMailZipCode"); + MailFax.sendKeys("TestMailFax"); + click(SubmitBtn); + return new SellerFillInfoPage(driver); + } +} diff --git a/src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java b/src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java new file mode 100644 index 0000000..9cea40c --- /dev/null +++ b/src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java @@ -0,0 +1,65 @@ +package com.essa.pageObject.LogisticShipp; + +import com.essa.framework.BasePage; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.FindBy; + +//确认发车页面 +public class SendCarPage extends BasePage { + public SendCarPage(WebDriver driver) { + super(driver); + } + + //订车看板 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/ul/li[4]") + WebElement BookingCarBoard; + + //待发车看板 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/ul/li[2]") + WebElement WaitForBookingCarBoard; + + //查询 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form/div/div/input") + WebElement QueryWaitForBooking; + + //查询按钮 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/form/div/div/span/button") + WebElement QueryWaitForBookingCarBtn; + + //查询结果 + @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div/div/div/div/div/div/table/tbody/tr") + WebElement FristWaitForBookingCarDate; + + //发车确认 + @FindBy(xpath = "//*[text()='发车确认']") + WebElement ConfirmBookingCar; + + //柜号 + @FindBy(xpath = "//*[@name='containerNo']") + WebElement SetContainerNo; + + //封条号 + @FindBy(xpath = "//*[@name='sealNo']") + WebElement SetSealNo; + + //确认发车 + @FindBy(xpath = "//*[@data-bb-handler='submit']") + WebElement SubmitBtn; + + public SendCarPage toSendCarPage() { + click(BookingCarBoard); + mywait(WaitForBookingCarBoard); + click(WaitForBookingCarBoard); + QueryWaitForBooking.sendKeys("D180411T0278"); + click(QueryWaitForBookingCarBtn); + mywait(FristWaitForBookingCarDate); + click(FristWaitForBookingCarDate); + click(ConfirmBookingCar); + mywait(SetContainerNo); + SetContainerNo.sendKeys("TestContainerNo"); + SetSealNo.sendKeys("TestSealNo"); + click(SubmitBtn); + return new SendCarPage(driver); + } +} -- libgit2 0.21.2