Skip to content
← Back

Odoo Hospital Testing

A two-layer automated test suite, Python unit tests plus Selenium browser tests, written against a real Odoo hospital module.

  • Python
  • Odoo
  • Selenium
  • Robot Framework
Test cases
10

Overview

A two-layer test suite built around a real Odoo module. The module under test, om_hospital, isn't mine, it's Odoo Mates' open-source outpatient clinic app for Odoo 15, included unmodified so the tests have something real to run against. My work is the two independent test suites built around it.

What was built

Part A is 5 unit tests written with Odoo's own TransactionCase framework, hitting the ORM directly with no browser or HTTP involved: patient creation, a negative-age validation check, doctor/patient linking on appointments, and two required-field checks. Part B is 5 Selenium tests driven by Robot Framework against a live Odoo instance in Chrome, covering login, creating a patient (both a valid case and a missing-name case), editing a patient's age, and searching by name.

Tech

Python and Odoo's TransactionCase for Part A. Robot Framework, SeleniumLibrary, and Selenium 4 driving a real Chrome browser for Part B, run against Odoo 15 on localhost.

What testing turned up

Reading the module closely enough to test it well surfaced three real bugs, none of which the current tests catch: the "Create Appointment" wizard hardcodes doctor_id to 2 regardless of which doctor you'd want, every appointment made through it silently goes to whichever doctor happens to have that id. The patient record's confirm/done/cancel workflow is fully implemented in Python but commented out of the view, so it can't be triggered from the UI at all. And the access control list grants every logged-in user full create/read/write/delete access to every hospital model, with no group restriction.