Skip to content

Commit 1c2483f

Browse files
committed
Update version 1.8.2 released
1 parent d65ff42 commit 1c2483f

5 files changed

Lines changed: 66 additions & 13 deletions

File tree

pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<java-compiler.version>11</java-compiler.version>
1717
<maven-surefire-plugin.version>3.0.0-M7</maven-surefire-plugin.version>
1818
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
19-
<selenium.version>4.4.0</selenium.version>
19+
<selenium.version>4.5.0</selenium.version>
2020
<testng.version>7.6.1</testng.version>
2121
<webdrivermanager.version>5.3.0</webdrivermanager.version>
2222
<aspectjweaver.version>1.9.9.1</aspectjweaver.version>
@@ -166,6 +166,12 @@
166166
<version>${extentreports.version}</version>
167167
</dependency>
168168

169+
<dependency>
170+
<groupId>tech.grasshopper</groupId>
171+
<artifactId>pdfextentreporter</artifactId>
172+
<version>1.3.1</version>
173+
</dependency>
174+
169175
<!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
170176
<dependency>
171177
<groupId>io.github.bonigarcia</groupId>

src/main/java/anhtester/com/keyword/WebUI.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
import org.openqa.selenium.chrome.ChromeOptions;
3131
import org.openqa.selenium.devtools.DevTools;
3232
import org.openqa.selenium.devtools.HasDevTools;
33-
import org.openqa.selenium.devtools.v102.network.Network;
34-
import org.openqa.selenium.devtools.v102.network.model.Headers;
33+
import org.openqa.selenium.devtools.v106.network.Network;
34+
import org.openqa.selenium.devtools.v106.network.model.Headers;
3535
import org.openqa.selenium.interactions.Actions;
3636
import org.openqa.selenium.print.PrintOptions;
3737
import org.openqa.selenium.support.ui.ExpectedCondition;
@@ -1002,7 +1002,7 @@ public static boolean verifyElementTextContains(By by, String text) {
10021002
}
10031003

10041004
Assert.assertTrue(result, "The actual text is " + getTextElement(by).trim() + " not contains " + text.trim());
1005-
1005+
10061006
if (ExtentTestManager.getExtentTest() != null) {
10071007
ExtentReportManager.warning("Verify text of an element [Contains] : " + result);
10081008
}
@@ -1513,7 +1513,7 @@ public static boolean pressF11() {
15131513
}
15141514
}
15151515

