Selenium test project for Zippia
Prerequisite:
-
Latest chrome browser: Make sure to have latest chrome browser installed on your local machine (Since the current framework configured to execute on chrome browser but we can have multiple browsers configured by adding few configuration steps with which we can achieve cross browser testing.)
-
Latest node.js: Install from the site - https://nodejs.org/en/ take the LTS version based on your Operating system (Once node is installed check node version by firing command to the terminal or cmd node -v)
-
Latest JDK: JDK is required for executing report. Follow installing JDK and Setting JAVA_HOME steps from document (https://www.oracle.com/webfolder/technetwork/tutorials/oraclecode/windows-hol-setup.pdf) and once its done check installed jdk verison by firing command to terminal or cmd java --version
Run Some Sample Tests:
To execute the entire test suite in local machine, you can use below mentioned option:
- To execute this project on local machine enter mentioned command to terminal by navigating to the root directory of project: npm run test or npm test
- To view allure reports on browser enter mentioned command to terminal by navigating to the root directory of project: npm run report
Tech Stack:
- Programming Language: JavaScript
- Testing Framework: Mocha JavaScript Framework
- Assertion: Chai library
- Design pattern: Page Object Model (POM)
- Reports: Allure reports
- Source Code Management: Git
Mocha JavaScript framework:
Tests are written in the Mocha framework. See below screenshot and More about Mocha can be found at https://mochajs.org/
Design Pattern used: Page Object Model (POM): A way of representing interactions with a page or component. It Helps to be more maintainable and easier to read.
Within your web app's UI there are areas that your tests interact with. A Page Object simply models these as objects within the test code. This reduces the amount of duplicated code and means that if the UI changes, the fix need only be applied in one place. In other wards one of the challenges of writing test automation is keeping your [selectors] (classes, id's, or xpath's etc.) up to date with the latest version of your code. The next challenge is to keep the code you write nice and [DRY] (Don't Repeat Yourself). The page object pattern helps us accomplish this in one solution. Instead of including our selectors in Spec file (in Mocha), we instead place them in a .js file where we can manage all these selectors and methods together. Your test file should only call the test methods.
Allure Reports:
The Allure Reporter creates Allure test reports which is an HTML generated website with all necessary information to debug your test results and take a look on error screenshots.