Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 7.16 KB

AGENTS.md

File metadata and controls

46 lines (33 loc) · 7.16 KB

Repository Guidelines

Short orientation for automated contributors.

What This Is

Two Robot Framework libraries built on top of the Browser library:

  • packages/electron/ — robotframework-electron, import name Electron: start Electron applications and hand their windows to the Browser library.
  • packages/vscode/ — robotframework-vscode, import name VSCode: end-to-end testing of VS Code extensions (isolated launch of a given VS Code, its command-line script and extension host; workbench keywords belong in the tests' own resources, as in the example). Not specific to any one extension; RobotCode is the first consumer.

Background, research and the initial design ideas are in dev-docs/background.md.

Layout

  • packages/*/src/<Module>/ — library sources (uv workspace members, uv_build backend with module-name).
  • openspec/ — planned and archived changes (OpenSpec, /opsx:* commands).
  • dev-docs/ — planning and design notes, not user-facing.

Browser Library Dependency

robotframework-browser comes from PyPI. packages/electron/pyproject.toml has the lowest version that the libraries run on, and uv.lock the version for development and CI. uv run rfbrowser init chromium completes its installation inside .venv, with Chromium and Playwright's ffmpeg for the tests that need them. After an upgrade of Browser, run uv run rfbrowser clean-node first and then that command again.

Common Commands

  • uv sync, then uv run rfbrowser init chromium — install the workspace into .venv, including the dev tools (pytest, RobotCode), and complete the installation of the Browser library. The acceptance tests and one unit test need the second command.
  • Always start RobotCode from the repository root with -r .. Each workspace package has its own pyproject.toml; without -r, RobotCode searches the project root upward from the given paths, stops at a package's pyproject.toml and ignores robot.toml.
  • npm ci, then npm run prepare-tests in the repository root — prepare the VS Code and Electron builds that the acceptance tests run against: VS Code 1.141.0 with @vscode/test-electron in .cache/vscode, and Electron 44.7.0 and 42.11.12 from npm, with their binaries cached in .cache/electron. npm run prepare-tests -- insiders adds the newest VS Code Insiders. robot.toml points VSCODE_EXECUTABLE and ELECTRON_EXECUTABLE to them with the paths of Linux x64; on other platforms, set the paths that the script prints under [extend-variables] in .robot.toml, because a [variables] table there replaces the one of robot.toml. It needs Node.js 22.12 or later.
  • uv run robotcode -r . robot — run the Robot Framework acceptance tests. Paths, output directory and profiles come from robot.toml; select a profile with -p <name> before the subcommand, and one test or suite with -bl "<longname>". The display profiles choose where the windows open: -p xvfb hidden on a Full HD Xvfb screen, also on a Wayland desktop and without any desktop; -p xephyr in a separate Xephyr window; -p local or no display profile on the normal desktop. Combine them with other profiles, for example -p xvfb -p vscode-insiders. Agents use -p xvfb. The profiles need Xvfb, and Xephyr for xephyr; both start Openbox, if it is installed, so that windows can be maximised.
  • uv run robotcode -r . discover tests, uv run robotcode -r . results summary, uv run robotcode -r . analyze code — list tests, inspect the last run, analyse statically.
  • uv run pytest — Python unit tests of all packages.
  • uv run pre-commit run --all-files — all checks that CI runs before the tests: standard hooks, ruff check, ruff format --check, mypy (strict), RobotCode's analysis of the repository and the example, and the generated keyword reference. uv run ruff check --fix and uv run ruff format fix and format, uv run mypy type-checks. uv run pre-commit install installs the hooks, which also check commit messages against Conventional Commits.
  • uv run robotcode -r examples/vscode-extension robot — run the VS Code example project, after npm ci and npm run download-vscode in its folder, which download its VS Code. It has its own robot.toml with the same display profiles and is not part of the root robot.toml paths. Its guides in docs/ include its files, so check them when you change the example.
  • uv run python docs/scripts/update_screenshots.py — run the example with -p xvfb and copy its screenshots to docs/src/assets/screenshots/. Run it after changing the example or its VS Code version, and commit the images. It needs the example's VS Code from npm run download-vscode, Xvfb, Openbox and network access for the Python tests.
  • uv run python docs/scripts/generate_reference.py — write the keyword reference of both libraries with robotcode doc lib to electron/reference.md and vscode/reference.md of the documentation site. The pre-commit hook keyword-reference runs it when a commit touches the libraries' sources, uv.lock, the script or the pages, and fails if the pages change: git add them and commit again. Do not edit the pages by hand.
  • uv run git-cliff -o CHANGELOG.md — regenerate the changelog from the Conventional Commits (cliff.toml). uv run scripts/update_versions.py writes the version from git (<next version>.dev<commits> after the last tag v<version>) into the pyproject.toml files and the helper extension's package.json; CI runs it before building the wheels, and its changes are not committed. Releases are made with uv run cz bump, see "Versions and Releases" in CONTRIBUTING.md.
  • uv build --package robotframework-vscode — build the VSCode package. Its build hook (packages/vscode/hatch_build.py) packs the helper extension into packages/vscode/src/VSCode/extension-host.vsix with @vscode/vsce; npm ci --ignore-scripts and npm run package-helper in packages/vscode do only that. It needs Node.js 22 or later. The acceptance tests of the installed helper need the .vsix; uv sync does not pack it.
  • npm ci, then npm run dev or npm run build in docs/ — install the documentation site's dependencies, serve it locally with live reload, or build it into docs/dist/. Only Node.js is needed, no Python. Started by an agent, npm run dev runs in the background; stop it with npx astro dev stop in docs/.

Agent Notes

  • Never open issues, pull requests or comments in other repositories (including the Browser library) unless explicitly asked.
  • Never run cz bump, create tags or release unless explicitly asked.
  • Make small, focused changes; plan larger work as an OpenSpec change first.
  • Follow CONTRIBUTING.md and the AI_POLICY.md: issues and pull requests end with an "AI / tooling disclosure", and commits must be cryptographically signed.
  • Write commit messages as Conventional Commits: <type>(<optional scope>): <description>, for example feat(electron): add Start Electron Application or docs(openspec): plan vscode workbench keywords change. Use the package (electron, vscode) or openspec as scope where it fits.