This project was tested with
- python 3.12
- Navigate to Run Selenium Tests Nightly action
- Click
Run workflow
dropdown - Use workflow from Branch: main
- Choose which tests to run
all
runs all testsprint_differences
runs test case5
and6
fromProblem #1
- Click
Run workflow
button
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-finance
project on your local environment: for example
cd ~/dev/selenium-google-finance
- Use
pipenv
for setting a local virtual environment- Pre-requisites:
- Install
python
- Install
pip
- Install
- Install
pipenv
pip3 install pipenv
- Install dependencies using
Pipfile
pipenv install
- Pre-requisites:
- Run tests
- Running
all
tests
pipenv run python -m pytest --verbose --html=reports/report.html --self-contained-html -s
- Running
print_differences
(test case5
and6
fromProblem #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
Chrome
browser. - 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
headless
ornon-headless
browser option through apytest
flag - Support and specify other browsers such as
Firefox
- Setup and run this project using Docker
- Investigate if we can run
non-headless
in github
As a refresher on Selenium with python, the following references were extremely useful: