This project was tested with
- python 3.12
- Navigate to Run Selenium Tests Nightly action
- Click
Run workflowdropdown - Use workflow from Branch: main
- Choose which tests to run
allruns all testsprint_differencesruns test case5and6fromProblem #1
- Click
Run workflowbutton
Note: This workflow also runs automatically nightly at 10pm PST
- Clone this repo: for example
git clone https://github.com/ceacosta-git/selenium-google-finance.git
- Navigate to
selenium-google-financeproject on your local environment: for example
cd ~/dev/selenium-google-finance
- Use
pipenvfor setting a local virtual environment- Pre-requisites:
- Install
python - Install
pip
- Install
- Install
pipenv
pip3 install pipenv- Install dependencies using
Pipfilepipenv install
- Pre-requisites:
- Run tests
- Running
alltests
pipenv run python -m pytest --verbose --html=reports/report.html --self-contained-html -s- Running
print_differences(test case5and6fromProblem #1)
pipenv run python -m pytest -m print_differences --verbose --html=reports/report.html --self-contained-html -s - Running
Write an automated test for a web application using Python and Selenium using Page Object and Page Factory models.
Retrieve data from UI and compare against the following test data:["NFLX","MSFT", "TSLA"]
Write a test that:
- Navigates to Google Finance page on a
Chromebrowser. - Verifies the page is loaded by asserting the page title contains
Google Finance - Retrieves the stock symbols listed under the
section“You may be interested in info”
- Compare the stock symbols retrieved from
(3)with given test data - Print all stock symbols that are in
(3)but not in given test data - Print all stock symbols that are in given test data but not in
(3)
Create GitHub Actions workflows for manually and nightly runs.
Manual workflow should have option to run full set of test or test case 5 and 6 from Problem #1.
The main solution for Problem #1 was implemented in tests/google/test_finance_page.py
The main solution for Problem #2 was implemented in .github/workflows/nightly_test_run.yml
- Allow to specify
headlessornon-headlessbrowser option through apytestflag - Support and specify other browsers such as
Firefox - Setup and run this project using Docker
- Investigate if we can run
non-headlessin github
As a refresher on Selenium with python, the following references were extremely useful: