Automation of OrangeHRM demo site as part of Guvi's capstone project.
This site has been automated using Python with Selenium and pytest frameworks.
This is just for learning purposes.Having said that, if you can improve the functionality of the code, please free feel to fork the repo and make a PR (pull request).
Suggestions are always welcome!
- Clone / Download the entire repo
- Install Python
- Selenium is required but that'll be installed using the requiremnets.txt file, so we'll skip that.
- Download webdriver for your preferred browser.
- Run the following command in your preferred shell.
pip install -U -r requirements.txt
-
The above command will install dependensies and upgrade them if any update is available.
-
Now, cd into the test_script folder and run the following command.
pytest -v -s -x test_login.py --capture=sys --html=/home/user/yourworkingdirectory/reports/report_something.html
- pytest > The framework we use for testing and generating report.
- -v > -v, or --verbose, increases the verbosity level. Use '-vv' to increase level.
- -s > Captures standard output since by default only failed cases show captured output.
- -x > Stop after the first failed test. Use --maxfail=N for stopping after N failed cases.
- --capture=sys > captures the std Out which is used in report.
- -k > This option allows you to filter which tests to run, by matching their names against a “keyword expression”
- --pdb > makes pytest start PDB, Python’s built-in debugger, when a test fails. Rather than seeing static failure output, you can directly interact with the objects, in the test environment, right at the point of failure.
- --pastebin=failed / --pastebin=all > Send report to online pastebin services.