Skip to content

Commit 08720a5

Browse files
committed
Update date Playwright 1.41.1
1 parent 7f33de3 commit 08720a5

File tree

9 files changed

+36
-37
lines changed

9 files changed

+36
-37
lines changed

pom.xml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66

7-
<groupId>anhtester.com</groupId>
7+
<groupId>com.anhtester</groupId>
88
<artifactId>PlaywrightJava</artifactId>
9-
<version>1.0.0</version>
9+
<version>1.41.1</version>
1010

1111
<properties>
1212
<maven.compiler.source>17</maven.compiler.source>
@@ -19,30 +19,28 @@
1919
<dependency>
2020
<groupId>com.microsoft.playwright</groupId>
2121
<artifactId>playwright</artifactId>
22-
<version>1.40.0</version>
22+
<version>1.41.1</version>
2323
</dependency>
2424

2525
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
2626
<dependency>
2727
<groupId>org.testng</groupId>
2828
<artifactId>testng</artifactId>
29-
<version>7.8.0</version>
29+
<version>7.9.0</version>
3030
</dependency>
3131

3232
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
3333
<dependency>
3434
<groupId>org.slf4j</groupId>
3535
<artifactId>slf4j-api</artifactId>
36-
<version>2.0.9</version>
37-
<scope>test</scope>
36+
<version>2.0.11</version>
3837
</dependency>
3938

4039
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
4140
<dependency>
4241
<groupId>org.slf4j</groupId>
4342
<artifactId>slf4j-simple</artifactId>
44-
<version>2.0.9</version>
45-
<scope>test</scope>
43+
<version>2.0.11</version>
4644
</dependency>
4745

4846
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
@@ -77,14 +75,14 @@
7775
<dependency>
7876
<groupId>org.apache.logging.log4j</groupId>
7977
<artifactId>log4j-core</artifactId>
80-
<version>2.22.0</version>
78+
<version>3.0.0-beta1</version>
8179
</dependency>
8280

8381
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
8482
<dependency>
8583
<groupId>org.apache.logging.log4j</groupId>
8684
<artifactId>log4j-api</artifactId>
87-
<version>2.22.0</version>
85+
<version>3.0.0-beta1</version>
8886
</dependency>
8987

9088
<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports -->
@@ -137,24 +135,23 @@
137135
<plugin>
138136
<groupId>org.apache.maven.plugins</groupId>
139137
<artifactId>maven-compiler-plugin</artifactId>
140-
<version>3.12.0</version>
138+
<version>3.12.1</version>
141139
</plugin>
142140

143141
<plugin>
144142
<groupId>org.apache.maven.plugins</groupId>
145143
<artifactId>maven-surefire-plugin</artifactId>
146-
<version>3.2.3</version>
144+
<version>3.2.5</version>
147145
<configuration>
148146
<suiteXmlFiles>
149-
<suiteXmlFile>suites/CategoryTest.xml</suiteXmlFile>
147+
<suiteXmlFile>suites/SuiteAll.xml</suiteXmlFile>
150148
</suiteXmlFiles>
151149

152150
<argLine>
153151
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/1.9.21/aspectjweaver-1.9.21.jar"
154152
</argLine>
155153
<testFailureIgnore>true</testFailureIgnore>
156154
<systemPropertyVariables>
157-
<!--Đường dẫn xuất ra report-->
158155
<allure.results.directory>target/allure-results</allure.results.directory>
159156
</systemPropertyVariables>
160157
</configuration>

