Skip to content

Commit d73581f

Browse files
committed
Update version 1.8.0 (new)
1 parent 26aaf91 commit d73581f

27 files changed

Lines changed: 837 additions & 391 deletions

CHANGELOG.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
v1.8.0
2+
======
3+
Sep 05, 2024
4+
* Update Selenium 4.24.0
5+
* Update support CDP 128 (Chromium)
6+
* Update method in WebUI keyword
7+
* Add read JSON file
8+
9+
v1.7.9
10+
======
11+
Jul 26, 2024
12+
* Update Selenium 4.23.0
13+
* Update support CDP 127 (Chromium)
14+
115
v1.7.8
216
======
317
Jun 24, 2024

docs/com/anhtester/utils/EmailSendUtils.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<h1 title="Class EmailSendUtils" class="title">Class EmailSendUtils</h1>
7474
</div>
7575
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
76-
<div class="inheritance">com.anhtester.utils.EmailSendUtils</div>
76+
<div class="inheritance">com.anhtester.mail.EmailManager</div>
7777
</div>
7878
<section class="class-description" id="class-description">
7979
<hr>

docs/com/anhtester/utils/class-use/EmailSendUtils.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<!-- Generated by javadoc (17) on Tue May 28 02:07:34 ICT 2024 -->
5-
<title>Uses of Class com.anhtester.utils.EmailSendUtils</title>
5+
<title>Uses of Class com.anhtester.mail.EmailManager</title>
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<meta http-equiv="Content-Type" content="text/html; charset=utf8">
88
<meta name="dc.created" content="2024-05-28">
@@ -49,9 +49,9 @@
4949
<div class="flex-content">
5050
<main role="main">
5151
<div class="header">
52-
<h1 title="Uses of Class com.anhtester.utils.EmailSendUtils" class="title">Uses of Class<br>com.anhtester.utils.EmailSendUtils</h1>
52+
<h1 title="Uses of Class com.anhtester.mail.EmailManager" class="title">Uses of Class<br>com.anhtester.mail.EmailManager</h1>
5353
</div>
54-
No usage of com.anhtester.utils.EmailSendUtils</main>
54+
No usage of com.anhtester.mail.EmailManager</main>
5555
</div>
5656
</div>
5757
</body>

pom.xml

Lines changed: 47 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.anhtester</groupId>
88
<artifactId>anhtester-cucumber-testng</artifactId>
9-
<version>1.7.9</version>
9+
<version>1.8.0</version>
1010
<name>TestAutomationFrameworkCucumberTestNG</name>
1111
<url>https://github.com/anhtester/AutomationFrameworkCucumberTestNG</url>
1212

@@ -15,18 +15,19 @@
1515
<project.build.resourceEncoding>UTF-8</project.build.resourceEncoding>
1616
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1717
<java-compiler.version>17</java-compiler.version>
18-
<maven-surefire-plugin.version>3.3.1</maven-surefire-plugin.version>
18+
<maven-surefire-plugin.version>3.5.0</maven-surefire-plugin.version>
1919
<maven-compiler-plugin.version>3.13.0</maven-compiler-plugin.version>
2020

