Skip to content

Commit 0d76d98

Browse files
committed
Update version 1.3
1 parent 43b9604 commit 0d76d98

23 files changed

+425
-82
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ ExtentReports.zip
88
/logs
99
/target
1010
HDSD.txt
11+
*.png
1112

README.md

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Automation Framework Selenium Java with TestNG building by Anh Tester (VERSION 1.2)
1+
# Automation Framework Selenium Java with TestNG building by Anh Tester (VERSION 1.3)
22

3-
**SOME FEATURES IN VERSION 1.2**
3+
**SOME FEATURES IN VERSION 1.3**
44
1. Run the parallel test case
55
2. Read Object web element from a properties file
66
3. Extent Report
@@ -9,8 +9,9 @@
99
6. Logfile
1010
7. Record video and Screenshot test case for failed
1111
8. Read data test form Excel file (xlsx, csv, json,...) with class define fields (param: Client client)
12-
9. Base function in the library (WebUI, Utils,...) ...etc.. (wait, dynamic xpath,...)
12+
9. Base function in the package: utils, helpers
1313
10. Read data from Json file
14+
11. Main Keyword: WebUI (call common function)
1415

1516

1617
## **SYSTEM REQUIREMENTS**
@@ -118,16 +119,31 @@ Note: enabled Allow less secure apps
118119
- Create function with annotaion **DataSupplier** on ***src/main/java/anhtester/com/utils/DataProviderUtils.java***
119120
- Call the name of **DataSupplier** above in the test cases as DataProvider of TestNG
120121

121-
**9. Base function in library**
122+
**9. Base function in the package**
122123

123-
- **WebUI.** call any method you need =))
124-
- And ..etc.. on ***src/main/java/anhtester/com***
125-
(It is static method)
124+
- ***src/main/java/anhtester/com/utils***
125+
- ***src/main/java/anhtester/com/helpers***
126126

127127
**10. Read data from JSON file**
128128

129+
129130
- **JsonUtils** class select the json file path and call **"get"** method with **key**
130131

132+
**11. Main Keyword: WebUI**
133+
134+
- WebUI class is main keyword in Framework. It contains common functions
135+
- How to use: WebUI.function_name
136+
- Example: WebUI.setWindowSize(1024, 768), WebUI.screenshotElement(By by, String elementName),...
137+
138+
**12. Call function to using sample**
139+
- All in one package: src/test/java/anhtester/com/projects/website/crm/testcases
140+
```
141+
+ ClientTest
142+
+ SignInTest
143+
+ TestHandle
144+
+ TestSimpleCode
145+
```
146+
131147

132148
## Project structure
133149

@@ -249,6 +265,10 @@ AutomationFrameworkSelenium
249265
┗ 📜README.md
250266
```
251267

268+
269+
## I shall write document for my Framework. Coming soon...
270+
271+
252272
# Copyright 2022 Anh Tester
253273

254274
> Anh Tester Blog: https://anhtester.com/

pom.xml

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

77
<groupId>anhtester.com</groupId>
88
<artifactId>AutomationFrameworkSelenium</artifactId>
9-
<version>1.2</version>
9+
<version>1.3</version>
1010
<name>AutomationFrameworkSelenium</name>
1111
<url>https://github.com/anhtester/AutomationFrameworkSelenium</url>
1212

@@ -17,13 +17,13 @@
1717
<maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
1818
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
1919

20-
<selenium.version>4.1.3</selenium.version>
20+
<selenium.version>4.1.4</selenium.version>
2121
<testng.version>7.4.0</testng.version>
22-
<webdrivermanager.version>5.1.0</webdrivermanager.version>
22+
<webdrivermanager.version>5.1.1</webdrivermanager.version>
2323
<aspectjweaver.version>1.9.7</aspectjweaver.version>
2424
<ashot.version>1.5.4</ashot.version>
2525
<log4j.version>2.17.2</log4j.version>
26-
<allure-testng.version>2.17.2</allure-testng.version>
26+
<allure-testng.version>2.17.3</allure-testng.version>
2727
<allure-maven.version>2.10.0</allure-maven.version>
2828
<allure-environment-writer.version>1.0.0</allure-environment-writer.version>
2929
<allure.cmd.download.url>
@@ -38,11 +38,11 @@
3838
<monte-screen-recorder.version>0.7.7.0</monte-screen-recorder.version>
3939
<mysql-connector-java.version>8.0.28</mysql-connector-java.version>
4040
<google.zxing.version>3.4.1</google.zxing.version>
41-
<lombok.version>1.18.22</lombok.version>
41+
<lombok.version>1.18.24</lombok.version>
4242
<google.guava.version>31.1-jre</google.guava.version>
4343
<data.supplier.version>1.9.7</data.supplier.version>
4444
<javax.mail.version>1.6.2</javax.mail.version>
45-
<zip.version>1.14</zip.version>
45+
<zip.version>1.15</zip.version>
4646
<jackson.version>2.13.2</jackson.version>
4747

4848
<!-- Suite XML path -->

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
4+
*/
5+
16
package anhtester.com.helpers;
27

38
import anhtester.com.constants.FrameworkConstants;
@@ -6,8 +11,6 @@
611
import org.openqa.selenium.OutputType;
712
import org.openqa.selenium.TakesScreenshot;
813
import org.openqa.selenium.WebDriver;
9-
import org.openqa.selenium.io.FileHandler;
10-
import org.testng.Reporter;
1114

1215
import java.awt.*;
1316
import java.io.File;

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
4+
*/
5+
16
package anhtester.com.helpers;
27

38
import java.sql.Connection;
@@ -6,8 +11,7 @@
611

712
public class DatabaseHelpers {
813

9-
public static Connection getMySQLConnection(String hostName, String dbName, String userName, String password) throws SQLException,
10-
ClassNotFoundException, SQLException {
14+
public static Connection getMySQLConnection(String hostName, String dbName, String userName, String password) throws SQLException {
1115

1216
// Ví dụ: jdbc:mysql://localhost:3306/saleserp
1317
String connectionURL = "jdbc:mysql://" + hostName + ":3306/" + dbName;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
4+
*/
5+
16
package anhtester.com.helpers;
27

38
import java.awt.Color;

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
/*
2-
* Copyright (c) 2022.
3-
* Automation Framework Selenium - Anh Tester
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
44
*/
55

66
package anhtester.com.helpers;
77

8-
import org.apache.commons.codec.binary.Base64;
9-
10-
import javax.annotation.Nullable;
11-
import javax.crypto.Cipher;
12-
import javax.crypto.SecretKey;
13-
import javax.crypto.spec.SecretKeySpec;
148
import java.io.*;
159
import java.nio.charset.Charset;
1610
import java.util.ArrayList;
@@ -38,7 +32,7 @@ public static String readFile(String file) throws IOException {
3832
* @return lấy đường dẫn đến thư mục nguồn source mình có thêm dấu / ở cuối luôn
3933
*/
4034
public static String getCurrentDir() {
41-
String current = System.getProperty("user.dir") + "/";
35+
String current = System.getProperty("user.dir") + "\\";
4236
return current;
4337
}
4438

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
4+
*/
5+
16
package anhtester.com.helpers;
27

38
import anhtester.com.utils.Log;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
4+
*/
5+
16
package anhtester.com.helpers;
27

38
import java.io.*;

src/main/java/anhtester/com/utils/BrowserInfoUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* Copyright (c) 2022.
3-
* Automation Framework Selenium - Anh Tester
2+
* Copyright (c) 2022 Anh Tester
3+
* Automation Framework Selenium
44
*/
55

66
package anhtester.com.utils;

0 commit comments

Comments
 (0)