A Robot Framework library on top of Playwright. Python keywords (Browser/) call a Node.js
Playwright wrapper (node/playwright-wrapper/) over gRPC (protobuf/playwright.proto), so a
keyword change usually touches all three. Supports Python 3.11+, Node 22/24/26 and Robot
Framework 7.1.1+. The Robot Framework floor lives in pyproject.toml and in the rf-version
of the CI matrix; change both together.
Browser/browser.py:Browser(DynamicCore), the library class. It owns global and scoped state (scope_stack).Browser/keywords/: one keyword class per feature area, each extendingLibraryComponent(Browser/base/librarycomponent.py).Browser/assertion_engine.py:@with_assertion_polling. The assertion helpers (verify_assertionand friends) come from theassertionenginepackage.node/playwright-wrapper/grpc-service.ts: one handler per rpc.playwright-state.tsowns the browser, context and page lifecycle.playwright-invoke.tshasfindLocator, which resolves selectors, strict mode and frames for almost every keyword.node/dynamic-test-app/: the Test App that the acceptance tests drive.tools/ci_failures/: maintainers' analysis of CI failures.
CONTEXT-MAP.md lists the domain contexts and their CONTEXT.md vocabularies, and
docs/adr/ holds the decisions. Read the relevant ones before changing how a keyword call
reaches its body (the Robot Framework path and the Python path differ on purpose), the Test App
logging, or tools/ci_failures.
These are gitignored and regenerated; edit their sources instead.
| Files | Regenerated by |
|---|---|
Browser/generated/, node/playwright-wrapper/generated/ |
inv protobuf |
Browser/wrapper/, Browser/browser.pyi, mypy_stub/ |
inv node-build |
node/dynamic-test-app/dist/ |
inv create-test-app |
Set up once with python bootstrap.py, activate .venv, then inv build. inv build installs
the Python dependencies on every run, but the Node dependencies and Playwright browsers only when
package-lock.json changed since the last install. inv deps --force reinstalls them, for
example after a broken browser install. PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD skips the browsers.
After a change to the proto, the TypeScript wrapper, or a keyword signature or docstring, run
inv node-build. It regenerates protobuf, the wrapper and browser.pyi. inv atest and
inv utest test the last build of the wrapper and never rebuild it. inv atest does rebuild the
Test App.
inv utest: pytest. ImportingBrowserneeds the generated protobuf.test_python_usage.py,test_screenshot.py,test_secrets.pyandtest_shared_playwright_port.pylaunch Node and a real browser. Tests that need the built Test App take the session-scopedtest_app_urlfixture (utest/conftest.py); it starts the app throughatest/library/test_app_server.py, the same start-and-retry code the acceptance tests use.test_close_deadline.pyandtest_python_arguments.pystart Node without a browser. One file:inv utest --suite utest/test_x.py.inv utest-node: Jest, innode/playwright-wrapper/__tests__/.inv atest --suite <name>(or--test,--include): pabot, with one Node process shared by every worker. Results land inatest/output/;inv atest-failedreruns the failures.inv lint:lint-python(ruff format and check, mypy;--fixfixes),lint-node(prettier, eslint,tsc --noEmit) andlint-robot(robocop format). Locallylint-nodeandlint-robotrewrite files; in CI they only check.- Coverage:
inv --help atest-coverage.
CI (.github/workflows/on-push.yml) is the only gate; there are no git hooks.
- A new keyword needs a need. The keyword count stays low on purpose. First try extending an
existing keyword, a better assertion, or one higher-level keyword that combines Playwright
calls. A new keyword needs Playwright functionality that can only be exposed as a keyword, or a
user need that is generally useful. State that plugins or test helpers need goes on an internal
Browserproperty. Thechange-keywordskill walks through any keyword change. - Keyword docstrings are the documentation. They explain intent, what each argument does, and show examples. Code and tests carry minimal comments; names explain them.
- Keyword annotations stay narrow (
button: MouseButton). Python callers get argument conversion instead; widened types belong only in the generatedbrowser.pyi(ADR 0006). - State flows from
Browser.LibraryComponentdelegates to typed properties onBrowser(ADR 0009). - Plugins:
atest/test/09_Plugins/ExamplePlugin.pyis the worked example CI runs. User docs: https://robotframework-browser.org/docs/extending/python-plugins
Browser/version.py is the source; inv version <VERSION> writes it to every other file. The
release steps are in CONTRIBUTING.md.
Project skills are in .claude/skills/, one folder each with a SKILL.md. Load the one whose
description matches the task.