2121
<cucumber.java.version>7.18.1</cucumber.java.version>
22-
<gherkin.version>28.0.0</gherkin.version>
23-
<cucumber-reporting.version>5.8.1</cucumber-reporting.version>
24-
<selenium.version>4.23.0</selenium.version>
22+
<gherkin.version>29.0.0</gherkin.version>
23+
<cucumber-reporting.version>5.8.2</cucumber-reporting.version>
24+
<selenium.version>4.24.0</selenium.version>
2525
<testng.version>7.10.2</testng.version>
2626
<aspectjweaver.version>1.9.22.1</aspectjweaver.version>
2727
<log4j.version>2.23.1</log4j.version>
28-
<allure-testng.version>2.28.0</allure-testng.version>
29-
<allure-maven.version>2.12.0</allure-maven.version>
28+
<slf4j.version>2.0.16</slf4j.version>
29+
<allure-testng.version>2.29.0</allure-testng.version>
30+
<allure-maven.version>2.14.0</allure-maven.version>
3031
<allure-environment-writer.version>1.0.0</allure-environment-writer.version>
3132
<allure.cmd.download.url>
3233
https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline
@@ -41,15 +42,16 @@
4142
<mysql-connector-java.version>8.0.33</mysql-connector-java.version>
4243
<google.zxing.version>3.5.3</google.zxing.version>
4344
<lombok.version>1.18.34</lombok.version>
44-
<google.guava.version>33.2.1-jre</google.guava.version>
45+
<google.guava.version>33.3.0-jre</google.guava.version>
4546
<data.supplier.version>1.9.7</data.supplier.version>
4647
<javax.mail.version>1.6.2</javax.mail.version>
4748
<zip.version>1.17</zip.version>
48-
<jackson.version>2.17.2</jackson.version>
49+
<rest-assured.version>5.5.0</rest-assured.version>
50+
<gson.version>2.11.0</gson.version>
51+
<jackson-databind.version>2.17.2</jackson-databind.version>
4952
<datafaker.version>2.3.1</datafaker.version>
50-
<telegram.bot.version>7.7.0</telegram.bot.version>
51-
<slf4j.version>2.0.13</slf4j.version>
52-
<commons-lang3.version>3.15.0</commons-lang3.version>
53+
<telegram.bot.version>7.9.1</telegram.bot.version>
54+
<commons-lang3.version>3.17.0</commons-lang3.version>
5355
<extentreports-cucumber7-adapter.version>1.14.0</extentreports-cucumber7-adapter.version>
5456
<mysql-connector-j.version>9.0.0</mysql-connector-j.version>
5557

@@ -60,6 +62,39 @@
6062

6163
<dependencies>
6264

65+
<!-- https://mvnrepository.com/artifact/io.rest-assured/rest-assured -->
66+
<dependency>
67+
<groupId>io.rest-assured</groupId>
68+
<artifactId>rest-assured</artifactId>
69+
<version>${rest-assured.version}</version>
70+
</dependency>
71+
<!-- https://mvnrepository.com/artifact/io.rest-assured/json-schema-validator -->
72+
<dependency>
73+
<groupId>io.rest-assured</groupId>
74+
<artifactId>json-schema-validator</artifactId>
75+
<version>${rest-assured.version}</version>
76+
</dependency>
77+
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
78+
<dependency>
79+
<groupId>com.google.code.gson</groupId>
80+
<artifactId>gson</artifactId>
81+
<version>${gson.version}</version>
82+
</dependency>
83+
84+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
85+
<dependency>
86+
<groupId>com.fasterxml.jackson.core</groupId>
87+
<artifactId>jackson-databind</artifactId>
88+
<version>${jackson-databind.version}</version>
89+
</dependency>
90+
91+
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
92+
<dependency>
93+
<groupId>com.fasterxml.jackson.core</groupId>
94+
<artifactId>jackson-core</artifactId>
95+
<version>${jackson-databind.version}</version>
96+
</dependency>
97+
6398
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
6499
<dependency>
65100
<groupId>org.apache.commons</groupId>
@@ -150,20 +185,6 @@
150185
<version>${testng.version}</version>
151186
</dependency>
152187

153-
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
154-
<dependency>
155-
<groupId>com.fasterxml.jackson.core</groupId>
156-
<artifactId>jackson-databind</artifactId>
157-
<version>${jackson.version}</version>
158-
</dependency>
159-
160-
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
161-
<dependency>
162-
<groupId>com.fasterxml.jackson.core</groupId>
163-
<artifactId>jackson-core</artifactId>
164-
<version>${jackson.version}</version>
165-
</dependency>
166-
167188
<!--https://mvnrepository.com/artifact/com.sun.mail/javax.mail/ -->
168189
<dependency>
169190
<groupId>com.sun.mail</groupId>

src/main/java/com/anhtester/constants/FrameworkConstants.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,18 @@
1313

