Files
Tirsvad 9565ebe66d Add README screenshots and a three-language wiki (MIL-003)
Wiki pages in English, Danish and Bahasa Malaysia for the home page and the
three lecture steps, with a sidebar and the screenshots; README with the
screenshots table and wiki links; review RC-011.

Task: MIL-003#1
2026-10-28 16:24:57 +08:00

6.0 KiB

🚀 048-fill-out-form

Udemy "100 Days of Code: The Complete Python Pro Bootcamp", Day 48: automate a browser with Selenium — click a link by its text, type into a search box, send the Enter key and fill out a sign-up form. For course participants who want to compare solutions and for anyone who wants a small, tested Selenium example.

📚 Table of Contents

🧭 Overview

The code automates the three steps of the lecture:

  1. click_link_by_text — click the "Content portals" link on the Wikipedia main page.
  2. search_for — type "Python" into the search box and press Enter.
  3. fill_out_form — type a first name, last name and email into the sign-up form and click the button.
Part What it is for
src/fill_out_form/ The package: constants.py holds every URL, locator and text; the layers domain, application, infrastructure and presentation hold the code
tests/ pytest tests (unit/), the browser run (e2e/) and a local copy of the form (fixtures/)
docs/ Project documents, screenshots and the wiki in English, Danish and Bahasa Malaysia
Doxyfile Configuration for the Doxygen API documentation

Screenshots of the lecture steps

Taken in a Docker container with headless Chromium.

Step Screenshot
1. Click the link "Content portals" Step 1
2. Search for "Python" and press Enter Step 2
3. Fill out the form, before Sign Up Step 3, filled
3. After Sign Up (the demo page rejects the default example.com address; pass your own with --email) Step 3, signed up

What each step teaches is explained in the wiki: English, Dansk, Bahasa Malaysia.

📋 Requirements

  • Python 3.13 or newer, with venv — the language and the isolated environment.
  • Google Chrome or Chromium — the browser that Selenium drives (Selenium 4 finds the driver itself).
  • Docker — only to run the browser in a container and take the screenshots.
  • Doxygen — only to build the API documentation (optional).

The only runtime dependency is selenium; pytest, ruff and mypy are development extras.

🛠️ Setup

Create and use a local virtual environment in .venv:

python -m venv .venv

Activate it (Linux, macOS, Git Bash):

source .venv/bin/activate

Activate it (Windows PowerShell):

.venv\Scripts\Activate.ps1

Upgrade pip and install the project with the development extras:

python -m pip install --upgrade pip
python -m pip install -e ".[dev]"

▶️ Run

Run the three lecture steps in a visible Chrome window:

python -m fill_out_form

Useful options: --headless (no window), --screenshots DIR (save one picture per step), --form-url URL (use another form page) and --first-name, --last-name, --email (the values typed into the form; the demo page rejects the default example.com address, so use your own to see the success page). See python -m fill_out_form --help.

Run the steps in Docker (headless, screenshots in results/), which never touches your desktop:

docker build -t fill-out-form -f docker/Dockerfile .
docker run --rm -v "$(pwd)/results:/results" fill-out-form

🧪 Tests

The unit tests need no browser and no network:

python -m pytest

Build the API documentation with Doxygen (output in docs/doxygen/):

doxygen Doxyfile

📄 License

GNU Affero General Public License v3.0, see LICENSE.

📎 Appendix: Project documents

The documents a newcomer needs, in reading order.

Document What it tells you
AGENTS.md The rules AI agents follow in this repository
Business Case Why the project exists, its scope and success criteria
Stakeholder Analysis Who is involved; the stakeholder IDs used for owners and reviewers
Project Plan The gateways and their schedule
Milestones One document per gateway: Go/No-Go criteria and tasks
Artifact registry Where each artifact type lives, the next version, the PO language and domain
Wiki pages (docs/wiki) The lecture steps explained, in three languages
Traceability matrix How the artifacts link and when each was last reviewed
Framework README The framework this project uses
Framework changelog What changed in each framework release