src/main/java/com/anhtester/reports/ExtentTestManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ public static void addScreenShot(String message) {
3535
ScreenshotOptions screenshotOptions = new ScreenshotOptions();
3636

3737
String base64Image = "data:image/png;base64,"
38-
+ PageManager.getPage().screenshot(screenshotOptions.setPath(Paths.get(SystemHelper.getCurrentDir() + PropertiesHelper.getValue("SCREENSHOT_PATH") + File.separator + dateFormat.format(new Date()) + ".png")));
38+
+ PageManager.getPage().screenshot(screenshotOptions.setPath(Paths.get(SystemHelper.getCurrentDir() + PropertiesHelper.getValue("SCREENSHOT_PATH") + File.separator + "ExtentReport_" + dateFormat.format(new Date()) + ".png"))).toString();
3939

40-
getTest().log(Status.INFO, message,
40+
getTest().log(Status.FAIL, message,
4141
MediaEntityBuilder.createScreenCaptureFromBase64String(base64Image).build());
4242
}
4343

src/main/resources/log4j2.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name=PropertiesConfigLog4j2
2-
#Nen su dung 2 loai file .log hoac .txt
32
property.filename=logs/app_log.log
43
appenders=console, file
54

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public void beforeTestStop(TestResult result) {
5151
if (PageManager.getPage() != null) {
5252
Allure.addAttachment(result.getName() + "_Failed_Screenshot", new ByteArrayInputStream(PageManager.getPage().screenshot(screenshotOptions.setPath(Paths.get(SystemHelper.getCurrentDir() + PropertiesHelper.getValue("SCREENSHOT_PATH") + File.separator + dateFormat.format(new Date()) + ".png")))));
5353
}
54-
AllureManager.addAttachmentVideoAVI();
5554
}
5655
}
5756

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ public void onStart(ITestContext result) {
2929

3030
@Override
3131
public void onFinish(ITestContext result) {
32-
//Kết thúc và thực thi Extents Report
3332
ExtentReportManager.getExtentReports().flush();
3433
}
3534

@@ -41,7 +40,6 @@ public void onTestStart(ITestResult result) {
4140
CaptureHelper.startRecord(result.getName());
4241
}
4342

44-
//Bắt đầu ghi 1 TCs mới vào Extent Report
4543
ExtentTestManager.saveToReport(getTestName(result), getTestDescription(result));
4644
}
4745

@@ -58,7 +56,6 @@ public void onTestSuccess(ITestResult result) {
5856
CaptureHelper.stopRecord();
5957
}
6058

61-
//Extent Report
6259
ExtentTestManager.logMessage(Status.PASS, result.getName() + " is passed.");
6360
}
6461

@@ -82,7 +79,7 @@ public void onTestFailure(ITestResult result) {
8279

8380
//Allure Report
8481
//AllureManager.saveTextLog(result.getName() + " is failed.");
85-
AllureManager.saveScreenshotPNG();
82+
//AllureManager.saveScreenshotPNG();
8683
}
8784

8885
@Override
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
browser = chrome
2-
3-
password = 123456
4-
timeout = 20
5-
url = https\://crm.anhtester.com/admin/authentication
6-
SCREENSHOT_PATH = reports/Screenshots/
7-
VIDEO_RECORD_PATH = reports/VideoRecords/
8-
HEADLESS = false
9-
VIDEO_RECORD = true
10-
SCREENSHOT_FAIL = true
11-
SCREENSHOT_PASS = false
1+
browser=chrome
2+
3+
password=123456
4+
timeout=20
5+
url=https://crm.anhtester.com/admin/authentication
6+
SCREENSHOT_PATH=reports/Screenshots/
7+
VIDEO_RECORD_PATH=reports/VideoRecords/
8+
HEADLESS=false
9+
VIDEO_RECORD=false
10+
SCREENSHOT_FAIL=true
11+
SCREENSHOT_PASS=false

suites/CategoryTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
2-
<suite name="SuiteLoginTest">
3-
<test name="LoginTest" parallel="methods">
2+
<suite name="Regression Test">
3+
<test name="Category Test" parallel="methods">
44
<parameter name="browser" value="chromium"/>
55
<classes>
66
<class name="com.anhtester.pom.testcases.CategoryTest"/>

suites/LoginTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
2-
<suite name="SuiteLoginTest">
3-
<test name="LoginTest" parallel="methods">
2+
<suite name="Regression Test">
3+
<test name="Login Test" parallel="methods">
44
<parameter name="browser" value="chrome"/>
55
<classes>
66
<class name="com.anhtester.pom.testcases.LoginTest"/>

suites/SuiteAll.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
2+
<suite name="Regression Test">
3+
<suite-files>
4+
<suite-file path="LoginTest.xml"/>
5+
<suite-file path="CategoryTest.xml"/>
6+
</suite-files>
7+
</suite>

0 commit comments

Comments
 (0)