1414
public final class FrameworkConstants {
1515

16+
static {
17+
PropertiesHelpers.loadAllFiles();
18+
}
19+
1620
private FrameworkConstants() {
1721
}
1822

23+
public static int count_totalTCs = 0;
24+
public static int count_passedTCs = 0;
25+
public static int count_skippedTCs = 0;
26+
public static int count_failedTCs = 0;
27+
1928
public static String SCENARIO_NAME_CURRENT = "";
2029
public static String FEATURE_NAME_CURRENT = "";
2130
public static final String DELETE_TEMP_FOLDER = PropertiesHelpers.getValue("DELETE_TEMP_FOLDER");
@@ -51,9 +60,7 @@ private FrameworkConstants() {
5160
public static final String ZIP_FOLDER_PATH = PropertiesHelpers.getValue("ZIP_FOLDER_PATH");
5261
public static final String ZIP_FOLDER_NAME = PropertiesHelpers.getValue("ZIP_FOLDER_NAME");
5362
public static final String VIDEO_RECORD = PropertiesHelpers.getValue("VIDEO_RECORD");
54-
5563
public static final String LOCATE = PropertiesHelpers.getValue("LOCATE");
56-
5764
public static final int WAIT_DEFAULT = Integer.parseInt(PropertiesHelpers.getValue("WAIT_DEFAULT"));
5865
public static final int WAIT_IMPLICIT = Integer.parseInt(PropertiesHelpers.getValue("WAIT_IMPLICIT"));
5966
public static final int WAIT_EXPLICIT = Integer.parseInt(PropertiesHelpers.getValue("WAIT_EXPLICIT"));

src/main/java/com/anhtester/helpers/FileHelpers.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,16 @@
55

66
package com.anhtester.helpers;
77

8+
import com.anhtester.utils.LogUtils;
9+
810
import java.io.*;
911
import java.nio.file.Files;
12+
import java.nio.file.Path;
13+
import java.nio.file.Paths;
14+
import java.nio.file.StandardCopyOption;
15+
import java.util.Arrays;
1016
import java.util.List;
17+
import java.util.Optional;
1118

1219
public class FileHelpers {
1320

@@ -60,5 +67,50 @@ public static String readLineTxtFile(String filepath, int line) {
6067
}
6168
}
6269

70+
public static void moveFileToFolder(String filePath, String folderPath) {
71+
Path sourcePath = Paths.get(filePath);
72+
Path targetDirectory = Paths.get(folderPath);
73+
74+
// Ensure the target directory exists
75+
try {
76+
Files.createDirectories(targetDirectory);
77+
} catch (Exception e) {
78+
LogUtils.error("Failed to create target directory: " + e.getMessage());
79+
return;
80+
}
81+
82+
Path targetPath = targetDirectory.resolve(sourcePath.getFileName());
83+
84+
try {
85+
Files.move(sourcePath, targetPath, StandardCopyOption.REPLACE_EXISTING);
86+
LogUtils.info("File moved successfully!");
87+
} catch (Exception e) {
88+
LogUtils.error("Failed to move file: " + e.getMessage());
89+
}
90+
}
91+
92+
public static void copyFile(String source_FilePath, String target_FilePath) {
93+
try {
94+
Files.copy(Paths.get(source_FilePath), Paths.get(target_FilePath), StandardCopyOption.REPLACE_EXISTING);
95+
} catch (IOException e) {
96+
throw new RuntimeException(e);
97+
}
98+
}
99+
100+
public static File getFileLastModified(String folderPath) {
101+
File dir = new File(folderPath);
102+
if (dir.isDirectory()) {
103+
Optional<File> opFile = Arrays.stream(dir.listFiles(File::isFile)).max((f1, f2) -> Long.compare(f1.lastModified(), f2.lastModified()));
104+
if (opFile.isPresent()) {
105+
LogUtils.info("getFileLastModified: " + opFile.get().getPath());
106+
return opFile.get();
107+
} else {
108+
LogUtils.info("getFileLastModified: " + opFile.get().getPath());
109+
return null;
110+
}
111+
}
112+
113+
return null;
114+
}
63115

64116
}

0 commit comments

Comments
 (0)