Skip to content
An example of using TDD to drive test automation development with Selenium and Pytest
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pages
tests
.gitignore
Pipfile
Pipfile.lock
README.md

README.md

PyDit (A Selenium TDD example)

A simple bot written in Python 3.8 that uses Selenium to access Reddit, interact with the webpages and downloads a lovely picture.

This is written purely for fun but will act as a great example of how to use TDD to drive your automation test case development.

Here are the results that must be achieved:

  1. The browser must load up http://reddit.com using Chrome.
  2. The bot should find the search box and type in 'memes' and submit the query.
  3. On the results page, the 'r/memes' sub-reddit link should be clicked on.
  4. On the sub-reddit page, the first post should be clicked on.
  5. The photo in post should be downloaded.
  6. The browser should close and you will have a nice new meme :)

PyTest will also be used to ensure that all these steps are passing.

To run the test you will need Python, PIPenv, Selenium and Pytest.

Then run the command pipenv run python -m pytest.

You can’t perform that action at this time.