Compare View
Commits (3)
Showing
26 changed files
Show diff stats
src/main/java/com/buyer/pageObject/PayDepositPage.java
... | ... | @@ -52,11 +52,9 @@ public class PayDepositPage extends BasePage { |
52 | 52 | } |
53 | 53 | |
54 | 54 | public void operate() { |
55 | - /*while (!(isVisibility(By.xpath("//*[contains(text(),'PO information')]")))) { | |
56 | - forceWait(1000); | |
57 | - }*/ | |
58 | 55 | dynamicWait(By.xpath("//*[contains(text(),'PO information')]")); |
59 | 56 | Model.setPoNum(poNum.getText()); |
57 | + | |
60 | 58 | if (isVisibility(By.xpath("//button[@class='submit-payment-deposit-button btn btn-primary']"))) { |
61 | 59 | //如果是可用资金不足,跳转到资金管理 |
62 | 60 | toAssetManagementPage(); | ... | ... |
src/main/java/com/essa/framework/BasePage.java
... | ... | @@ -520,6 +520,16 @@ public class BasePage { |
520 | 520 | // Logger.Output(LogType.LogTypeName.INFO, "等待元素在页面上加载可见,最多5秒"); |
521 | 521 | wait.until(ExpectedConditions.visibilityOf(element)); |
522 | 522 | } |
523 | + | |
524 | + /**要的元素是否存在,传递元素表达式,最多5秒 | |
525 | + * @param | |
526 | + */ | |
527 | + protected void mywait(By by) { | |
528 | + | |
529 | + WebDriverWait wait = new WebDriverWait(driver, 7); | |
530 | +// Logger.Output(LogType.LogTypeName.INFO, "等待元素在页面上加载可见,最多5秒"); | |
531 | + wait.until(ExpectedConditions.visibilityOf(driver.findElement(by))); | |
532 | + } | |
523 | 533 | |
524 | 534 | /** |
525 | 535 | * 设立检查点,判断页面是否是我们要的 |
... | ... | @@ -665,8 +675,8 @@ public class BasePage { |
665 | 675 | * @param by |
666 | 676 | */ |
667 | 677 | protected void dynamicWait(By by) { |
668 | - for(int count=0;count<7&&!(isVisibility(by));count++) { | |
669 | - forceWait(1000); | |
678 | + for(int count=0;count<14&&!(isVisibility(by));count++) { | |
679 | + forceWait(500); | |
670 | 680 | } |
671 | 681 | } |
672 | 682 | // /** |
... | ... | @@ -681,8 +691,8 @@ public class BasePage { |
681 | 691 | * @param by |
682 | 692 | */ |
683 | 693 | protected void dynamicLoad(By by) { |
684 | - for(int count=0;count<7&&isVisibility(by);count++) { | |
685 | - forceWait(1000); | |
694 | + for(int count=0;count<14&&isVisibility(by);count++) { | |
695 | + forceWait(500); | |
686 | 696 | } |
687 | 697 | } |
688 | 698 | /** | ... | ... |
src/main/java/com/essa/framework/Model.java
... | ... | @@ -9,20 +9,29 @@ public class Model { |
9 | 9 | public static String skuNo;//商品编号 |
10 | 10 | public static String buyerNo;//采购商编号 |
11 | 11 | public static String supplierName;//供应商名称 |
12 | - public static String picPath = "C:\\Users\\Administrator\\Pictures\\Camera Roll\\ya.jpg";//图片路径 | |
12 | + public static String picPath;//图片路径 | |
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="meng18@essa.cn";//采购商账号 | |
17 | - public static String buyerPassword="essa123";//采购商密码 | |
18 | - public static String poNum="A181115T9194K";//po单号 | |
16 | + public static String buyerAccount;//采购商账号 | |
17 | + public static String buyerPassword;//采购商密码 | |
18 | + public static String poNum = "A181117T9194B";//po单号 | |
19 | 19 | public static int isactivity=0;//是否是活动商品 1:是 0:否 |
20 | 20 | public static String manager;//商品的类目经理 |
21 | - public static String serialNum="RW2018060800058";//待办流水号 | |
21 | + public static String serialNum;//待办流水号 | |
22 | 22 | public static String materialName;//物料名称 |
23 | 23 | public static String projectName;//项目立项书名称 |
24 | + public static String salesman="yanqingping";//业务员 | |
24 | 25 | |
25 | - public static String getProjectName() { | |
26 | + public static String getSalesman() { | |
27 | + return salesman; | |
28 | + } | |
29 | + | |
30 | + public static void setSalesman(String salesman) { | |
31 | + Model.salesman = salesman; | |
32 | + } | |
33 | + | |
34 | + public static String getProjectName() { | |
26 | 35 | return projectName; |
27 | 36 | } |
28 | 37 | ... | ... |
src/main/java/com/essa/framework/SuitesEnum.java
... | ... | @@ -19,7 +19,8 @@ public enum SuitesEnum { |
19 | 19 | ACTIVITY_SEND_PO("ACTIVITY_SEND_PO","activitySendPO.xml","生成PO(活动)"), |
20 | 20 | SEND_PO("SEND_PO","sendPO.xml","生成PO(正常)"), |
21 | 21 | PO_INQUIRY("PO_INQUIRY","POInquiry.xml","PO询价"), |
22 | - ADD_DEV_GOODS("ADD_DEV_GOODS","addDevGoods.xml","新增开发商品"); | |
22 | + ADD_DEV_GOODS("ADD_DEV_GOODS","addDevGoods.xml","新增开发商品"), | |
23 | + LOAD_FINISH("LOAD_FINISH","LoadContainer.xml","装柜完成"); | |
23 | 24 | ; |
24 | 25 | |
25 | 26 | /** | ... | ... |
src/main/java/com/essa/framework/Tools.java
1 | 1 | package com.essa.framework; |
2 | 2 | |
3 | 3 | import java.text.SimpleDateFormat; |
4 | +import java.time.Year; | |
5 | +import java.util.Calendar; | |
4 | 6 | import java.util.Date; |
5 | 7 | |
6 | 8 | public class Tools { |
... | ... | @@ -37,5 +39,52 @@ public class Tools { |
37 | 39 | int i = (int)(1+Math.random()*(10-1+1)); |
38 | 40 | return time+i; |
39 | 41 | } |
40 | - | |
42 | + /** | |
43 | + *获取当前时间的下一个月 | |
44 | + * @param | |
45 | + * @return String 格式化后的时间 | |
46 | + */ | |
47 | + public static String getNextMonth(){ | |
48 | + Date today = new Date(); | |
49 | + Calendar cal = Calendar.getInstance(); | |
50 | + cal.setTime(today); | |
51 | + cal.add(Calendar.MONTH,1); | |
52 | + return myForm(cal); | |
53 | + } | |
54 | + /** | |
55 | + *获取当前时间+i天,传入的i为当前时间往后推的天数 | |
56 | + * @param | |
57 | + * @return String | |
58 | + */ | |
59 | + public static String moreDays(int i){ | |
60 | + Date today = new Date(); | |
61 | + Calendar cal = Calendar.getInstance(); | |
62 | + cal.setTime(today); | |
63 | + cal.add(Calendar.DATE,i); | |
64 | + return myForm(cal); | |
65 | + } | |
66 | + | |
67 | + /** | |
68 | + *获取格式化后的当天 | |
69 | + * @param | |
70 | + * @return String | |
71 | + */ | |
72 | + public static String getToday(){ | |
73 | + Date today = new Date(); | |
74 | + Calendar cal = Calendar.getInstance(); | |
75 | + cal.setTime(today); | |
76 | + return myForm(cal); | |
77 | + } | |
78 | + | |
79 | + /** | |
80 | + *由于bpms系统遇到日期中“天”为0开头时无法输入,故自己写一个格式 | |
81 | + * @param | |
82 | + * @return | |
83 | + */ | |
84 | + public static String myForm(Calendar cal){ | |
85 | + int day = cal.get(Calendar.DATE); | |
86 | + int month = cal.get(Calendar.MONTH)+1; | |
87 | + int year = cal.get(Calendar.YEAR); | |
88 | + return month+"/"+day+"/"+ year; | |
89 | + } | |
41 | 90 | } | ... | ... |
src/main/java/com/essa/pageObject/DocumentaryManage/POBoardPage.java
1 | 1 | package com.essa.pageObject.DocumentaryManage; |
2 | 2 | |
3 | 3 | import com.essa.framework.Model; |
4 | +import com.essa.framework.Tools; | |
4 | 5 | import org.openqa.selenium.By; |
5 | 6 | import org.openqa.selenium.WebDriver; |
6 | 7 | |
... | ... | @@ -9,7 +10,11 @@ import org.openqa.selenium.WebElement; |
9 | 10 | import org.openqa.selenium.support.FindBy; |
10 | 11 | |
11 | 12 | import java.util.Date; |
12 | - | |
13 | +/** | |
14 | +* @Description: Po看板页面 | |
15 | +* @Author: ZengJin | |
16 | +* @CreateTime: 2018/11/1 | |
17 | +*/ | |
13 | 18 | public class POBoardPage extends BasePage { |
14 | 19 | |
15 | 20 | public POBoardPage(WebDriver driver) { |
... | ... | @@ -88,8 +93,7 @@ public class POBoardPage extends BasePage { |
88 | 93 | public POBoardPage noticeReceive(){ |
89 | 94 | click(noticeReceive); |
90 | 95 | jsExecutorRemoveAttribute(inputReceiveDate,"readonly"); |
91 | - String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy"); | |
92 | - sendKeys(inputReceiveDate,date); | |
96 | + sendKeys(inputReceiveDate, Tools.getToday()); | |
93 | 97 | click(reveiveDate); |
94 | 98 | click(submit); |
95 | 99 | return new POBoardPage(driver); |
... | ... | @@ -104,8 +108,7 @@ public class POBoardPage extends BasePage { |
104 | 108 | public POBoardPage noticeLoad(){ |
105 | 109 | click(noticeLoad); |
106 | 110 | jsExecutorRemoveAttribute(inutLoadDate,"readonly"); |
107 | - String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy"); | |
108 | - sendKeys(inutLoadDate,date); | |
111 | + sendKeys(inutLoadDate,Tools.getToday()); | |
109 | 112 | click(loadDate); |
110 | 113 | forceWait(1000); |
111 | 114 | click(submit); | ... | ... |
src/main/java/com/essa/pageObject/HomePage.java
1 | 1 | package com.essa.pageObject; |
2 | 2 | |
3 | 3 | import com.essa.pageObject.DocumentaryManage.BillingCenterPage; |
4 | -import com.essa.pageObject.DocumentaryManage.POBoardPage; | |
5 | 4 | import com.essa.pageObject.DocumentaryManage.ReceiptCorePage; |
6 | 5 | import com.essa.pageObject.GoodsManage.*; |
7 | 6 | import com.essa.pageObject.LogisticShipp.LogisticsShippPage; |
... | ... | @@ -24,7 +23,7 @@ import com.essa.pageObject.inquiryManage.ProductInquiryTaskPage; |
24 | 23 | import com.essa.pageObject.marketingManage.GroupControlPage; |
25 | 24 | import com.essa.pageObject.marketingManage.GroupSettingPage; |
26 | 25 | import com.essa.pageObject.needDealt.NeedDealtApplyPage; |
27 | -import pageObiect.CabinetTask.CabineTaskManagemenPage; | |
26 | +import com.essa.pageObject.StorageManage.CabineTaskManagemenPage; | |
28 | 27 | |
29 | 28 | /** |
30 | 29 | * @author Administrator |
... | ... | @@ -201,7 +200,7 @@ public class HomePage extends BasePage{ |
201 | 200 | WebElement LogisticsskippBoard; |
202 | 201 | |
203 | 202 | //船务看板 |
204 | - @FindBy (xpath = "//*[@id='essa-left-menu']/div/dl[1]/dd[2]") | |
203 | + @FindBy (xpath = "//*[text()='船务看板']") | |
205 | 204 | WebElement skippBoard; |
206 | 205 | |
207 | 206 | //装柜通知(lana) |
... | ... | @@ -455,6 +454,7 @@ public class HomePage extends BasePage{ |
455 | 454 | */ |
456 | 455 | public NeedDealtApplyPage toSailingDateConfirmPage() { |
457 | 456 | click(confirmDailingDate); |
457 | + forceWait(1000); | |
458 | 458 | click(firstNeedDealt); |
459 | 459 | switchMoreWindow(); |
460 | 460 | return new NeedDealtApplyPage(driver); |
... | ... | @@ -552,12 +552,23 @@ public class HomePage extends BasePage{ |
552 | 552 | *进入船务看板界面 |
553 | 553 | */ |
554 | 554 | public LogisticsShippPage toLogisticsShippPage(){ |
555 | - mywait(LogisticsskippBoard); | |
555 | +// mywait(LogisticsskippBoard); | |
556 | 556 | click(LogisticsskippBoard); |
557 | - mywait(skippBoard); | |
557 | +// forceWait(1000); | |
558 | 558 | click(skippBoard); |
559 | +// jsExecutorClick(skippBoard); | |
559 | 560 | return new LogisticsShippPage(driver); |
560 | 561 | } |
562 | + /** | |
563 | + *业务员进入待办详情页,填写船务资料 | |
564 | + * @param | |
565 | + * @return | |
566 | + */ | |
567 | + public NeedDealtApplyPage toWriteShipping() { | |
568 | + click(firstNeedDealt); | |
569 | + switchMoreWindow(); | |
570 | + return new NeedDealtApplyPage(driver); | |
571 | + } | |
561 | 572 | |
562 | 573 | /** |
563 | 574 | * 进入装柜任务管理 |
... | ... | @@ -568,5 +579,13 @@ public class HomePage extends BasePage{ |
568 | 579 | click(CabineTaskManagemen); |
569 | 580 | return new CabineTaskManagemenPage(driver); |
570 | 581 | } |
582 | + /** | |
583 | + *对浏览器弹框处理 | |
584 | + * @param | |
585 | + * @return | |
586 | + */ | |
587 | + public void dealAlert(boolean isAccept){ | |
588 | + alert(isAccept); | |
589 | + } | |
571 | 590 | |
572 | 591 | } |
573 | 592 | \ No newline at end of file | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/BookingCarPage.java
1 | 1 | package com.essa.pageObject.LogisticShipp; |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Model; | |
5 | +import com.essa.framework.Tools; | |
4 | 6 | import org.openqa.selenium.WebDriver; |
5 | 7 | import org.openqa.selenium.WebElement; |
6 | 8 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -13,7 +15,7 @@ public class BookingCarPage extends BasePage { |
13 | 15 | } |
14 | 16 | |
15 | 17 | //订车看板 |
16 | - @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/ul/li[4]") | |
18 | + @FindBy(xpath = "//*[text()='订车']") | |
17 | 19 | WebElement BookingCarBoard; |
18 | 20 | |
19 | 21 | //查询条件 |
... | ... | @@ -47,16 +49,16 @@ public class BookingCarPage extends BasePage { |
47 | 49 | public BookingCarPage toBookingCarPage() { |
48 | 50 | mywait(BookingCarBoard); |
49 | 51 | click(BookingCarBoard); |
50 | - SetQuery.sendKeys("D180411T0278"); | |
52 | + SetQuery.sendKeys(Model.getPoNum()); | |
51 | 53 | click(QueryBtn); |
52 | 54 | forceWait(1000); |
53 | 55 | click(QueryRsult); |
54 | 56 | click(BookingCarBtn); |
55 | 57 | mywait(BookingCarSeclType); |
56 | 58 | click(BookingCarSeclType); |
57 | - mywait(BookingCarDate); | |
59 | +// mywait(BookingCarDate); | |
58 | 60 | jsExecutorRemoveAttribute(BookingCarDate, "readonly"); |
59 | - sendKeys(BookingCarDate, "2018/10/23"); | |
61 | + sendKeys(BookingCarDate, Tools.getToday()); | |
60 | 62 | click(SubmitBtn); |
61 | 63 | return new BookingCarPage(driver); |
62 | 64 | } | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/CabinInfoPage.java
1 | 1 | package com.essa.pageObject.LogisticShipp; |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Model; | |
5 | +import com.essa.framework.Tools; | |
6 | +import org.openqa.selenium.By; | |
4 | 7 | import org.openqa.selenium.WebDriver; |
5 | 8 | import org.openqa.selenium.WebElement; |
6 | 9 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -11,7 +14,7 @@ public class CabinInfoPage extends BasePage { |
11 | 14 | super(driver); |
12 | 15 | } |
13 | 16 | |
14 | - public String FilePath = "C:\Users\hanlei\Desktop\1.png"; | |
17 | +// public String FilePath = "C:\Users\hanlei\Desktop\1.png"; | |
15 | 18 | |
16 | 19 | //订舱看板 |
17 | 20 | @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/ul/li[3]") |
... | ... | @@ -57,25 +60,36 @@ public class CabinInfoPage extends BasePage { |
57 | 60 | @FindBy(xpath = "/html/body/div[6]/div/div/div[2]/div") |
58 | 61 | WebElement Body; |
59 | 62 | |
63 | + //预计到港时间 | |
64 | + @FindBy (xpath = "//*[@id='expectArrivalTime']") | |
65 | + WebElement expectArrivalTime; | |
66 | + | |
67 | + | |
60 | 68 | public CabinInfoPage toCabinInfoPage() { |
69 | + forceWait(1000); | |
61 | 70 | click(BookingCabin); |
62 | 71 | mywait(FirstDate); |
63 | - SetQuery.sendKeys("D180411T0278"); | |
72 | + SetQuery.sendKeys(Model.getPoNum()); | |
64 | 73 | click(QueryBtn); |
65 | - mywait(SelectFirstDate); | |
74 | +// mywait(SelectFirstDate); | |
75 | + forceWait(1000); | |
66 | 76 | click(SelectFirstDate); |
67 | 77 | click(BookingCabinBtn); |
68 | 78 | mywait(SetCabinSONo); |
69 | 79 | SetCabinSONo.sendKeys("TestCabinNo"); |
80 | + jsExecutorRemoveAttribute(expectArrivalTime,"readonly"); | |
81 | + sendKeys(expectArrivalTime,Tools.getNextMonth()); | |
70 | 82 | jsExecutorRemoveAttribute(LastLoadTimeSet, "readonly"); |
71 | - sendKeys(LastLoadTimeSet,"10/23/2018"); | |
83 | + sendKeys(LastLoadTimeSet, Tools.getToday());//最后装柜时间设置为今天 | |
72 | 84 | // LastLoadTimeSet.sendKeys("10/23/2018"); |
73 | 85 | click(Body); |
74 | 86 | // jsExecutorClick(FileUp); |
75 | 87 | actionClick(FileUp); |
76 | - uploadFile(FilePath); | |
77 | - forceWait(2000); | |
88 | + uploadFile(Model.getPicPath()); | |
89 | +// forceWait(2000); | |
90 | + dynamicLoad(By.xpath("//img[@ng-src='/img/nopic.jpg']"));//直到默认的图片找不到时,执行下一步 | |
78 | 91 | click(CommitBtn); |
92 | + dynamicLoad(); | |
79 | 93 | return new CabinInfoPage(driver); |
80 | 94 | } |
81 | 95 | } | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/LogisticsShippPage.java
... | ... | @@ -2,6 +2,9 @@ package com.essa.pageObject.LogisticShipp; |
2 | 2 | |
3 | 3 | |
4 | 4 | import com.essa.framework.BasePage; |
5 | +import com.essa.framework.Model; | |
6 | +import com.essa.pageObject.HomePage; | |
7 | +import org.openqa.selenium.By; | |
5 | 8 | import org.openqa.selenium.WebDriver; |
6 | 9 | import org.openqa.selenium.WebElement; |
7 | 10 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -45,10 +48,12 @@ public class LogisticsShippPage extends BasePage { |
45 | 48 | WebElement logout; |
46 | 49 | |
47 | 50 | //搜索并通知业务补充船务资料 |
48 | - public LogisticsShippPage isSucceed() { | |
51 | + public HomePage isSucceed() { | |
52 | + forceWait(1000); | |
49 | 53 | click(NoticeBoard); |
50 | - mywait(resultDate); | |
51 | - setPono.sendKeys("D180411T0278"); | |
54 | + dynamicWait(By.xpath("//tbody/tr[1]/td[1]/input[1]"));//列表加载 | |
55 | +// setPono.sendKeys("D180411T0278"); | |
56 | + sendKeys(setPono, Model.getPoNum()); | |
52 | 57 | click(querySubBtn); |
53 | 58 | mywait(selectedpo); |
54 | 59 | click(selectedpo); |
... | ... | @@ -56,6 +61,10 @@ public class LogisticsShippPage extends BasePage { |
56 | 61 | click(skippSubBtn); |
57 | 62 | mywait(submitSubBtn); |
58 | 63 | click(submitSubBtn); |
59 | - return new LogisticsShippPage(driver); | |
64 | + String saleman = DBSqlSearch("select a.account_name from pri_user a INNER JOIN\n" + | |
65 | + "sale_po b on a.id=b.salesman_id\n" + | |
66 | + "where b.`code` = '"+ Model.getPoNum()+"';","account_name");//根据PO单号查出对应的业务员 | |
67 | + Model.setSalesman(saleman);//将查询出的业务员存储在model中 | |
68 | + return new HomePage(driver); | |
60 | 69 | } |
61 | 70 | } | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/SendCarPage.java
1 | 1 | package com.essa.pageObject.LogisticShipp; |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Model; | |
4 | 5 | import org.openqa.selenium.WebDriver; |
5 | 6 | import org.openqa.selenium.WebElement; |
6 | 7 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -48,12 +49,14 @@ public class SendCarPage extends BasePage { |
48 | 49 | WebElement SubmitBtn; |
49 | 50 | |
50 | 51 | public SendCarPage toSendCarPage() { |
52 | + forceWait(1000); | |
51 | 53 | click(BookingCarBoard); |
52 | 54 | mywait(WaitForBookingCarBoard); |
53 | 55 | click(WaitForBookingCarBoard); |
54 | - QueryWaitForBooking.sendKeys("D180411T0278"); | |
56 | + forceWait(500); | |
57 | + QueryWaitForBooking.sendKeys(Model.getPoNum()); | |
55 | 58 | click(QueryWaitForBookingCarBtn); |
56 | - mywait(FristWaitForBookingCarDate); | |
59 | + forceWait(1000); | |
57 | 60 | click(FristWaitForBookingCarDate); |
58 | 61 | click(ConfirmBookingCar); |
59 | 62 | mywait(SetContainerNo); | ... | ... |
src/main/java/com/essa/pageObject/PODocumentary/POBoardPage.java
1 | 1 | package com.essa.pageObject.PODocumentary; |
2 | 2 | |
3 | +import com.essa.framework.Tools; | |
3 | 4 | import org.openqa.selenium.By; |
4 | 5 | import org.openqa.selenium.WebDriver; |
5 | 6 | import com.essa.framework.BasePage; |
... | ... | @@ -64,8 +65,8 @@ public class POBoardPage extends BasePage { |
64 | 65 | public POBoardPage toNotificationLoading(){ |
65 | 66 | click(NotificationLoading); |
66 | 67 | jsExecutorRemoveAttribute(loadingDate,"readonly"); |
67 | - String Loadingdate = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); | |
68 | - sendKeys(loadingDate,Loadingdate); | |
68 | +// String Loadingdate = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); | |
69 | + sendKeys(loadingDate, Tools.getToday()); | |
69 | 70 | click(BlankPlace); |
70 | 71 | click(submit); |
71 | 72 | forceWait(4000); | ... | ... |
src/main/java/pageObiect/CabinetTask/CabineTaskManagemenPage.java renamed to src/main/java/com/essa/pageObject/StorageManage/CabineTaskManagemenPage.java
1 | -package pageObiect.CabinetTask; | |
1 | +package com.essa.pageObject.StorageManage; | |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | 4 | import com.essa.framework.Model; |
... | ... | @@ -39,7 +39,7 @@ public class CabineTaskManagemenPage extends BasePage{ |
39 | 39 | /* |
40 | 40 | * 页面参数 |
41 | 41 | * */ |
42 | - String poNo=""; | |
42 | +// String poNo=""; | |
43 | 43 | |
44 | 44 | /* |
45 | 45 | * 页面方法 |
... | ... | @@ -50,12 +50,13 @@ public class CabineTaskManagemenPage extends BasePage{ |
50 | 50 | */ |
51 | 51 | public CabineTaskManagemenPage setWareHouse() { |
52 | 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 | - } | |
53 | +// if(Model.getPoNum()!=""|| Model.getPoNum()!=null){ | |
54 | +// poNo="B180828T9165"; | |
55 | +// sendKeys(selectKey, poNo); | |
56 | +// }else{ | |
57 | +// sendKeys(selectKey, Model.getPoNum()); | |
58 | +// } | |
59 | + sendKeys(selectKey, Model.getPoNum()); | |
59 | 60 | click(search); |
60 | 61 | forceWait(1000); |
61 | 62 | click(firstTr); | ... | ... |
src/main/java/pageObiect/CabinetTask/HandlingLoadingOrders.java renamed to src/main/java/com/essa/pageObject/StorageManage/HandlingLoadingOrders.java
1 | -package pageObiect.CabinetTask; | |
1 | +package com.essa.pageObject.StorageManage; | |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Tools; | |
4 | 5 | import org.openqa.selenium.By; |
5 | 6 | import org.openqa.selenium.WebDriver; |
6 | 7 | import org.openqa.selenium.WebElement; |
7 | 8 | import org.openqa.selenium.support.FindBy; |
8 | 9 | |
9 | 10 | import java.text.SimpleDateFormat; |
10 | -import java.util.ArrayList; | |
11 | 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 | 12 | |
20 | 13 | |
21 | 14 | /** |
15 | + * 装柜任务处理页面 | |
22 | 16 | * Created by Administrator on 2018/10/30 0030. |
23 | 17 | */ |
24 | 18 | public class HandlingLoadingOrders extends BasePage { |
... | ... | @@ -73,12 +67,14 @@ public class HandlingLoadingOrders extends BasePage { |
73 | 67 | dynamicLoad(By.xpath("//div[@style='display: none;' and @id='mask']")); |
74 | 68 | //设置实际装柜日期 |
75 | 69 | 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); | |
70 | +// loadCompleteDate.click(); | |
71 | +// forceWait(500); | |
72 | +// SimpleDateFormat zs=new SimpleDateFormat("MM/dd/yyyy"); | |
73 | +// String s =zs.format(new Date()); | |
74 | +// sendKeys(loadCompleteDate,s); | |
75 | + sendKeys(loadCompleteDate, Tools.getToday()); | |
81 | 76 | click(submit); |
77 | + dynamicLoad(); | |
82 | 78 | return new HandlingLoadingOrders(driver); |
83 | 79 | } |
84 | 80 | ... | ... |
src/main/java/com/essa/pageObject/StorageManage/LoadContainerHandlePage.java
... | ... | @@ -2,6 +2,7 @@ package com.essa.pageObject.StorageManage; |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | 4 | import com.essa.framework.Model; |
5 | +import com.essa.framework.Tools; | |
5 | 6 | import org.openqa.selenium.By; |
6 | 7 | import org.openqa.selenium.WebDriver; |
7 | 8 | import org.openqa.selenium.WebElement; |
... | ... | @@ -48,8 +49,8 @@ public class LoadContainerHandlePage extends BasePage { |
48 | 49 | public LoadContainerHandlePage loadTaskHandle(){ |
49 | 50 | forceWait(1000); |
50 | 51 | jsExecutorRemoveAttribute(actLoadTime,"readonly"); |
51 | - String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); | |
52 | - sendKeys(actLoadTime,date); | |
52 | +// String date = getDateTimeByFormat(new Date(), "MM/dd/yyyy"); | |
53 | + sendKeys(actLoadTime, Tools.getToday()); | |
53 | 54 | // 获取‘可装柜数量’字符串中的数量 |
54 | 55 | String qua = partiaStr(mayLoadQuantity,0,1); |
55 | 56 | // 对切片结果进行int转换 | ... | ... |
src/main/java/com/essa/pageObject/StorageManage/LoadContainerManagePage.java
... | ... | @@ -7,7 +7,11 @@ import org.openqa.selenium.By; |
7 | 7 | import org.openqa.selenium.WebDriver; |
8 | 8 | import org.openqa.selenium.WebElement; |
9 | 9 | import org.openqa.selenium.support.FindBy; |
10 | - | |
10 | +/** | |
11 | +* @Description: 装柜任务管理列表 | |
12 | +* @Author: ZengJin | |
13 | +* @CreateTime: 2018/11/1 | |
14 | +*/ | |
11 | 15 | public class LoadContainerManagePage extends BasePage { |
12 | 16 | |
13 | 17 | public LoadContainerManagePage(WebDriver driver) { | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/LargeDcofdPage.java renamed to src/main/java/com/essa/pageObject/needDealt/LargeDcofdPage.java
1 | -package com.essa.pageObject.LogisticShipp; | |
1 | +package com.essa.pageObject.needDealt; | |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.pageObject.HomePage; | |
5 | +import org.openqa.selenium.By; | |
4 | 6 | import org.openqa.selenium.WebDriver; |
5 | 7 | import org.openqa.selenium.WebElement; |
6 | 8 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -15,9 +17,16 @@ public class LargeDcofdPage extends BasePage { |
15 | 17 | @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div[4]/span[1]/button[2]") |
16 | 18 | WebElement ConfirmationShipDate; |
17 | 19 | |
18 | - public LargeDcofdPage toLargeDcofdPage(){ | |
19 | - mywait(ConfirmationShipDate); | |
20 | + /** | |
21 | + *大跟单确认船期 | |
22 | + * @param | |
23 | + * @return | |
24 | + */ | |
25 | + public HomePage toLargeDcofdPage(){ | |
26 | +// mywait(ConfirmationShipDate); | |
27 | + dynamicWait(By.xpath("//*[contains(text(),'待办工作')]")); | |
20 | 28 | click(ConfirmationShipDate); |
21 | - return new LargeDcofdPage(driver); | |
29 | + dynamicLoad(); | |
30 | + return new HomePage(driver); | |
22 | 31 | } |
23 | 32 | } | ... | ... |
src/main/java/com/essa/pageObject/needDealt/NeedDealtApplyPage.java
1 | 1 | package com.essa.pageObject.needDealt; |
2 | 2 | |
3 | +import com.essa.framework.Tools; | |
3 | 4 | import org.openqa.selenium.By; |
4 | 5 | import org.openqa.selenium.JavascriptExecutor; |
5 | 6 | import org.openqa.selenium.WebDriver; |
... | ... | @@ -10,6 +11,8 @@ import com.essa.framework.BasePage; |
10 | 11 | import com.essa.framework.Model; |
11 | 12 | import com.essa.pageObject.HomePage; |
12 | 13 | |
14 | +import java.util.Date; | |
15 | + | |
13 | 16 | /** |
14 | 17 | * 当团购活动成功时,类目经理采购计划单申请页面 |
15 | 18 | * @author Administrator |
... | ... | @@ -157,11 +160,12 @@ public class NeedDealtApplyPage extends BasePage { |
157 | 160 | //设置开船日期 |
158 | 161 | jsExecutorRemoveAttribute(inputShipperStartDate,"readonly"); |
159 | 162 | inputShipperStartDate.clear(); |
160 | - sendKeys(inputShipperStartDate,"10/25/2018"); | |
163 | +// String date = getDateTimeByFormat(new Date(),"MM/dd/yyyy"); | |
164 | + sendKeys(inputShipperStartDate, Tools.getNextMonth()); | |
161 | 165 | //设置预计到港日期 |
162 | 166 | jsExecutorRemoveAttribute(inputShipperArriveDate,"readonly"); |
163 | 167 | inputShipperArriveDate.clear(); |
164 | - sendKeys(inputShipperArriveDate,"11/10/2018"); | |
168 | + sendKeys(inputShipperArriveDate,Tools.getNextMonth()); | |
165 | 169 | //提交 |
166 | 170 | click(submit); |
167 | 171 | dynamicLoad(); | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/RegisOptShpDatePage.java renamed to src/main/java/com/essa/pageObject/needDealt/RegisOptShpDatePage.java
1 | -package com.essa.pageObject.LogisticShipp; | |
1 | +package com.essa.pageObject.needDealt; | |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Model; | |
5 | +import com.essa.framework.Tools; | |
6 | +import com.essa.pageObject.HomePage; | |
7 | +import org.openqa.selenium.By; | |
4 | 8 | import org.openqa.selenium.WebDriver; |
5 | 9 | import org.openqa.selenium.WebElement; |
6 | 10 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -35,19 +39,32 @@ public class RegisOptShpDatePage extends BasePage { |
35 | 39 | @FindBy(xpath = "//*[@id='tableViewList']/div/div/div/div[4]/span[1]/button[2]") |
36 | 40 | WebElement SubmitBtn; |
37 | 41 | |
38 | - public RegisOptShpDatePage toRegisOptShpDatePage(){ | |
39 | - mywait(ClaimTask); | |
40 | - forceWait(1000); | |
41 | - click(ClaimTask); | |
42 | + //流水号 | |
43 | + @FindBy (xpath = "//*[contains(text(),'流水号:RW')]") | |
44 | + WebElement serialNumber; | |
45 | + | |
46 | + /** | |
47 | + *登记船期 | |
48 | + * @param | |
49 | + * @return HomePage | |
50 | + */ | |
51 | + public HomePage toRegisOptShpDatePage(){ | |
52 | + dynamicWait(By.xpath("//*[contains(text(),'待办工作')]")); | |
53 | + if (isVisibility(By.xpath("//*[@id='tableViewList']/div/div/div/div[4]/button"))){ | |
54 | + click(ClaimTask);//如果需要认领,则认领 | |
55 | + forceWait(4000); | |
56 | + } | |
42 | 57 | mywait(AddShippInfo); |
58 | + Model.setSerialNum(partialStr(serialNumber.getText(), "流水号:")); | |
43 | 59 | click(AddShippInfo); |
44 | 60 | mywait(AddShippCompanyInfo); |
45 | 61 | AddShippCompanyInfo.sendKeys("TestShippCompanyInfo"); |
46 | 62 | jsExecutorRemoveAttribute(SetdeliveryDate0, "readonly"); |
47 | - sendKeys(SetdeliveryDate0,"10/23/2018"); | |
63 | + sendKeys(SetdeliveryDate0, Tools.moreDays(20)); | |
48 | 64 | jsExecutorRemoveAttribute(SetEstimatedArrivalDate0, "readonly"); |
49 | - sendKeys(SetEstimatedArrivalDate0,"10/23/2018"); | |
65 | + sendKeys(SetEstimatedArrivalDate0,Tools.moreDays(20)); | |
50 | 66 | click(SubmitBtn); |
51 | - return new RegisOptShpDatePage(driver); | |
67 | + dynamicLoad(); | |
68 | + return new HomePage(driver); | |
52 | 69 | } |
53 | 70 | } | ... | ... |
src/main/java/com/essa/pageObject/LogisticShipp/SellerFillInfoPage.java renamed to src/main/java/com/essa/pageObject/needDealt/SellerFillInfoPage.java
1 | -package com.essa.pageObject.LogisticShipp; | |
1 | +package com.essa.pageObject.needDealt; | |
2 | 2 | |
3 | 3 | import com.essa.framework.BasePage; |
4 | +import com.essa.framework.Model; | |
5 | +import com.essa.pageObject.HomePage; | |
6 | +import org.openqa.selenium.By; | |
4 | 7 | import org.openqa.selenium.WebDriver; |
5 | 8 | import org.openqa.selenium.WebElement; |
6 | 9 | import org.openqa.selenium.support.FindBy; |
... | ... | @@ -95,12 +98,23 @@ public class SellerFillInfoPage extends BasePage { |
95 | 98 | @FindBy(xpath = "//*[text()='确认']") |
96 | 99 | WebElement SubmitBtn; |
97 | 100 | |
98 | - public SellerFillInfoPage toSellerFillInfo() { | |
99 | - mywait(AppointSet); | |
101 | + //流水号 | |
102 | + @FindBy (xpath = "//*[contains(text(),'流水号:RW')]") | |
103 | + WebElement serialNumber; | |
104 | + | |
105 | + /** | |
106 | + *业务员填写船务资料 | |
107 | + * @param | |
108 | + * @return | |
109 | + */ | |
110 | + public HomePage toSellerFillInfo() { | |
111 | +// mywait(AppointSet); | |
112 | + dynamicWait(By.xpath("//*[contains(text(),'待办工作')]")); | |
113 | + Model.setSerialNum(partialStr(serialNumber.getText(), "流水号:"));//将流水号传递出去 | |
100 | 114 | click(AppointSet); |
101 | 115 | click(DeclareSet); |
102 | 116 | click(AppointCompanySet); |
103 | - mywait(AppointCompanySec); | |
117 | + forceWait(1000); | |
104 | 118 | click(AppointCompanySec); |
105 | 119 | click(CommitAppointCompanySec); |
106 | 120 | mywait(TargetPortSet); |
... | ... | @@ -122,6 +136,7 @@ public class SellerFillInfoPage extends BasePage { |
122 | 136 | MailZipcode.sendKeys("TestMailZipCode"); |
123 | 137 | MailFax.sendKeys("TestMailFax"); |
124 | 138 | click(SubmitBtn); |
125 | - return new SellerFillInfoPage(driver); | |
139 | + dynamicLoad(); | |
140 | + return new HomePage(driver); | |
126 | 141 | } |
127 | 142 | } | ... | ... |
src/main/java/com/essa/testSuite/TestConfirLogistics.java
1 | 1 | package com.essa.testSuite; |
2 | 2 | |
3 | +import com.essa.framework.Model; | |
3 | 4 | import com.essa.pageObject.LogisticShipp.*; |
5 | +import com.essa.pageObject.needDealt.LargeDcofdPage; | |
6 | +import com.essa.pageObject.needDealt.RegisOptShpDatePage; | |
7 | +import com.essa.pageObject.needDealt.SellerFillInfoPage; | |
4 | 8 | import org.openqa.selenium.WebDriver; |
5 | 9 | import org.openqa.selenium.support.PageFactory; |
6 | 10 | import org.testng.annotations.AfterClass; |
... | ... | @@ -36,32 +40,35 @@ public class TestConfirLogistics extends BaseTest { |
36 | 40 | |
37 | 41 | homePage.getHome(); |
38 | 42 | homePage.logout(); |
39 | - loginValid("yanqingping"); | |
43 | + loginValid(Model.getSalesman());//登录对应的业务员账号 | |
40 | 44 | |
41 | 45 | //待办 |
42 | - homePage.toSailingDateConfirmPage(); | |
46 | +// homePage.toSailingDateConfirmPage(); | |
47 | + homePage.toWriteShipping(); | |
43 | 48 | //业务员补充船务资料 |
44 | 49 | SellerFillInfoPage sellerFillInfo = PageFactory.initElements(driver, SellerFillInfoPage.class); |
45 | 50 | sellerFillInfo.toSellerFillInfo(); |
46 | 51 | |
47 | 52 | //登记备选船期待办 |
48 | - homePage.getHome(); | |
53 | +// homePage.getHome(); | |
49 | 54 | homePage.logout(); |
50 | 55 | loginValid("wangmiaodan"); |
51 | 56 | homePage.toSailingDateConfirmPage(); |
57 | +// homePage.toShippingMarkWait();//根据流水号进入待办 | |
52 | 58 | RegisOptShpDatePage regisOptShpDatePage = PageFactory.initElements(driver,RegisOptShpDatePage.class); |
53 | 59 | regisOptShpDatePage.toRegisOptShpDatePage(); |
54 | 60 | |
55 | 61 | //大跟单确认 |
56 | - homePage.getHome(); | |
62 | +// homePage.getHome(); | |
57 | 63 | homePage.logout(); |
58 | 64 | loginValid("yuwanhang"); |
59 | - homePage.toSailingDateConfirmPage(); | |
65 | +// homePage.toSailingDateConfirmPage(); | |
66 | + homePage.toShippingMarkWait();//根据流水号进入待办 | |
60 | 67 | LargeDcofdPage largeDcofdPage = PageFactory.initElements(driver,LargeDcofdPage.class); |
61 | 68 | largeDcofdPage.toLargeDcofdPage(); |
62 | 69 | |
63 | 70 | //订舱 |
64 | - homePage.getHome(); | |
71 | +// homePage.getHome(); | |
65 | 72 | homePage.logout(); |
66 | 73 | loginValid("chenhong"); |
67 | 74 | |
... | ... | @@ -76,6 +83,5 @@ public class TestConfirLogistics extends BaseTest { |
76 | 83 | //确认发车 |
77 | 84 | SendCarPage sendCarPage = PageFactory.initElements(driver, SendCarPage.class); |
78 | 85 | sendCarPage.toSendCarPage(); |
79 | - | |
80 | 86 | } |
81 | 87 | } | ... | ... |
src/main/java/com/essa/testSuite/TestConfirmCabinet.java
... | ... | @@ -11,8 +11,8 @@ import org.openqa.selenium.support.PageFactory; |
11 | 11 | import org.testng.annotations.AfterClass; |
12 | 12 | import org.testng.annotations.BeforeClass; |
13 | 13 | import org.testng.annotations.Test; |
14 | -import pageObiect.CabinetTask.CabineTaskManagemenPage; | |
15 | -import pageObiect.CabinetTask.HandlingLoadingOrders; | |
14 | +import com.essa.pageObject.StorageManage.CabineTaskManagemenPage; | |
15 | +import com.essa.pageObject.StorageManage.HandlingLoadingOrders; | |
16 | 16 | |
17 | 17 | import java.io.IOException; |
18 | 18 | |
... | ... | @@ -29,10 +29,10 @@ public class TestConfirmCabinet extends BaseTest { |
29 | 29 | loginValid("chenyijie"); |
30 | 30 | } |
31 | 31 | |
32 | -// @AfterClass | |
33 | -// public void tearDown() { | |
34 | -// driver.quit(); | |
35 | -// } | |
32 | + @AfterClass | |
33 | + public void tearDown() { | |
34 | + driver.quit(); | |
35 | + } | |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * 查到存在有装柜任务,进入处理页面 |
... | ... | @@ -48,15 +48,6 @@ public class TestConfirmCabinet extends BaseTest { |
48 | 48 | handlingLoadingOrders.setHandlingCabinet(); |
49 | 49 | } |
50 | 50 | |
51 | - /** | |
52 | - * 进入处理页面(默认单号可以装柜) | |
53 | - */ | |
54 | -// @Test(description="进入装柜操作页面,进行操作") | |
55 | -// public void handlingLoadingOrders(){ | |
56 | -// driver = getDriver(); | |
57 | -// //已进入处理页面 | |
58 | -// | |
59 | -// } | |
60 | 51 | |
61 | 52 | } |
62 | 53 | ... | ... |
src/main/java/com/essa/testSuite/TestLoadContainer.java
1 | 1 | package com.essa.testSuite; |
2 | 2 | |
3 | +import com.essa.framework.Model; | |
3 | 4 | import com.essa.pageObject.BaseTest; |
4 | 5 | import com.essa.pageObject.DocumentaryManage.BillingCenterPage; |
5 | 6 | import com.essa.pageObject.DocumentaryManage.ConvertTailPage; |
6 | 7 | import com.essa.pageObject.DocumentaryManage.POBoardPage; |
7 | 8 | import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage; |
8 | 9 | import com.essa.pageObject.HomePage; |
9 | -import com.essa.pageObject.StorageManage.GoodsReceiveTaskPage; | |
10 | -import com.essa.pageObject.StorageManage.NoticeReceivePage; | |
11 | -import com.essa.pageObject.StorageManage.ReceiveTaskDealPage; | |
10 | +import com.essa.pageObject.LogisticShipp.BookingCarPage; | |
11 | +import com.essa.pageObject.LogisticShipp.CabinInfoPage; | |
12 | +import com.essa.pageObject.LogisticShipp.LogisticsShippPage; | |
13 | +import com.essa.pageObject.LogisticShipp.SendCarPage; | |
14 | +import com.essa.pageObject.StorageManage.*; | |
15 | +import com.essa.pageObject.needDealt.LargeDcofdPage; | |
12 | 16 | import com.essa.pageObject.needDealt.NeedDealtApplyPage; |
17 | +import com.essa.pageObject.needDealt.RegisOptShpDatePage; | |
18 | +import com.essa.pageObject.needDealt.SellerFillInfoPage; | |
13 | 19 | import org.openqa.selenium.WebDriver; |
14 | 20 | import org.openqa.selenium.support.PageFactory; |
15 | 21 | import org.testng.annotations.AfterClass; |
... | ... | @@ -35,7 +41,7 @@ public class TestLoadContainer extends BaseTest { |
35 | 41 | /** |
36 | 42 | * 转尾货 |
37 | 43 | */ |
38 | - @Test | |
44 | + @Test(description = "转在途尾货") | |
39 | 45 | public void toTail() { |
40 | 46 | driver = getDriver(); |
41 | 47 | loginValid("chenyijie"); |
... | ... | @@ -52,7 +58,7 @@ public class TestLoadContainer extends BaseTest { |
52 | 58 | /** |
53 | 59 | * 设置收货、装柜的仓库地址 |
54 | 60 | */ |
55 | - @Test | |
61 | + @Test(description = "设置收货、装柜的仓库地址") | |
56 | 62 | public void noticReceive() { |
57 | 63 | driver = getDriver(); |
58 | 64 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); |
... | ... | @@ -93,7 +99,7 @@ public class TestLoadContainer extends BaseTest { |
93 | 99 | /** |
94 | 100 | * 收货任务管理,处理 |
95 | 101 | */ |
96 | - @Test | |
102 | + @Test (description = "收货任务处理") | |
97 | 103 | public void dealWithDelivery() { |
98 | 104 | driver = getDriver(); |
99 | 105 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); |
... | ... | @@ -104,12 +110,16 @@ public class TestLoadContainer extends BaseTest { |
104 | 110 | goodsReceiveTaskPage.dealReceive(); |
105 | 111 | receiveTaskDealPage.allReceive(); |
106 | 112 | }while (!(goodsReceiveTaskPage.isFinish())); |
113 | + | |
114 | + homePage.getHome(); | |
115 | + homePage.dealAlert(true);//确认弹框:离开 | |
116 | + homePage.logout(); | |
107 | 117 | } |
108 | 118 | |
109 | 119 | /** |
110 | 120 | * 大跟单确认船期 |
111 | 121 | */ |
112 | - @Test | |
122 | + @Test (description = "大跟单确认船期") | |
113 | 123 | public void confirmSailingDate() { |
114 | 124 | driver = getDriver(); |
115 | 125 | loginValid("yuwanhang"); |
... | ... | @@ -123,13 +133,89 @@ public class TestLoadContainer extends BaseTest { |
123 | 133 | * @param |
124 | 134 | * @return |
125 | 135 | */ |
126 | - @Test | |
136 | + @Test(description = "制单、发单") | |
127 | 137 | public void Billing(){ |
128 | 138 | this.driver = getDriver(); |
129 | 139 | HomePage homePage = PageFactory.initElements(driver, HomePage.class); |
130 | 140 | BillingCenterPage billingCenterPage = PageFactory.initElements(driver,BillingCenterPage.class); |
131 | 141 | homePage.toBillingCenterPage(); |
132 | 142 | billingCenterPage.MoreBilling(); |
143 | + homePage.getHome(); | |
144 | + homePage.logout(); | |
145 | + } | |
146 | + @Test(description = "通知确认船务资料、订车、发车") | |
147 | + public void confirmLogisticsTest() { | |
148 | + this.driver = getDriver(); | |
149 | + loginValid("chenhong"); | |
150 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | |
151 | + homePage.toLogisticsShippPage(); | |
152 | + | |
153 | + //通知业务人员和客户,进行船务资料确认 | |
154 | + LogisticsShippPage logisticsShippPage = PageFactory.initElements(driver, LogisticsShippPage.class); | |
155 | + logisticsShippPage.isSucceed(); | |
156 | + | |
157 | + homePage.getHome(); | |
133 | 158 | homePage.logout(); |
159 | + loginValid(Model.getSalesman());//登录对应的业务员账号 | |
160 | + | |
161 | + //待办 | |
162 | +// homePage.toSailingDateConfirmPage(); | |
163 | + homePage.toWriteShipping(); | |
164 | + //业务员补充船务资料 | |
165 | + SellerFillInfoPage sellerFillInfo = PageFactory.initElements(driver, SellerFillInfoPage.class); | |
166 | + sellerFillInfo.toSellerFillInfo(); | |
167 | + | |
168 | + //登记备选船期待办 | |
169 | +// homePage.getHome(); | |
170 | + homePage.logout(); | |
171 | + loginValid("wangmiaodan"); | |
172 | + homePage.toSailingDateConfirmPage(); | |
173 | +// homePage.toShippingMarkWait();//根据流水号进入待办 | |
174 | + RegisOptShpDatePage regisOptShpDatePage = PageFactory.initElements(driver,RegisOptShpDatePage.class); | |
175 | + regisOptShpDatePage.toRegisOptShpDatePage(); | |
176 | + | |
177 | + //大跟单确认 | |
178 | +// homePage.getHome(); | |
179 | + homePage.logout(); | |
180 | + loginValid("yuwanhang"); | |
181 | +// homePage.toSailingDateConfirmPage(); | |
182 | + homePage.toShippingMarkWait();//根据流水号进入待办 | |
183 | + LargeDcofdPage largeDcofdPage = PageFactory.initElements(driver,LargeDcofdPage.class); | |
184 | + largeDcofdPage.toLargeDcofdPage(); | |
185 | + | |
186 | + //订舱 | |
187 | +// homePage.getHome(); | |
188 | + homePage.logout(); | |
189 | + loginValid("chenhong"); | |
190 | + | |
191 | + homePage.toLogisticsShippPage(); | |
192 | + CabinInfoPage cabinInfoPage = PageFactory.initElements(driver, CabinInfoPage.class); | |
193 | + cabinInfoPage.toCabinInfoPage(); | |
194 | + | |
195 | + //订车信息确认 | |
196 | + BookingCarPage bookingCarPage = PageFactory.initElements(driver, BookingCarPage.class); | |
197 | + bookingCarPage.toBookingCarPage(); | |
198 | + | |
199 | + //确认发车 | |
200 | + SendCarPage sendCarPage = PageFactory.initElements(driver, SendCarPage.class); | |
201 | + sendCarPage.toSendCarPage(); | |
202 | + | |
203 | + homePage.getHome(); | |
204 | + homePage.logout(); | |
205 | + } | |
206 | + | |
207 | + /** | |
208 | + * 查到存在有装柜任务,进入处理页面 | |
209 | + */ | |
210 | + @Test(description="根据PO单号,确认装柜") | |
211 | + public void ConfirmCabinet(){ | |
212 | + driver = getDriver(); | |
213 | + loginValid("chenyijie"); | |
214 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | |
215 | + homePage.toCabineTaskManagemenPage(); | |
216 | + CabineTaskManagemenPage searchCabineTaskManagemenPage = PageFactory.initElements(driver, CabineTaskManagemenPage.class); | |
217 | + searchCabineTaskManagemenPage.setWareHouse(); | |
218 | + HandlingLoadingOrders handlingLoadingOrders = PageFactory.initElements(driver, HandlingLoadingOrders.class); | |
219 | + handlingLoadingOrders.setHandlingCabinet(); | |
134 | 220 | } |
135 | 221 | } | ... | ... |
src/main/java/pageObiect/CabinetTask/CabinetsNoticePage.java deleted
... | ... | @@ -1,14 +0,0 @@ |
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/swing/SwingMain.java
... | ... | @@ -164,6 +164,9 @@ public class SwingMain { |
164 | 164 | frmvBy.getContentPane().add(ToCart); |
165 | 165 | ToCart.setLayout(null); |
166 | 166 | |
167 | + | |
168 | + | |
169 | + | |
167 | 170 | //可视化操作选项 |
168 | 171 | JLabel label_1 = new JLabel("可视化操作:"); |
169 | 172 | label_1.setBounds(10, 119, 88, 15); |
... | ... | @@ -279,6 +282,7 @@ public class SwingMain { |
279 | 282 | ToCart.setVisible(false); |
280 | 283 | POInquiry.setVisible(false); |
281 | 284 | register.setVisible(false); |
285 | +// loadFinish.setVisible(false); | |
282 | 286 | switch ((String)selectScene.getSelectedItem()){ |
283 | 287 | default: |
284 | 288 | process.setText( |
... | ... | @@ -327,11 +331,17 @@ public class SwingMain { |
327 | 331 | addOriginal.setVisible(true); |
328 | 332 | ja.append(getCurrentTime() + "已选择场景:新增开发商品\r\n"); |
329 | 333 | break; |
334 | + case "装柜完成": | |
335 | + ToCart.setVisible(true); | |
336 | + ja.append(getCurrentTime() + "已选择场景:装柜完成,将重启浏览器多次\r\n"); | |
337 | + process.setText( | |
338 | + "<html><body>装柜流程:<br>1.添加商品到购物车<br>2.询价并拼柜生成PO<br>3.仓储管理船务管理至装柜完成<br><br><br></body></html>"); | |
339 | + break; | |
330 | 340 | } |
331 | 341 | } |
332 | 342 | }); |
333 | 343 | selectScene.setModel( |
334 | - new DefaultComboBoxModel(new String[] { "新增原厂商品", "新增市场商品", "发布团购", "采购商注册", "成品询价", "生成PO", "PO询价","新增开发商品" })); | |
344 | + new DefaultComboBoxModel(new String[] { "新增原厂商品", "新增市场商品","新增开发商品","装柜完成", "发布团购", "采购商注册", "成品询价", "生成PO", "PO询价" })); | |
335 | 345 | frmvBy.getContentPane().add(selectScene); |
336 | 346 | |
337 | 347 | JLabel label_3 = new JLabel("供应商名称:"); |
... | ... | @@ -370,6 +380,15 @@ public class SwingMain { |
370 | 380 | picPath.setVisible(false); |
371 | 381 | addOriginal.add(picPath); |
372 | 382 | |
383 | +// //装柜完成场景============= | |
384 | +// final JPanel loadFinish = new JPanel(); | |
385 | +// loadFinish.setBounds(231, 42, 230, 128); | |
386 | +//// loadFinish.setVisible(false); | |
387 | +// loadFinish.add(picPath);//添加图片按钮 | |
388 | +// loadFinish.add(label_7);//必填项 | |
389 | +// frmvBy.getContentPane().add(loadFinish); | |
390 | +// loadFinish.setLayout(null); | |
391 | + | |
373 | 392 | JLabel label_5 = new JLabel("采购商编号:"); |
374 | 393 | label_5.setFont(new Font("微软雅黑", Font.PLAIN, 14)); |
375 | 394 | label_5.setBounds(8, 15, 86, 15); |
... | ... | @@ -449,7 +468,7 @@ public class SwingMain { |
449 | 468 | ToCart.add(account); |
450 | 469 | account.setColumns(10); |
451 | 470 | |
452 | - password = new JTextField(); | |
471 | + password = new JPasswordField(); | |
453 | 472 | password.setText("essa123"); |
454 | 473 | password.setToolTipText(""); |
455 | 474 | password.setFont(new Font("微软雅黑", Font.PLAIN, 14)); |
... | ... | @@ -547,33 +566,46 @@ public class SwingMain { |
547 | 566 | setData("buyerNo", buyerNo2.getText()); |
548 | 567 | setData("buyerAccount", account.getText()); |
549 | 568 | ja.append(getCurrentTime() + "程序正在启动中……切勿双击【开始】\r\n"); |
569 | + | |
570 | + Model.setBuyerNo(buyerNo2.getText()); | |
571 | + Model.setPicPath(picPath.getText()); | |
572 | + Model.setSupplierName(supplierName.getText()); | |
550 | 573 | BrowserEngine.setInit(Environment, Browser); |
574 | + if (!(registerAccount.getText().equals("") | |
575 | + || registerAccount.getText().equals("若不填写将自动生成"))) { | |
576 | + Model.setEmail(registerAccount.getText()); | |
577 | + } | |
578 | + Model.setBuyerAccount(account.getText()); | |
579 | + Model.setBuyerPassword(password.getText()); | |
580 | + Model.setSkuNo(SkuNo.getText()); | |
581 | + Model.setPoNum(po.getText()); | |
582 | + | |
551 | 583 | TestNG testNG = new TestNG(); |
552 | 584 | List<String> suites = new ArrayList<String>(); |
553 | 585 | switch (Scene){ |
554 | 586 | |
555 | 587 | case "新增市场商品": |
556 | - Model.setBuyerNo(buyerNo2.getText()); | |
557 | - Model.setPicPath(picPath.getText()); | |
558 | - Model.setSupplierName(supplierName.getText()); | |
588 | +// Model.setBuyerNo(buyerNo2.getText()); | |
589 | +// Model.setPicPath(picPath.getText()); | |
590 | +// Model.setSupplierName(supplierName.getText()); | |
559 | 591 | suites.add(SuitesEnum.ADD_MARKET_GOODS.getSuiteName()); |
560 | 592 | break; |
561 | 593 | case "发布团购": |
562 | 594 | AddOriginalGoodsPage.setSupplierName(supplierName.getText()); |
563 | - Model.setPicPath(picPath.getText()); | |
595 | +// Model.setPicPath(picPath.getText()); | |
564 | 596 | suites.add(SuitesEnum.PUBLISH_GROUP_PURCHASE.getSuiteName()); |
565 | 597 | break; |
566 | 598 | case "采购商注册": |
567 | - if (!(registerAccount.getText().equals("") | |
568 | - || registerAccount.getText().equals("若不填写将自动生成"))) { | |
569 | - Model.setEmail(registerAccount.getText()); | |
570 | - } | |
599 | +// if (!(registerAccount.getText().equals("") | |
600 | +// || registerAccount.getText().equals("若不填写将自动生成"))) { | |
601 | +// Model.setEmail(registerAccount.getText()); | |
602 | +// } | |
571 | 603 | suites.add(SuitesEnum.BUYER_REGISTER.getSuiteName()); |
572 | 604 | break; |
573 | 605 | case "成品询价": |
574 | - Model.setBuyerAccount(account.getText()); | |
575 | - Model.setBuyerPassword(password.getText()); | |
576 | - Model.setSkuNo(SkuNo.getText()); | |
606 | +// Model.setBuyerAccount(account.getText()); | |
607 | +// Model.setBuyerPassword(password.getText()); | |
608 | +// Model.setSkuNo(SkuNo.getText()); | |
577 | 609 | if (Model.getIsactivity() == 1) { |
578 | 610 | suites.add(SuitesEnum.ACTIVITY_INQUIRY.getSuiteName()); |
579 | 611 | }else { |
... | ... | @@ -581,9 +613,9 @@ public class SwingMain { |
581 | 613 | } |
582 | 614 | break; |
583 | 615 | case "生成PO": |
584 | - Model.setBuyerAccount(account.getText()); | |
585 | - Model.setBuyerPassword(password.getText()); | |
586 | - Model.setSkuNo(SkuNo.getText()); | |
616 | +// Model.setBuyerAccount(account.getText()); | |
617 | +// Model.setBuyerPassword(password.getText()); | |
618 | +// Model.setSkuNo(SkuNo.getText()); | |
587 | 619 | if (Model.getIsactivity() == 1) { |
588 | 620 | suites.add(SuitesEnum.ACTIVITY_SEND_PO.getSuiteName()); |
589 | 621 | }else { |
... | ... | @@ -591,18 +623,24 @@ public class SwingMain { |
591 | 623 | } |
592 | 624 | break; |
593 | 625 | case "PO询价": |
594 | - Model.setPoNum(po.getText()); | |
626 | +// Model.setPoNum(po.getText()); | |
595 | 627 | suites.add(SuitesEnum.PO_INQUIRY.getSuiteName()); |
596 | 628 | break; |
597 | 629 | default : //默认新增原厂商品 |
598 | 630 | AddOriginalGoodsPage.setSupplierName(supplierName.getText()); |
599 | - Model.setPicPath(picPath.getText()); | |
631 | +// Model.setPicPath(picPath.getText()); | |
600 | 632 | suites.add(SuitesEnum.ADD_ORIGINAL_GOODS.getSuiteName()); |
601 | 633 | break; |
602 | 634 | case "新增开发商品": |
603 | - Model.setPicPath(picPath.getText()); | |
635 | +// Model.setPicPath(picPath.getText()); | |
604 | 636 | suites.add(SuitesEnum.ADD_DEV_GOODS.getSuiteName()); |
605 | 637 | break; |
638 | + case "装柜完成": | |
639 | +// Model.setBuyerAccount(account.getText()); | |
640 | +// Model.setBuyerPassword(password.getText()); | |
641 | +// Model.setPicPath(picPath.getText()); | |
642 | + suites.add(SuitesEnum.LOAD_FINISH.getSuiteName()); | |
643 | + break; | |
606 | 644 | } |
607 | 645 | testNG.setTestSuites(suites); |
608 | 646 | testNG.run(); | ... | ... |
src/main/resources/suites/LoadContainer.xml
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > |
3 | 3 | <suite name="装柜"> |
4 | - <!--<test name="generatePO"> | |
4 | + <test name="generatePO"> | |
5 | 5 | <classes> |
6 | 6 | <class name="com.buyer.testSuite.TestAddToCart"> |
7 | 7 | <methods> |
... | ... | @@ -25,18 +25,25 @@ |
25 | 25 | </methods> |
26 | 26 | </class> |
27 | 27 | </classes> |
28 | - </test>--> | |
28 | + </test> | |
29 | 29 | <test name="loadContainer"> |
30 | 30 | <classes> |
31 | 31 | <class name="com.essa.testSuite.TestLoadContainer"> |
32 | 32 | <methods> |
33 | - <include name="Billing"/> | |
34 | - <include name="toTail"/> | |
35 | - <include name="NoticeReceiveAndLoad"/> | |
36 | - <include name="noticReceive"/> | |
37 | - <include name="dealWithDelivery"/> | |
33 | + <include name="Billing"/><!--制单发单--> | |
34 | + <include name="toTail"/><!--转在途尾货--> | |
35 | + <include name="NoticeReceiveAndLoad"/><!--通知收货、装柜--> | |
36 | + <include name="noticReceive"/><!--设置收货、装柜的仓库地址--> | |
37 | + <include name="dealWithDelivery"/><!--收货任务处理--> | |
38 | + <include name="confirmLogisticsTest"/><!--船务--> | |
39 | + <include name="ConfirmCabinet"/><!--装柜完成--> | |
38 | 40 | </methods> |
39 | 41 | </class> |
42 | +<!-- <class name="com.essa.testSuite.TestConfirLogistics"> | |
43 | + <methods> | |
44 | + <include name="confirmLogisticsTest"/> | |
45 | + </methods> | |
46 | + </class>--> | |
40 | 47 | </classes> |
41 | 48 | </test> |
42 | 49 | </suite> | ... | ... |