This is a simple project that would allow anyone to get up and running with Java, Maven, Selenium and TestNG. It also explains how to execute a simple test that will assert the title of a page.
Currently the project has one test that will navigate to http://www.qualityworkscg.com/
and verify the title matches QualityWorks Consulting Group
There are a few things we need before running the tests. These are:
Check your system to see if you have the latest Java version installed.
Command:
$ java -version
If you do not have the latest Java installed, find out how to install Java here.
Ensure your JAVA_HOME
environment to the location of the installed JDK. Find out how to do that here.
Navigate to the Eclipse download page and download eclipse for Java EE developers.
-
Installing a Plugin:
- Inside Eclipse, click on the Help menu
- Select Install New Software.
-
Locating the Plugin:
- Click the Add button
- Enter http://beust.com/eclipse in the Location field
-
Selecting the Plugin:
-
Finishing up:
- Accept the terms of the license agreement
- Click on the Finish button
-
Download Maven here.
-
Unzip the distribution archive to the directory you wish to install Maven. I extracted maven to my
Documents
folder -
Add Maven to the
PATH
. More information can be found in theREADME.txt
in the zip folder.- Here's an example of how I added Maven to my
PATH
on MacOS. I added the folowing to the~/.bash_profile
.
$ export PATH=/Users/admin/Documents/Software/apache-maven-3.5.0/bin:$PATH
- Then
source
d (execute) the content of the~/.bash_profile
$ source ~/.bash_profile
- Here's an example of how I added Maven to my
-
Verify Maven was correctly installed
- Command:
$ mvn –version
Maven dependencies are crucial to running any Maven project.
Maven dependencies contains key references to libraries that a Maven project needs to execute. The
pom.xml
in the root of a Maven project file stores the dependencies (similar to thepackage.json
for Node andgemfile
for Ruby) for a project.
- Import this project into Eclispe
- Right click the project then select Run As then Maven Tests
Navigate to the location of project then execute mvn test
.
Expected output:
- Ensure FF version 48 or higher is installed
Feel free to submit a pull requests! For specifics on how to contribute to this project, check out the contributing file.
This project is released under the MIT License.