- Navigate to the following sample application: http://computer-database.herokuapp.com/computers
- Test CRUD operations.
- In this project work I have automated basic CRUD operations, and considered only positive cases.
- This work is UI Functional testing, not a backend or webservices test automation.
- Tested on Windows 10
- Tested positive CRUD operations.
- Tested on Chrome browser.
- Tested on Jenkins (local) using jenkins script (it is not full blown CI/CD).
- Negative tests.
- Not tested on Linux OS.
- Not tested in Docker container.
- java 8
- cucumber
- maven
- selenium
- junit 4
- log4j 2.11
- windows 10 OS
- junit 4
- chromedriver
- selenium 3.14
- cucumber java
- extent reports
- log4j
- page object factory from selenium.
- singleton pattern.
Do git clone for downloading the project to your local machine and then import project to your IDE.
Install with git:
$ git clone https://github.com/meharlist/onesite.git
-
You can use git bash or any choice of shell.
-
Go to your project directory from terminal and hit below command:
$ mvn clean package compiler:testCompile surefire:test
-
Test results or reports can be found in
cucumber-reports
folder which is undertarget
directory. -
logfile
under project root, which you can open to see what steps were executed. It is simple logger info.
-
Import project to IDE
-
open TestRunner class from
src\test\java\com\onesite
-
click on project root, and navigate to
src\test\java\com\onesite
and openTestRunner
class and run as junit test -
JUnit test results can be found in
target
folder. -
Also, you have another option to execute from IDE.
-
you can copy mvn command, see below.
clean package compiler:testCompile surefire:test
- And go to project root folder in eclipse and click
Run As
->Run Configurations
and then double click onmaven build
and keep exactly as below image.
-
click
apply
andrun
-
test results are in
target
folder. -
Possible issues you might encounter, java run time issue, if it is the case, do some internet search on how to execute maven project from
Eclipse IDE
-
You might run into above issue because you did not set your
java build path
->JRE system library
tojdk 8
and you forgot to setjava compiler
tojava 8
. -
For point 11, the settings are in eclipse, navigate to project root folder and then click
build path
by left clicking and set the point 11.
- Please follow this git link
https://github.com/meharlist/onesite-jenkins
-
Please do not execute in Linux OS.
-
If you try running on Linux then configuration needs changes, especially with file navigation, because linux file navigation uses
//
on contrast windows uses\\
-
Due to point 2 your execution will fail.
-
Don't run in
geckodriver
ORfirefoxdriver
-
For point 4, you shouldn't be worry if you plan to run against chrome, because I have set
chrome
as browser type inconfiguration.properties
.