- This repo contains example code for Tendable website's tech challenge.
- Maven is used as build tool in this project.
- TestNG is used as testing framework for organizing and running tests and performing Assertions.
- Data Faker library is used for setting the fake data while filling up the form.
- All the tests are written in the
TendableWebSiteTests
class. - The first test
testTopLevelMenus()
verifies that the top level menus, i.eHome
,Our Story
,Our Solution
andWhy Tendable
are present and accessible. - The second test
testPresenceOfRequestADemoButton()
checks that theRequest a Demo
button is present and active on the following pages:- Home
- Our Story
- Our Solution
- Why Tendable
- The third test
testContactMarketing()
navigates to theContactUs
page, choosesMarketing
and fills the form leaving theMessage
field empty. An assertion is performed on the error messageSorry, there was an error submitting the form. Please try again.
- Page Object model has been used in this project as it helps in better readability and maintainability. Hence, separate page classes have been created that houses the WebElements of the respective page.
BasePage
class has the common WebElements that are available on multiple pages on the website. TheRequest a Demo
button's WebElement is updated in this class. This Base Page class is extended by all other page object classes as it gives flexibility to re-use the BasePage class methods and variables easily.- For filling the
Contact Us
form, Data Faker library has been used as it takes care of passing the fresh data in the test everytime the tests are run. So, we don't have to worry about the test data generation. DriverManager
class has been created to take care of the drivers required to run the test. Currently, Chrome, Firefox and Edge browsers are supported in this project.BaseTest
class is created that instantiates the DriverManager class and passes the browser name using the@Parameter
annotation in TestNG. InBaseTest
class, the browser name supplied fromtestng.xml
will actually be passed in thestartBrowser()
method from theDriverManager
class and the respective browser session will be started.
-
To run the test from command line use the following command:
mvn clean test
-
To run the tests using TestNG in intelliJ:
- Right click on
testng.xml
and selectRun '...\testng.xml
- Right click on
- Discuss your queries by writing to me @
mohammadfaisalkhatri@gmail.com
OR ping me on any of the social media sites using the below link: