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,10 +92,14 @@ public class POBoardPage extends BasePage { | ||
92 | sendKeys(inputReceiveDate,date); | 92 | sendKeys(inputReceiveDate,date); |
93 | click(reveiveDate); | 93 | click(reveiveDate); |
94 | click(submit); | 94 | click(submit); |
95 | - forceWait(3000); | ||
96 | return new POBoardPage(driver); | 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 | public POBoardPage noticeLoad(){ | 104 | public POBoardPage noticeLoad(){ |
101 | click(noticeLoad); | 105 | click(noticeLoad); |
@@ -108,4 +112,10 @@ public class POBoardPage extends BasePage { | @@ -108,4 +112,10 @@ public class POBoardPage extends BasePage { | ||
108 | forceWait(2000); | 112 | forceWait(2000); |
109 | return new POBoardPage(driver); | 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,10 +65,10 @@ public class PODocumentaryListPage extends BasePage { | ||
65 | public PODocumentaryListPage toPoFollowDetail(){ | 65 | public PODocumentaryListPage toPoFollowDetail(){ |
66 | sendKeys(keySearch, Model.getPoNum()); | 66 | sendKeys(keySearch, Model.getPoNum()); |
67 | click(magnifierSearch); | 67 | click(magnifierSearch); |
68 | - forceWait(5000); | 68 | + forceWait(8000); |
69 | dynamicWait(By.xpath("//div[@class='row xxrow-header-bg row-border-bottom no-margin padding-horizontal-5']")); | 69 | dynamicWait(By.xpath("//div[@class='row xxrow-header-bg row-border-bottom no-margin padding-horizontal-5']")); |
70 | click(followDetail); | 70 | click(followDetail); |
71 | - forceWait(5000); | 71 | + forceWait(8000); |
72 | dynamicWait(By.xpath("//div[@class='panel-body']")); | 72 | dynamicWait(By.xpath("//div[@class='panel-body']")); |
73 | return new PODocumentaryListPage(driver); | 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,6 +9,7 @@ import org.openqa.selenium.support.PageFactory; | ||
9 | import org.testng.annotations.AfterClass; | 9 | import org.testng.annotations.AfterClass; |
10 | import org.testng.annotations.BeforeClass; | 10 | import org.testng.annotations.BeforeClass; |
11 | import org.testng.annotations.Test; | 11 | import org.testng.annotations.Test; |
12 | +import org.testng.asserts.SoftAssert; | ||
12 | 13 | ||
13 | public class TestNoticeReceiveAndLoad extends BaseTest{ | 14 | public class TestNoticeReceiveAndLoad extends BaseTest{ |
14 | 15 | ||
@@ -36,8 +37,24 @@ public class TestNoticeReceiveAndLoad extends BaseTest{ | @@ -36,8 +37,24 @@ public class TestNoticeReceiveAndLoad extends BaseTest{ | ||
36 | PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class); | 37 | PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class); |
37 | POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class); | 38 | POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class); |
38 | poDocumentaryListPage.toPoFollowDetail(); | 39 | poDocumentaryListPage.toPoFollowDetail(); |
40 | + | ||
41 | + //通知收货 | ||
39 | poBoardPage.noticeReceive(); | 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 | poBoardPage.noticeLoad(); | 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 | } |