Commit 7a44144a2e24806633dac90f19845e94c1722793
1 parent
f7ce1aa5
sometestCases
Showing
3 changed files
with
150 additions
and
2 deletions
Show diff stats
src/test/java/com/essa/testSuite/.gitignore deleted
| @@ -0,0 +1,100 @@ | @@ -0,0 +1,100 @@ | ||
| 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 | +import org.testng.asserts.SoftAssert; | ||
| 9 | + | ||
| 10 | +import com.essa.framework.Model; | ||
| 11 | +import com.essa.pageObject.BaseTest; | ||
| 12 | +import com.essa.pageObject.HomePage; | ||
| 13 | +import com.essa.pageObject.inquiryManage.ProductInquiryFeedbackPage; | ||
| 14 | +import com.essa.pageObject.inquiryManage.ProductInquiryTaskPage; | ||
| 15 | +import com.essa.pageObject.needDealt.NeedDealtApplyPage; | ||
| 16 | + | ||
| 17 | +public class TestActivity extends BaseTest{ | ||
| 18 | + public WebDriver driver; | ||
| 19 | +// private String manager; | ||
| 20 | + | ||
| 21 | + @BeforeClass | ||
| 22 | + public void setUp() { | ||
| 23 | + initsetUp(); | ||
| 24 | +// Model.setIsactivity(1); | ||
| 25 | +// Model.setManager("linrong"); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + @AfterClass | ||
| 29 | + public void tearDown() { | ||
| 30 | + driver.quit(); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + /** | ||
| 34 | + * 活动商品已满足,类目经理走待办 | ||
| 35 | + */ | ||
| 36 | + @Test(description="采购计划单申请,送询价") | ||
| 37 | + public void TestActivityToPO() { | ||
| 38 | + this.driver = getDriver(); | ||
| 39 | +// this.manager = Model.getManager(); | ||
| 40 | + if (Model.getManager() == null) { | ||
| 41 | + System.out.println("获取类目经理失败了"); | ||
| 42 | + driver.quit(); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + loginValid(Model.getManager()); | ||
| 46 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 47 | + homePage.applyPurchasePlane();//目前没办法查出待办流水号,只能点击第一个待办,此处后续有必要的话需要优化 | ||
| 48 | + NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); | ||
| 49 | + needDealtApplyPage.submitInquiry(); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + /** | ||
| 53 | + * chenhong对成品询价,目前写死,暂不考虑义务商品 | ||
| 54 | + */ | ||
| 55 | + @Test(description="成品询价") | ||
| 56 | + public void productInquiry() { | ||
| 57 | + this.driver = getDriver(); | ||
| 58 | + loginValid("chenhong");//此处是汕头的商品,有可能出现义务的商品,则要用xingchangyong来操作 | ||
| 59 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 60 | + homePage.toProductInquiryTask(); | ||
| 61 | + ProductInquiryTaskPage productInquiryTask = PageFactory.initElements(driver, ProductInquiryTaskPage.class); | ||
| 62 | + productInquiryTask.toFeedback(); | ||
| 63 | + ProductInquiryFeedbackPage productInquiryFeedback = PageFactory.initElements(driver, | ||
| 64 | + ProductInquiryFeedbackPage.class); | ||
| 65 | + productInquiryFeedback.submit(); | ||
| 66 | + // 断言 | ||
| 67 | + SoftAssert softAssert = new SoftAssert(); | ||
| 68 | + softAssert.assertEquals(productInquiryTask.isSucceed(), true, "成品询价失败!"); | ||
| 69 | + softAssert.assertAll(); | ||
| 70 | + homePage.sureLogout(); | ||
| 71 | + | ||
| 72 | + } | ||
| 73 | + | ||
| 74 | + /** | ||
| 75 | + * 类目经理对采购计划进行修订 | ||
| 76 | + */ | ||
| 77 | + @Test(description="采购计划修订") | ||
| 78 | + public void planeModify() { | ||
| 79 | + this.driver = getDriver(); | ||
| 80 | + loginValid(Model.getManager()); | ||
| 81 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 82 | + homePage.toNeedDealtDetailPage(); | ||
| 83 | + NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); | ||
| 84 | + needDealtApplyPage.toAudit(); | ||
| 85 | + homePage.logout(); | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + /** | ||
| 89 | + * 财务对采购计划进行审核 | ||
| 90 | + */ | ||
| 91 | + @Test(description="财务审核采购计划") | ||
| 92 | + public void TestAuditApply() { | ||
| 93 | + this.driver = getDriver(); | ||
| 94 | + loginValid("wangchaomang"); | ||
| 95 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 96 | + homePage.toNeedDealtDetailPage(); | ||
| 97 | + NeedDealtApplyPage needDealtApplyPage = PageFactory.initElements(driver, NeedDealtApplyPage.class); | ||
| 98 | + needDealtApplyPage.audit(); | ||
| 99 | + } | ||
| 100 | +} |
src/test/java/com/essa/testSuite/TestPOInquiry.java
0 → 100644
| @@ -0,0 +1,50 @@ | @@ -0,0 +1,50 @@ | ||
| 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.inquiryManage.ProductInquiryFeedbackPage; | ||
| 12 | +import com.essa.pageObject.inquiryManage.ProductInquiryTaskPage; | ||
| 13 | + | ||
| 14 | +public class TestPOInquiry extends BaseTest { | ||
| 15 | + | ||
| 16 | + WebDriver driver; | ||
| 17 | + | ||
| 18 | + @BeforeClass | ||
| 19 | + public void setUp() { | ||
| 20 | + initsetUp(); | ||
| 21 | + loginValid("chenhong"); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + @AfterClass | ||
| 25 | + public void tearDown() { | ||
| 26 | + driver.quit(); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + | ||
| 30 | + /** | ||
| 31 | + * po询价 | ||
| 32 | + */ | ||
| 33 | + @Test(description="根据PO单号,做询价操作") | ||
| 34 | + public void POInquiry() { | ||
| 35 | + this.driver = getDriver(); | ||
| 36 | + HomePage homePage = PageFactory.initElements(driver, HomePage.class); | ||
| 37 | + homePage.toProductInquiryTask(); | ||
| 38 | + ProductInquiryTaskPage productInquiryTask = PageFactory.initElements(driver, ProductInquiryTaskPage.class); | ||
| 39 | + ProductInquiryFeedbackPage productInquiryFeedbackPage = PageFactory.initElements(driver, | ||
| 40 | + ProductInquiryFeedbackPage.class); | ||
| 41 | + productInquiryTask.POtoFeedback(); | ||
| 42 | + productInquiryFeedbackPage.POsubmit(); | ||
| 43 | + | ||
| 44 | + //如果列表还有未询价,继续执行 | ||
| 45 | + while (productInquiryTask.isPOSucceed()) { | ||
| 46 | + productInquiryTask.POcircle(); | ||
| 47 | + productInquiryFeedbackPage.POsubmit(); | ||
| 48 | + } | ||
| 49 | + } | ||
| 50 | +} |