1516-
@Step("Open website with get URL")
1516+
@Step("Reload page")
15171517
public static void reloadPage() {
15181518
smartWait();
15191519

@@ -1553,7 +1553,7 @@ public static void getURL(String URL) {
15531553
Log.info("Open URL: " + URL);
15541554

15551555
if (ExtentTestManager.getExtentTest() != null) {
1556-
ExtentReportManager.pass(BOLD_START + ICON_Navigate_Right + " Open URL : " + BOLD_END + URL);
1556+
ExtentReportManager.pass("Open URL: " + URL);
15571557
}
15581558
AllureManager.saveTextLog("Open URL: " + URL);
15591559

@@ -1574,7 +1574,7 @@ public static void navigateToUrl(String URL) {
15741574
waitForPageLoaded();
15751575

15761576
if (ExtentTestManager.getExtentTest() != null) {
1577-
ExtentReportManager.pass(BOLD_START + ICON_Navigate_Right + " Navigate to URL: " + BOLD_END + URL);
1577+
ExtentReportManager.pass("Navigate to URL: " + URL);
15781578
}
15791579
AllureManager.saveTextLog("Navigate to URL: " + URL);
15801580

@@ -1595,7 +1595,7 @@ public static void setText(By by, String value) {
15951595
waitForElementVisible(by).sendKeys(value);
15961596

15971597
if (ExtentTestManager.getExtentTest() != null) {
1598-
ExtentReportManager.pass(FrameworkConstants.BOLD_START + value + FrameworkConstants.BOLD_END + " value is successfully passed in textbox.");
1598+
ExtentReportManager.pass(value + " value is successfully passed in textbox.");
15991599
}
16001600
AllureManager.saveTextLog(value + " value is successfully passed in textbox.");
16011601
if (SCREENSHOT_ALL_STEPS.equals(YES)) {
@@ -1613,7 +1613,7 @@ public static void setText(By by, String value) {
16131613
public static void clearText(By by) {
16141614
waitForElementVisible(by).clear();
16151615
if (ExtentTestManager.getExtentTest() != null) {
1616-
ExtentReportManager.pass(FrameworkConstants.BOLD_START + "Clear" + FrameworkConstants.BOLD_END + " value in textbox successfully.");
1616+
ExtentReportManager.pass("Clear value in textbox successfully.");
16171617
}
16181618
AllureManager.saveTextLog("Clear value in textbox successfully.");
16191619
if (SCREENSHOT_ALL_STEPS.equals(YES)) {
@@ -1632,7 +1632,7 @@ public static void clickElement(By by) {
16321632
waitForElementVisible(by).click();
16331633

16341634
if (ExtentTestManager.getExtentTest() != null) {
1635-
ExtentReportManager.pass(FrameworkConstants.BOLD_START + "Clicked" + FrameworkConstants.BOLD_END + " on the object " + by.toString());
1635+
ExtentReportManager.pass("Clicked on the object " + by.toString());
16361636
}
16371637
AllureManager.saveTextLog("Clicked on the object " + by.toString());
16381638

src/main/java/anhtester/com/report/ExtentReportManager.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
import com.aventstack.extentreports.reporter.configuration.Theme;
1616
import org.openqa.selenium.OutputType;
1717
import org.openqa.selenium.TakesScreenshot;
18+
import tech.grasshopper.reporter.ExtentPDFReporter;
1819

20+
import java.io.File;
21+
import java.io.IOException;
1922
import java.util.Objects;
2023

2124
import static anhtester.com.constants.FrameworkConstants.*;
@@ -39,6 +42,14 @@ public static void initReports() {
3942
System.out.println("link report:" + link);
4043
}
4144

45+
ExtentPDFReporter pdf = new ExtentPDFReporter("reports/ExtentReports/PdfReport.pdf");
46+
try {
47+
pdf.loadJSONConfig(new File("src/test/resources/pdf-config.json"));
48+
} catch (IOException e) {
49+
throw new RuntimeException(e);
50+
}
51+
extentReports.attachReporter(pdf);
52+
4253
ExtentSparkReporter spark = new ExtentSparkReporter(link);
4354
extentReports.attachReporter(spark);
4455
spark.config().setTheme(Theme.STANDARD);

src/test/java/anhtester/com/listeners/TestListener.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
import anhtester.com.report.AllureManager;
1212
import anhtester.com.report.ExtentReportManager;
1313
import anhtester.com.report.TelegramManager;
14-
import anhtester.com.utils.*;
14+
import anhtester.com.utils.BrowserInfoUtils;
15+
import anhtester.com.utils.EmailSendUtils;
16+
import anhtester.com.utils.Log;
17+
import anhtester.com.utils.ZipUtils;
1518
import com.aventstack.extentreports.Status;
1619
import org.testng.*;
1720

@@ -122,8 +125,7 @@ public void onTestStart(ITestResult iTestResult) {
122125
ExtentReportManager.addCategories(getCategoryType(iTestResult));
123126
ExtentReportManager.addDevices();
124127

125-
ExtentReportManager.info(BOLD_START + IconUtils.getOSIcon() + " "
126-
+ BrowserInfoUtils.getOSInfo() + BOLD_END);
128+
ExtentReportManager.info(BrowserInfoUtils.getOSInfo());
127129

128130
if (VIDEO_RECORD.toLowerCase().trim().equals(YES)) {
129131
screenRecorder.startRecording(getTestName(iTestResult));

src/test/resources/pdf-config.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"displayAttributeSummary": true,
3+
"displayAttributeDetails": true,
4+
"displayTestDetails": true,
5+
"displayExpandedMedia": false,
6+
"displayAttachedMedia": true,
7+
"title": "Extent Report PDF",
8+
"titleColor": "964B00",
9+
"startTimesColor": "33A532",
10+
"finishTimesColor": "FF69B4",
11+
"durationColor": "00FFFF",
12+
"passCountColor": "C0C0C0",
13+
"failCountColor": "A9A9A9",
14+
"passColor": "0b8c47",
15+
"failColor": "720000",
16+
"skipColor": "b17750",
17+
"warnColor": "ffc100",
18+
"infoColor": "114444",
19+
"categoryTitleColor": "990000",
20+
"categoryNameColor": "bd8275",
21+
"authorTitleColor": "002288",
22+
"authorNameColor": "3ac5b6",
23+
"deviceTitleColor": "228800",
24+
"deviceNameColor": "cd17bf",
25+
"systemTitleColor": "bb1144",
26+
"systemNameColor": "990000",
27+
"systemValueColor": "daa520",
28+
"exceptionTitleColor": "000000",
29+
"attributeTestStatusColor": "660066",
30+
"testNameColor": "d62d20",
31+
"testTimesColor": "ffa700",
32+
"testTimeStampColor": "08080",
33+
"testExceptionColor": "990000"
34+
}

0 commit comments

Comments
 (0)