指定了 ExtentReport 生成目录,但并未生成 ExtentReport 报告
package com.cases;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import com.page.EmailLoginPage;
import com.relevantcodes.extentreports.ExtentReports;
import com.relevantcodes.extentreports.ExtentTest;
import com.relevantcodes.extentreports.LogStatus;
public class EmailLoginCase {
WebDriver driver;
EmailLoginPage emailLoginPage;
ExtentReports extentReports;
ExtentTest extentTest;
@BeforeClass
public void setUp() {
System.setProperty("webdriver.chrome.driver", "D:\\selenium_drivers\\chromedriver.exe");
driver = new ChromeDriver();
extentReports = new ExtentReports("D:\1.html");
extentTest = extentReports.startTest("EmailLogin");
emailLoginPage = new EmailLoginPage(driver);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://mail.qq.com/");
extentTest.log(LogStatus.INFO, "LogStatus.INFO");
}
@Test
public void testLogin() {
emailLoginPage.sendUsername("xx");
emailLoginPage.sendPassword("xx");
emailLoginPage.clickLoginButton();
}
@AfterClass
public void cleanUp() throws Exception{
Thread.sleep(3000);
driver.quit();
extentReports.endTest(extentTest);
}
}