Commit 2e89392c3fad4cc180562a44e846bee4de9a9ea4
Merge branch 'dev_test' of http://gitlab.essa.top:88/zengjin/EssaAuto into dev_test
Showing
6 changed files
with
208 additions
and
5 deletions
Show diff stats
src/main/java/com/essa/pageObject/PODocumentary/ConvertTailPage.java
0 → 100644
| @@ -0,0 +1,51 @@ | @@ -0,0 +1,51 @@ | ||
| 1 | +package com.essa.pageObject.PODocumentary; | ||
| 2 | + | ||
| 3 | +import org.openqa.selenium.By; | ||
| 4 | +import org.openqa.selenium.WebDriver; | ||
| 5 | +import org.openqa.selenium.WebElement; | ||
| 6 | +import org.openqa.selenium.support.FindBy; | ||
| 7 | + | ||
| 8 | +import com.essa.framework.BasePage; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 转在途尾货页面 | ||
| 12 | + * @author Administrator | ||
| 13 | + * | ||
| 14 | + */ | ||
| 15 | +public class ConvertTailPage extends BasePage { | ||
| 16 | + | ||
| 17 | + public ConvertTailPage(WebDriver driver) { | ||
| 18 | + super(driver); | ||
| 19 | + } | ||
| 20 | + /* | ||
| 21 | + * 元素定位 | ||
| 22 | + */ | ||
| 23 | + @FindBy (xpath = "//*[@name='tailDeliveryDay']") | ||
| 24 | + WebElement tailDeliveryDay;//尾货货期 | ||
| 25 | + | ||
| 26 | + @FindBy (xpath ="//*[@name='moveOutQuantity']") | ||
| 27 | + WebElement moveOutQuantity;//转出箱数 | ||
| 28 | + | ||
| 29 | + @FindBy (xpath ="//button[text()='保存']") | ||
| 30 | + WebElement save;//保存 | ||
| 31 | + | ||
| 32 | + @FindBy (xpath ="//button[text()='确定']") | ||
| 33 | + WebElement confirm;//保存 | ||
| 34 | + | ||
| 35 | + /* | ||
| 36 | + * 页面方法 | ||
| 37 | + */ | ||
| 38 | + /** | ||
| 39 | + * 对sku转在途尾货 | ||
| 40 | + * @return PO单看板页面 | ||
| 41 | + */ | ||
| 42 | + public POBoardPage convertTail() { | ||
| 43 | + dynamicWait(By.xpath("//*[@name='tailDeliveryDay']")); | ||
| 44 | + sendKeys(tailDeliveryDay, "7"); | ||
| 45 | + sendKeys(moveOutQuantity, "2"); | ||
| 46 | + click(save); | ||
| 47 | + dynamicWait(By.xpath("//button[text()='确定']")); | ||
| 48 | + click(confirm); | ||
| 49 | + return new POBoardPage(driver); | ||
| 50 | + } | ||
| 51 | +} |
src/main/java/com/essa/pageObject/PODocumentary/POBoardPage.java
| 1 | package com.essa.pageObject.PODocumentary; | 1 | package com.essa.pageObject.PODocumentary; |
| 2 | 2 | ||
| 3 | +import com.essa.framework.Model; | ||
| 4 | +import org.openqa.selenium.By; | ||
| 3 | import org.openqa.selenium.WebDriver; | 5 | import org.openqa.selenium.WebDriver; |
| 4 | 6 | ||
| 5 | import com.essa.framework.BasePage; | 7 | import com.essa.framework.BasePage; |
| 8 | +import org.openqa.selenium.WebElement; | ||
| 9 | +import org.openqa.selenium.support.FindBy; | ||
| 6 | 10 | ||
| 7 | public class POBoardPage extends BasePage { | 11 | public class POBoardPage extends BasePage { |
| 8 | 12 | ||
| 9 | public POBoardPage(WebDriver driver) { | 13 | public POBoardPage(WebDriver driver) { |
| 10 | super(driver); | 14 | super(driver); |
| 11 | } | 15 | } |
| 16 | + /* | ||
| 17 | + * 元素定位 | ||
| 18 | + */ | ||
| 19 | + @FindBy (xpath = "//*[text()='订单任务看板']") | ||
| 20 | + WebElement taskBoard;//订单任务看板 | ||
| 12 | 21 | ||
| 22 | + @FindBy (xpath = "//*[@ng-model='keyword']") | ||
| 23 | + WebElement keyword;//关键字查询输入框 | ||
| 24 | + | ||
| 25 | + @FindBy (xpath ="//*[@ng-model='keyword']/../span/button") | ||
| 26 | + WebElement search;//查询按钮 | ||
| 27 | + | ||
| 28 | + @FindBy (xpath = "//*[@id='detailView']/div/div[3]/div[1]/div/div/table/tbody/tr[1]/td/div[2]/div[1]/input") | ||
| 29 | + WebElement firstCheckbox;//第一个复选框 | ||
| 30 | + | ||
| 31 | + @FindBy (xpath ="//button[contains(text(),'转在途尾货')]") | ||
| 32 | + WebElement toTail;//转在途尾货按钮 | ||
| 33 | + | ||
| 34 | + @FindBy (xpath = "//button[contains(text(),'通知收货')]") | ||
| 35 | + WebElement noticeReceive;//通知收货按钮 | ||
| 36 | + | ||
| 37 | + @FindBy(xpath ="//button[contains(text(),'通知装柜')]") | ||
| 38 | + WebElement noticeLoad;//通知装柜按钮 | ||
| 39 | + | ||
| 40 | + /* | ||
| 41 | + * 页面方法 | ||
| 42 | + */ | ||
| 43 | + /** | ||
| 44 | + * 转在途尾货 | ||
| 45 | + * @return 转在途尾货页面 | ||
| 46 | + */ | ||
| 47 | + public ConvertTailPage toTail() { | ||
| 48 | + dynamicLoad(By.xpath("//*[style='display: block;']"));//等待页面加载完成 | ||
| 49 | + click(taskBoard); | ||
| 50 | + dynamicLoad(By.xpath("//*[style='display: block;']")); | ||
| 51 | + sendKeys(keyword, Model.getSkuNo()); | ||
| 52 | + click(search); | ||
| 53 | + dynamicLoad(By.xpath("//*[style='display: block;']")); | ||
| 54 | + click(firstCheckbox); | ||
| 55 | + click(toTail); | ||
| 56 | + return new ConvertTailPage(driver); | ||
| 57 | + } | ||
| 13 | } | 58 | } |
src/main/java/com/essa/pageObject/PODocumentary/PODocumentaryListPage.java
| 1 | package com.essa.pageObject.PODocumentary; | 1 | package com.essa.pageObject.PODocumentary; |
| 2 | 2 | ||
| 3 | +import com.essa.framework.Model; | ||
| 4 | +import org.openqa.selenium.By; | ||
| 3 | import org.openqa.selenium.WebDriver; | 5 | import org.openqa.selenium.WebDriver; |
| 4 | import org.openqa.selenium.WebElement; | 6 | import org.openqa.selenium.WebElement; |
| 5 | import org.openqa.selenium.support.FindBy; | 7 | import org.openqa.selenium.support.FindBy; |
| @@ -21,7 +23,26 @@ public class PODocumentaryListPage extends BasePage { | @@ -21,7 +23,26 @@ public class PODocumentaryListPage extends BasePage { | ||
| 21 | */ | 23 | */ |
| 22 | @FindBy (xpath = "//*[contains(text(),'高级查询')]") | 24 | @FindBy (xpath = "//*[contains(text(),'高级查询')]") |
| 23 | WebElement advancedQuery;//高级查询 | 25 | WebElement advancedQuery;//高级查询 |
| 24 | - | ||
| 25 | - @FindBy (xpath = "//*[contains(@placeholder,'请输入PO单号')]") | ||
| 26 | - WebElement OrderNo; | 26 | + |
| 27 | + @FindBy (xpath = "//*[text()='PO单号:']/../div[1]/input") | ||
| 28 | + WebElement OrderNo;//PO单号 | ||
| 29 | + | ||
| 30 | + @FindBy (xpath = "//*[text()='查询']") | ||
| 31 | + WebElement search;//查询按钮 | ||
| 32 | + | ||
| 33 | + @FindBy (xpath = "//*[@id='listView']/div/table/tbody/tr[1]/td/div/div[1]/div/ul/li[1]/a") | ||
| 34 | + WebElement detail;//搜索结果中的一个查看详情 | ||
| 35 | + | ||
| 36 | + /* | ||
| 37 | + * 页面方法 | ||
| 38 | + */ | ||
| 39 | + public POBoardPage todetail() { | ||
| 40 | + mywait(detail); | ||
| 41 | + click(advancedQuery); | ||
| 42 | + sendKeys(OrderNo, Model.getPoNum()); | ||
| 43 | + click(search); | ||
| 44 | + dynamicLoad(By.xpath("//*[style='display: block;']")); | ||
| 45 | + click(detail); | ||
| 46 | + return new POBoardPage(driver); | ||
| 47 | + } | ||
| 27 | } | 48 | } |
| @@ -0,0 +1,86 @@ | @@ -0,0 +1,86 @@ | ||
| 1 | +package com.essa.testSuite; | ||
| 2 | + | ||
| 3 | +import org.openqa.selenium.WebDriver; | ||
| 4 | +import org.openqa.selenium.support.PageFactory; | ||
| 5 | +import org.testng.annotations.AfterClass; | ||
| 6 | +import org.testng.annotations.BeforeClass; | ||
| 7 | +import org.testng.annotations.Test; | ||
| 8 | + | ||
| 9 | +import com.essa.pageObject.BaseTest; | ||
| 10 | +import com.essa.pageObject.HomePage; | ||
| 11 | +import com.essa.pageObject.PODocumentary.ConvertTailPage; | ||
| 12 | +import com.essa.pageObject.PODocumentary.POBoardPage; | ||
| 13 | +import com.essa.pageObject.PODocumentary.PODocumentaryListPage; | ||
| 14 | +import com.essa.pageObject.StorageManage.GoodsReceiveTaskPage; | ||
| 15 | +import com.essa.pageObject.StorageManage.NoticeReceivePage; | ||
| 16 | +import com.essa.pageObject.StorageManage.ReceiveTaskDealPage; | ||
| 17 | +import com.essa.pageObject.needDealt.NeedDealtApplyPage; | ||
| 18 | + | ||
| 19 | +public class TestTail extends BaseTest { | ||
| 20 | + WebDriver driver; | ||
| 21 | + | ||
| 22 | + @BeforeClass | ||
| 23 | + public void setUp() { | ||
| 24 | + initsetUp(); | ||
| 25 | + loginValid("yuwanhang"); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @AfterClass | ||
| 29 | + public void tearDown() { | ||
| 30 | + driver.quit(); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 转尾货 | ||
| 35 | + */ | ||
| 36 | + @Test | ||
| 37 | + public void testTail() { | ||
| 38 | + driver = getDriver(); | ||
| 39 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 40 | + PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver, PODocumentaryListPage.class); | ||
| 41 | + POBoardPage poBoardPage = PageFactory.initElements(driver, POBoardPage.class); | ||
| 42 | + ConvertTailPage convertTailPage = PageFactory.initElements(driver, ConvertTailPage.class); | ||
| 43 | + homePage.toPoDocumentaryListPage(); | ||
| 44 | + poDocumentaryListPage.todetail(); | ||
| 45 | + poBoardPage.toTail(); | ||
| 46 | + convertTailPage.convertTail(); | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + /** | ||
| 50 | + * 设置收货、装柜的仓库地址 | ||
| 51 | + */ | ||
| 52 | + @Test | ||
| 53 | + public void noticReceive() { | ||
| 54 | + driver = getDriver(); | ||
| 55 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 56 | + NoticeReceivePage noticeReceivePage = PageFactory.initElements(driver, NoticeReceivePage.class); | ||
| 57 | + homePage.toNoticeReceivePage(); | ||
| 58 | + noticeReceivePage.setWareHouse(); | ||
| 59 | + } | ||
| 60 | + | ||
| 61 | + /** | ||
| 62 | + * 收货通知处理 | ||
| 63 | + */ | ||
| 64 | + @Test | ||
| 65 | + public void dealWithDelivery() { | ||
| 66 | + driver = getDriver(); | ||
| 67 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 68 | + GoodsReceiveTaskPage goodsReceiveTaskPage = PageFactory.initElements(driver, GoodsReceiveTaskPage.class); | ||
| 69 | + ReceiveTaskDealPage receiveTaskDealPage = PageFactory.initElements(driver, ReceiveTaskDealPage.class); | ||
| 70 | + homePage.toGoodsReceiveTaskPage(); | ||
| 71 | + goodsReceiveTaskPage.dealReceive(); | ||
| 72 | + receiveTaskDealPage.allReceive(); | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + /** | ||
| 76 | + * 大跟单确认船期 | ||
| 77 | + */ | ||
| 78 | + @Test | ||
| 79 | + public void confirmSailingDate() { | ||
| 80 | + driver = getDriver(); | ||
| 81 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 82 | + NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); | ||
| 83 | + homePage.toSailingDateConfirmPage(); | ||
| 84 | + needDealtApplyPage.confirmSailingDate(); | ||
| 85 | + } | ||
| 86 | +} |
src/main/java/swing/SwingMain.java
| @@ -128,7 +128,7 @@ public class SwingMain { | @@ -128,7 +128,7 @@ public class SwingMain { | ||
| 128 | frmvBy = new JFrame("ESSA自动化测试工具v1.0.0"); | 128 | frmvBy = new JFrame("ESSA自动化测试工具v1.0.0"); |
| 129 | frmvBy.getContentPane().setBackground(UIManager.getColor("Button.background")); | 129 | frmvBy.getContentPane().setBackground(UIManager.getColor("Button.background")); |
| 130 | frmvBy.setTitle("ESSA自动化测试工具v1.0.1"); | 130 | frmvBy.setTitle("ESSA自动化测试工具v1.0.1"); |
| 131 | - frmvBy.setIconImage(Toolkit.getDefaultToolkit().getImage(SwingMain.class.getResource("/swing/icon.png"))); | 131 | +// frmvBy.setIconImage(Toolkit.getDefaultToolkit().getImage(SwingMain.class.getResource("/swing/icon.png"))); |
| 132 | frmvBy.getContentPane().setEnabled(false); | 132 | frmvBy.getContentPane().setEnabled(false); |
| 133 | frmvBy.setResizable(false); | 133 | frmvBy.setResizable(false); |
| 134 | frmvBy.setBackground(UIManager.getColor("Button.background")); | 134 | frmvBy.setBackground(UIManager.getColor("Button.background")); |
src/main/resources/data.xml
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <data> | 3 | <data> |
| 4 | <!-- <buyerAccount>buyer11159@essa.cn</buyerAccount> --> | 4 | <!-- <buyerAccount>buyer11159@essa.cn</buyerAccount> --> |
| 5 | <buyerAccount>meng18@essa.cn</buyerAccount> | 5 | <buyerAccount>meng18@essa.cn</buyerAccount> |
| 6 | - <supplier>物料分析</supplier> | 6 | + <supplier>ESSA</supplier> |
| 7 | <buyerNo>COK09161</buyerNo> | 7 | <buyerNo>COK09161</buyerNo> |
| 8 | </data> | 8 | </data> |
| 9 | </test> | 9 | </test> |