Commit 438eca07c62e7ed73291715509b15339f5ae5ea5
1 parent
9e8e2bb1
添加断言
Showing
3 changed files
with
30 additions
and
3 deletions
Show diff stats
src/main/java/com/essa/pageObject/PODocumentary/POBoardPage.java
... | ... | @@ -92,10 +92,14 @@ public class POBoardPage extends BasePage { |
92 | 92 | sendKeys(inputReceiveDate,date); |
93 | 93 | click(reveiveDate); |
94 | 94 | click(submit); |
95 | - forceWait(3000); | |
96 | 95 | return new POBoardPage(driver); |
97 | 96 | } |
98 | 97 | |
98 | + public boolean isNoticeReceSucceed(){ | |
99 | + forceWait(2000); | |
100 | + return isVisibility(By.xpath("//*[contains(text(),'收货中')]")); | |
101 | + } | |
102 | + | |
99 | 103 | //通知装柜 |
100 | 104 | public POBoardPage noticeLoad(){ |
101 | 105 | click(noticeLoad); |
... | ... | @@ -108,4 +112,10 @@ public class POBoardPage extends BasePage { |
108 | 112 | forceWait(2000); |
109 | 113 | return new POBoardPage(driver); |
110 | 114 | } |
115 | + | |
116 | + public boolean isNoticeLoadSucceed(){ | |
117 | + forceWait(2000); | |
118 | + return isVisibility(By.xpath("//*[contains(text(),'装柜中')]")); | |
119 | + } | |
120 | + | |
111 | 121 | } | ... | ... |
src/main/java/com/essa/pageObject/PODocumentary/PODocumentaryListPage.java
... | ... | @@ -65,10 +65,10 @@ public class PODocumentaryListPage extends BasePage { |
65 | 65 | public PODocumentaryListPage toPoFollowDetail(){ |
66 | 66 | sendKeys(keySearch, Model.getPoNum()); |
67 | 67 | click(magnifierSearch); |
68 | - forceWait(5000); | |
68 | + forceWait(8000); | |
69 | 69 | dynamicWait(By.xpath("//div[@class='row xxrow-header-bg row-border-bottom no-margin padding-horizontal-5']")); |
70 | 70 | click(followDetail); |
71 | - forceWait(5000); | |
71 | + forceWait(8000); | |
72 | 72 | dynamicWait(By.xpath("//div[@class='panel-body']")); |
73 | 73 | return new PODocumentaryListPage(driver); |
74 | 74 | } | ... | ... |
src/main/java/com/essa/testSuite/TestNoticeReceiveAndLoad.java
... | ... | @@ -9,6 +9,7 @@ import org.openqa.selenium.support.PageFactory; |
9 | 9 | import org.testng.annotations.AfterClass; |
10 | 10 | import org.testng.annotations.BeforeClass; |
11 | 11 | import org.testng.annotations.Test; |
12 | +import org.testng.asserts.SoftAssert; | |
12 | 13 | |
13 | 14 | public class TestNoticeReceiveAndLoad extends BaseTest{ |
14 | 15 | |
... | ... | @@ -36,8 +37,24 @@ public class TestNoticeReceiveAndLoad extends BaseTest{ |
36 | 37 | PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class); |
37 | 38 | POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class); |
38 | 39 | poDocumentaryListPage.toPoFollowDetail(); |
40 | + | |
41 | + //通知收货 | |
39 | 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 | + //通知装柜 | |
40 | 51 | poBoardPage.noticeLoad(); |
52 | + | |
53 | + //断言:通知收货是否成功 | |
54 | + boolean actualLoae = poBoardPage.isNoticeReceSucceed(); | |
55 | + SoftAssert anAssert = new SoftAssert(); | |
56 | + anAssert.assertEquals(actualLoae,true,"通知装柜失败!"); | |
57 | + anAssert.assertAll(); | |
41 | 58 | } |
42 | 59 | |
43 | 60 | } | ... | ... |