TestNoticeReceiveAndLoad.java 1.91 KB
package com.essa.testSuite;

import com.essa.pageObject.BaseTest;
import com.essa.pageObject.HomePage;
import com.essa.pageObject.DocumentaryManage.POBoardPage;
import com.essa.pageObject.DocumentaryManage.PODocumentaryListPage;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import org.testng.asserts.SoftAssert;

public class TestNoticeReceiveAndLoad extends BaseTest{

    WebDriver driver;

    @BeforeClass
    public void setUp(){
       initsetUp();
       loginValid("chenyijie");
    }

    @AfterClass
    public void tearDown(){
        driver.quit();
    }

    /**
     * 通知收货、装柜
     */
    @Test(description = "通知收货、装柜")
    public void NoticeReceiveAndLoad(){
        this.driver = getDriver();
        HomePage homePage = PageFactory.initElements(driver,HomePage.class);
        homePage.toPoDocumentaryListPage();
        PODocumentaryListPage poDocumentaryListPage = PageFactory.initElements(driver,PODocumentaryListPage.class);
        POBoardPage poBoardPage = PageFactory.initElements(driver,POBoardPage.class);
        poDocumentaryListPage.toPoFollowDetail();

        //通知收货
        poBoardPage.noticeReceive();

        //断言:通知收货是否成功
        boolean actualReceive = poBoardPage.isNoticeReceSucceed();
        SoftAssert softAssert = new SoftAssert();
        softAssert.assertEquals(actualReceive,true,"通知收货失败!");
        softAssert.assertAll();

        //通知装柜
        poBoardPage.noticeLoad();

        //断言:通知收货是否成功
        boolean actualLoae = poBoardPage.isNoticeReceSucceed();
        SoftAssert anAssert = new SoftAssert();
        anAssert.assertEquals(actualLoae,true,"通知装柜失败!");
        anAssert.assertAll();
        homePage.logout();
    }

}