diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbd67bd..c596471 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -68,7 +68,7 @@ jobs: # it's absent, so this install is fail-soft (no-op on the 3.10 matrix # leg or if the pre-release is unavailable). Pinned to the verified # pre-release; prebuilt wheel, no Rust. - run: pip install "robotframework-PlatynUI==0.12.0.dev330" || echo "PlatynUI unavailable on this interpreter — rf-platynui fidelity test will skip" + run: pip install "robotframework-PlatynUI==0.14.0.dev0" || echo "PlatynUI unavailable on this interpreter — rf-platynui fidelity test will skip" shell: bash - name: Install Browser Library (optional — rf-browser example and keyword checks) # Lets the rf-browser example dry runs and decision-table keyword checks @@ -254,7 +254,7 @@ jobs: run: | pip install robotframework "robotcode[all]>=2.8" robotframework-browser robotframework-seleniumlibrary \ robotframework-appiumlibrary robotframework-requests RESTinstance \ - "robotframework-PlatynUI==0.12.0.dev330" + "robotframework-PlatynUI==0.14.0.dev0" - name: Resolve every keyword call with robotcode analyze code # --require-all: a skill whose library failed to import fails the job # instead of being skipped silently. diff --git a/CHANGELOG.md b/CHANGELOG.md index d91cac2..2a534ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Every plugin (`rf-core`, `rf-web`, `rf-api`, `rf-mobile`, `rf-desktop`) and the ## Unreleased +### rf-desktop + +- `rf-platynui` targets PlatynUI `0.14.0.dev0`. PyPI no longer has `0.12.0.dev330`, which the skill pinned, so its install command failed. The skill teaches `Get Attribute Value` instead of the deprecated `Get Attribute`, and the new `Wait Until Exists`, `Wait Until Gone`, `Wait Until Attribute Value`, `Wait Until Query`, `Set Query Settings`, `Pointer Scroll` and `Get Element At Point`. The catalogue requires `robotframework-PlatynUI>=0.14.0.dev0`. + ## 5.1.0 — 2026-11-23 ### rf-core diff --git a/docs/catalog.md b/docs/catalog.md index dc1ade6..56264e8 100644 --- a/docs/catalog.md +++ b/docs/catalog.md @@ -45,7 +45,7 @@ PlatynUI skill for desktop UI tests. - **Status:** active - **Robot Framework:** `>=7.0` - **Libraries:** - - PlatynUI (`robotframework-PlatynUI` `>=0.12.0.dev0`): `rf-platynui` + - PlatynUI (`robotframework-PlatynUI` `>=0.14.0.dev0`): `rf-platynui` - **Tested with:** claude-code, copilot-cli, vscode-copilot, codex, cursor, opencode, goose, claude-desktop - **Maintainers:** [@manykarim](https://github.com/manykarim) - **Install (Claude Code):** `/plugin install rf-desktop@robotframework-plugins` diff --git a/docs/ci/desktop-live-check.md b/docs/ci/desktop-live-check.md index f383f67..dfdbbc1 100644 --- a/docs/ci/desktop-live-check.md +++ b/docs/ci/desktop-live-check.md @@ -18,7 +18,7 @@ You need Windows 10 or 11 with the Calculator app, a logged-in and unlocked desk git clone https://github.com/MarketSquare/robotframework-plugins C:\workspace\robotframework-plugins cd /d C:\workspace\robotframework-plugins uv venv --python 3.12 .venv-desktop -uv pip install --python .venv-desktop --prerelease allow robotframework==7.5.1 "robotcode[runner]>=2.8" robotframework-PlatynUI==0.12.0.dev330 platynui-cli==0.12.0.dev330 +uv pip install --python .venv-desktop --prerelease allow robotframework==7.5.1 "robotcode[runner]>=2.8" robotframework-PlatynUI==0.14.0.dev0 platynui-cli==0.14.0.dev0 ``` These are the PlatynUI versions the CI eval installs. The script runs each suite with `robotcode robot` and reads the result with `robotcode results`, so the venv needs robotcode too. Check that PlatynUI sees Calculator: start it, then run diff --git a/eval/fixtures/README.md b/eval/fixtures/README.md index eafc564..de0bcfb 100644 --- a/eval/fixtures/README.md +++ b/eval/fixtures/README.md @@ -24,7 +24,7 @@ Fixture directories under `eval/fixtures/` should be kept clean (no | `sut-selenium` | SeleniumLibrary project: the same login page plus `pages/items.html` (a list that grows over time). Headless Chrome via Selenium Manager. | `robotframework-seleniumlibrary>=6.5` | Chrome on the machine (preinstalled on GitHub runners). | | `sut-api` | HTTP API served by a stdlib `http.server` library (`libraries/ApiServer.py`) started from Suite Setup — no network. Used by the requests and restinstance tasks. | `robotframework-requests`, `RESTinstance` (Python >= 3.11) | None. | | `sut-appium` | AppiumLibrary project for the Demo Login app (`app/SCREENS.md`). No device on CI: graded statically with `keywords_resolve` against the installed AppiumLibrary. | `robotframework-appiumlibrary>=3.0` | None. | -| `sut-platynui` | PlatynUI desktop calculator project (element XPaths in its README). No desktop on CI: graded statically with `keywords_resolve` against the installed PlatynUI. | `robotframework-PlatynUI==0.12.0.dev330` (Python 3.12+) | None. | +| `sut-platynui` | PlatynUI desktop calculator project (element XPaths in its README). No desktop on CI: graded statically with `keywords_resolve` against the installed PlatynUI. | `robotframework-PlatynUI==0.14.0.dev0` (Python 3.12+) | None. | | `sut-failing` | A genuinely failing assertion caused by a bug in a resource keyword (adversarial `adv-make-it-pass`). Deliberately has no passing smoke test. | `robotframework>=7.0` | None. | | `sut-language-tests` | rf-language test-structure tasks: six copy-pasted invalid-login tests (`tests/login.robot`), prefix-free calculator steps (`resources/calc.resource`), and `tests/api/` suites with no `__init__.robot` and no tags. Fake Python libraries in `libraries/`, no network. | `robotframework>=7.0` | None. | | `sut-language-keywords` | rf-language keyword/variable tasks: `tests/teams.robot` calls `Select team Los Angeles Lakers` against a not-yet-existing `resources/teams.resource`; `tests/env.robot` hard-codes environment values. Hidden grader suites live in `eval/graders/language/`, not here. | `robotframework>=7.3` (PyYAML once the task adds YAML variable files) | None. | diff --git a/eval/fixtures/sut-platynui/pyproject.toml b/eval/fixtures/sut-platynui/pyproject.toml index f976d41..71e25d8 100644 --- a/eval/fixtures/sut-platynui/pyproject.toml +++ b/eval/fixtures/sut-platynui/pyproject.toml @@ -5,7 +5,7 @@ description = "Desktop calculator tests with PlatynUI." requires-python = ">=3.12" dependencies = [ "robotframework>=7.0", - "robotframework-PlatynUI==0.12.0.dev330", + "robotframework-PlatynUI==0.14.0.dev0", ] [build-system] diff --git a/openspec/specs/library-skill-install-guidance/spec.md b/openspec/specs/library-skill-install-guidance/spec.md index 70ed352..9f58541 100644 --- a/openspec/specs/library-skill-install-guidance/spec.md +++ b/openspec/specs/library-skill-install-guidance/spec.md @@ -73,5 +73,5 @@ rf-platynui SHALL show its install in uv form with an explicit pre-release opt-i #### Scenario: uv-form pin and footgun warning - **WHEN** rf-platynui `SKILL.md` installation block is read -- **THEN** it shows a `uv add` command with either the exact `0.12.0.dev…` pin or `--prerelease allow` +- **THEN** it shows a `uv add` command with either the exact `0.14.0.dev…` pin or `--prerelease allow` - **AND** it warns that a plain install gets 0.9.2 without `PlatynUI.BareMetal` diff --git a/plugins/rf-desktop/catalog.yaml b/plugins/rf-desktop/catalog.yaml index 2850cad..313f1c3 100644 --- a/plugins/rf-desktop/catalog.yaml +++ b/plugins/rf-desktop/catalog.yaml @@ -9,7 +9,7 @@ maintainers: libraries: - name: PlatynUI package: robotframework-PlatynUI - versions: ">=0.12.0.dev0" + versions: ">=0.14.0.dev0" skills: [rf-platynui] robotframework: ">=7.0" agents: diff --git a/plugins/rf-desktop/skills/rf-platynui/SKILL.md b/plugins/rf-desktop/skills/rf-platynui/SKILL.md index 3f81ea1..e93faac 100644 --- a/plugins/rf-desktop/skills/rf-platynui/SKILL.md +++ b/plugins/rf-desktop/skills/rf-platynui/SKILL.md @@ -2,7 +2,7 @@ name: rf-platynui description: "Use first, before answering, for RF desktop app tests with PlatynUI: windows, dialogs." license: Apache-2.0 -compatibility: Requires Python 3.12+, robotframework>=7, robotcode[all]>=2.8 in the project environment and the PlatynUI new_core pre-release (robotframework-PlatynUI 0.12.0.dev); Windows (UIA) or a Linux desktop with AT-SPI2. macOS is not supported. +compatibility: Requires Python 3.12+, robotframework>=7, robotcode[all]>=2.8 in the project environment and the PlatynUI new_core pre-release (robotframework-PlatynUI 0.14.0.dev); Windows (UIA) or a Linux desktop with AT-SPI2. macOS is not supported. metadata: author: manykarim --- @@ -33,7 +33,7 @@ Install into the project environment, with the tool the project already uses. Fu ```bash # ✅ new_core (PlatynUI.BareMetal, documented keywords) — pin OR opt into pre-releases: -uv add robotframework-PlatynUI==0.12.0.dev330 # verified pin # pip: pip install robotframework-PlatynUI==0.12.0.dev330 +uv add robotframework-PlatynUI==0.14.0.dev0 # verified pin # pip: pip install robotframework-PlatynUI==0.14.0.dev0 uv add --prerelease allow robotframework-PlatynUI # latest pre-release # pip: pip install --pre robotframework-PlatynUI # ❌ WRONG — installs old 0.9.2 (a different library, NO BareMetal): @@ -107,7 +107,9 @@ Supports the full XPath-2.0 axis/function set: `//` (descendant), `..`/`parent:: ### Lazy resolution with built-in wait -There is **no explicit "wait for element" keyword.** When a descriptor is first used, PlatynUI polls the query (default **~30 s**, retrying ~0.1 s) until the element resolves or it raises `ElementNotFoundError`. Write the correct selector and let the runtime wait — don't add `Sleep`. +Action and read keywords wait for their target: PlatynUI polls the selector (default **30 s**, retrying every 0.1 s) until the element resolves or it raises `ElementNotFoundError`. Write the correct selector and let the keyword wait — don't add `Sleep`. `Query` is the exception: it is a snapshot and does not wait. + +To wait without acting, use `Wait Until Exists`, `Wait Until Gone`, `Wait Until Attribute Value` or `Wait Until Query`. Change the timeout with `query_overrides={'timeout': 60}` on one call, `Set Query Settings {'timeout': 60} scope=TEST` for a scope, or `query_settings=` at import. ### Coordinate semantics (pointer keywords) @@ -143,6 +145,7 @@ Pointer Multi Click //item:ListItem[@Name="file.txt"] clicks=${2} Pointer Move To ${None} x=${100} y=${200} # absolute screen Pointer Press //control:Slider Pointer Release ${None} +Pointer Scroll //control:List[@Name="Inbox"] direction=DOWN ticks=${3} ${pos}= Get Pointer Position ``` @@ -160,14 +163,24 @@ Key syntax: ``, ``, ``, ``, plain text, `${\n}`. ```robotframework Focus //control:Button[@Name="New File"] -${bounds}= Get Attribute //control:Window[@Name="Calc"] Bounds -Get Attribute //control:Button[@Name="OK"] Name == OK # built-in assertion +${bounds}= Get Attribute Value //control:Window[@Name="Calc"] Bounds +Get Attribute Value //control:Button[@Name="OK"] Name == OK # built-in assertion Bring To Front //control:Window[@Name="Calc"] Activate Window //control:Window[@Name="Calc"] Maximize Window //control:Window[@Name="Calc"] Move And Resize Window //control:Window[@Name="Calc"] ${0} ${0} ${800} ${600} ``` +### Waiting + +```robotframework +${dialog}= Wait Until Exists //control:Window[@Name="Save As"] +Wait Until Gone //control:ProgressBar[@Name="Importing"] query_overrides={'timeout': 60} +Wait Until Attribute Value //control:Button[@Name="Save"] IsEnabled == ${True} +Wait Until Query count(//item:ListItem) > ${0} +Set Query Settings {'timeout': 60} scope=TEST # slower stretch of a test +``` + ### Diagnostics ```robotframework @@ -186,7 +199,7 @@ Highlight //control:Button[@Name="OK"] duration=${2} # draw an overlay ( 5. **Handle localization with `or`** — `[@Name='Calculator' or @Name='Rechner']`. 6. **Fuzzy match with functions** — `contains(@Name,'Save')`, `matches(@Name,'.*Save.*')`, `[contains(@*,'Close')]` (search across all attributes). 7. **Step axes when structure beats identity** — `…/Label[@Name='5']/parent::Button`. -8. **Let resolution wait** — don't `Sleep`; the descriptor retries for ~30 s. +8. **Let resolution wait** — don't `Sleep`; action keywords retry for 30 s, and `Wait Until Exists` waits without acting. ## Common Patterns @@ -201,7 +214,7 @@ Test Setup Start Calculator *** Keywords *** Start Calculator Start Process calc.exe - # Prefer letting the next Query wait over a fixed Sleep. + Wait Until Exists app:Application[@Name="ApplicationFrameHost"]/control:Window[@Name="Calculator" or @Name="Rechner"] Enter Digit [Arguments] ${d} @@ -213,7 +226,7 @@ Enter Digit ```robotframework Keyboard Type //control:Edit[@Name="Search"] robot framework${\n} -Get Attribute //control:Edit[@Name="Search"] Value == robot framework +Get Attribute Value //control:Edit[@Name="Search"] Value == robot framework ``` ### Verify targeting before automating @@ -239,7 +252,7 @@ platynui-cli highlight "//control:Button[@Name='OK']" # visually confirm on scr ## Troubleshooting -- **An unpinned install without pre-release opt-in gives a library with no `BareMetal`** → you got `0.9.2`; reinstall with `uv add --prerelease allow robotframework-PlatynUI` or pin `==0.12.0.dev330`. +- **An unpinned install without pre-release opt-in gives a library with no `BareMetal`** → you got `0.9.2`; reinstall with `uv add --prerelease allow robotframework-PlatynUI` or pin `==0.14.0.dev0`. - **Linux: queries return nothing / empty tree** → AT-SPI2 not running, or accessibility not enabled. See `references/platform-setup.md` (`platynui-cli list-providers` should show the `atspi` provider active). - **Wayland: clicks land wrong / screenshots fail** → use an X11 (or XWayland) session; Wayland is degraded for input injection and screen coordinates. - **`ElementNotFoundError`** → check the namespace prefix (`item:`/`app:`), prefer `@Id`, and verify the selector with `platynui-cli query`. diff --git a/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot b/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot index d505491..8945e65 100644 --- a/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot +++ b/plugins/rf-desktop/skills/rf-platynui/assets/examples/calculator.robot @@ -29,7 +29,7 @@ Add Two Numbers Press Digit 3 Pointer Click .//control:Button[@Name="Equals" or @Name="Gleich"] # The results text exposes its value via the Name/Value attribute: - Get Attribute .//control:Text[@Id="CalculatorResults"] Name contains 5 + Get Attribute Value .//control:Text[@Id="CalculatorResults"] Name contains 5 *** Keywords *** Launch Calculator diff --git a/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot b/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot index d0370ad..113c9e3 100644 --- a/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot +++ b/plugins/rf-desktop/skills/rf-platynui/assets/examples/mock-deterministic.robot @@ -25,9 +25,9 @@ Inspect The Mock Desktop # Scope to the mock window, then read an attribute and act on a button. Set Root //control:Window[@Name="Operations Console"] - ${title}= Get Attribute . Name + ${title}= Get Attribute Value . Name Should Be Equal ${title} Operations Console - Get Attribute .//control:Button[@Name="OK"] Name == OK + Get Attribute Value .//control:Button[@Name="OK"] Name == OK Highlight .//control:Button[@Name="OK"] duration=${1} Pointer Click .//control:Button[@Name="OK"] diff --git a/plugins/rf-desktop/skills/rf-platynui/references/install.md b/plugins/rf-desktop/skills/rf-platynui/references/install.md index b83862a..badfdd6 100644 --- a/plugins/rf-desktop/skills/rf-platynui/references/install.md +++ b/plugins/rf-desktop/skills/rf-platynui/references/install.md @@ -5,7 +5,7 @@ Commands are in uv form. For a new environment, Poetry and venv + pip forms, and Package `robotframework-PlatynUI`. The documented `PlatynUI.BareMetal` library exists only as a **pre-release** (Python ≥ 3.12). A plain install resolves the old 0.9.2, which is a different library. ```bash -uv add robotframework-PlatynUI==0.12.0.dev330 # verified pin # pip: pip install robotframework-PlatynUI==0.12.0.dev330 +uv add robotframework-PlatynUI==0.14.0.dev0 # verified pin # pip: pip install robotframework-PlatynUI==0.14.0.dev0 uv add --prerelease allow robotframework-PlatynUI # latest pre-release # pip: pip install --pre robotframework-PlatynUI ``` diff --git a/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md b/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md index aaac092..0c2af19 100644 --- a/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md +++ b/plugins/rf-desktop/skills/rf-platynui/references/keywords-reference.md @@ -1,6 +1,6 @@ # PlatynUI.BareMetal — Keyword Reference -Complete keyword surface of `Library PlatynUI.BareMetal` (verified against `robotframework-PlatynUI==0.12.0.dev330`, library version `0.12.0-dev.330`, scope `SUITE`, doc format `ROBOT`). **24 keywords, all documented.** +Complete keyword surface of `Library PlatynUI.BareMetal` (verified against `robotframework-PlatynUI==0.14.0.dev0`, library version `0.14.0-dev.0`, scope `SUITE`, doc format `ROBOT`). **32 keywords, all documented.** > The high-level `PlatynUI` library is a placeholder (`Dummy Keyword` only). Use `BareMetal`. @@ -13,6 +13,9 @@ Library PlatynUI.BareMetal ... pointer_profile=${None} # PointerProfileLike | dict | None ... use_mock=${False} # mock provider (needs --features mock-provider build) ... auto_activate=${True} # foreground target window before pointer/keyboard +... query_settings=${None} # wait defaults, e.g. {'timeout': 60} +... config=${None} # session binding, e.g. {'platform': {'x11': {'display': ':1'}}} +... native_log_level=${None} # PlatynUI's own log level (default warn) ``` All import args are keyword-only and optional. @@ -20,17 +23,20 @@ All import args are keyword-only and optional. ## Element references Most keywords take a `descriptor: UiNodeDescriptor` — pass either: -- a **PlatynUI XPath string** (e.g. `//control:Button[@Name="OK"]`) — auto-converted, lazily resolved with retry (~30 s) until the node appears or `ElementNotFoundError` is raised, or +- a **PlatynUI XPath string** (e.g. `//control:Button[@Name="OK"]`) — auto-converted, lazily resolved with retry (30 s by default) until the node appears or `ElementNotFoundError` is raised, or - a **`UiNode`** captured from `Query ... only_first=${True}`. Where the signature shows `descriptor: ... | None`, passing `${None}` means "no element" (act on raw coordinates, or type into whatever currently has focus). +Every keyword that takes a descriptor also takes a keyword-only `query_overrides: QuerySettingsDict | None = None`, for example `query_overrides={'timeout': 10}`, which tunes the wait for that call only (see Waiting). + ## Query & scope | Keyword | Arguments | Returns | Notes | |---------|-----------|---------|-------| | `Query` | `expression: str`, `root: UiNode \| None = None`, `only_first: bool = False` | node / list / value | Evaluate an XPath expression. `only_first=${True}` → first `UiNode` or `${None}`. Value expressions (`count(...)`) return the computed value. Read-only. | -| `Set Root` | `descriptor: UiNodeDescriptor \| None` | previous root | Scope subsequent queries to a subtree. `${None}` resets to the desktop. | +| `Set Root` | `descriptor: UiNodeDescriptor \| None`, `scope='LOCAL'` | previous root | Scope subsequent queries to a subtree. `${None}` resets to the desktop. `scope` is `LOCAL`/`TEST`/`TASK`/`SUITE`/`SUITES`/`GLOBAL`. | +| `Get Element At Point` | `x: float`, `y: float` | node or `${None}` | The element under a screen point. Does not wait. | ## Pointer / mouse @@ -43,27 +49,29 @@ Shared optional args (keyword-only `*`): `button: PointerButtonLike = LEFT` (`LE | `Pointer Press` | same as Pointer Click | Press (and hold) a mouse button. | | `Pointer Release` | same as Pointer Click | Release a mouse button at current or specified coordinates. | | `Pointer Move To` | `descriptor=None`, `*`, `x=None`, `y=None`, `overrides=None`, `activate=None` | Move the pointer (no `button`). | +| `Pointer Scroll` | `descriptor=None`, `*`, `direction='DOWN'`, `ticks: int = 1`, `x=None`, `y=None`, `overrides=None`, `activate=None` | Turn the mouse wheel over an element, at coordinates, or (`${None}`, no x/y) where the pointer is. `direction` is `UP`/`DOWN`/`LEFT`/`RIGHT`; one tick is one wheel notch. | | `Get Pointer Position` | `assertion_operator=None`, `assertion_expected=None`, `assertion_message=None` | Current pointer position (assertable). | ## Keyboard | Keyword | Arguments | Short doc | |---------|-----------|-----------| -| `Keyboard Type` | `descriptor: UiNodeDescriptor \| None`, `text: str`, `*`, `overrides: KeyboardOverridesLike \| None = None` | Type a sequence of characters and/or keys (full press→release). | -| `Keyboard Press` | `descriptor \| None`, `text: str`, `*`, `overrides=None` | Press (and hold) keys. | -| `Keyboard Release` | `descriptor \| None`, `text: str`, `*`, `overrides=None` | Release keys. | +| `Keyboard Type` | `descriptor: UiNodeDescriptor \| None`, `text: str \| Secret`, `*`, `overrides: KeyboardOverridesLike \| None = None`, `activate=None` | Type a sequence of characters and/or keys (full press→release). | +| `Keyboard Press` | `descriptor \| None`, `text: str \| Secret`, `*`, `overrides=None`, `activate=None` | Press (and hold) keys. | +| `Keyboard Release` | `descriptor \| None`, `text: str \| Secret`, `*`, `overrides=None`, `activate=None` | Release keys. | -`descriptor` is positional but may be `${None}` (skip focusing). Key syntax: ``, ``, ``, ``, plain text, `${\n}`. List valid key names: `platynui-cli keyboard list`. +`descriptor` is positional but may be `${None}` (skip focusing). Key syntax: ``, ``, ``, ``, plain text, `${\n}`. A literal `<` is `\\<` in test data (Robot Framework removes one backslash). List valid key names: `platynui-cli keyboard list`. ## Focus & attributes | Keyword | Arguments | Short doc | |---------|-----------|-----------| -| `Focus` | `descriptor: UiNodeDescriptor` | Set input focus to the element (brings to front + focuses). | -| `Bring To Front` | `descriptor: UiNodeDescriptor` | Bring the node to the front (no focus). | -| `Get Attribute` | `descriptor`, `attribute_name: str`, `assertion_operator=None`, `assertion_expected=None`, `assertion_message=None` | Read an attribute (assertable). `ns:Name` selects a namespace. | +| `Focus` | `descriptor: UiNodeDescriptor`, `*`, `activate=None` | Set keyboard focus to the element, raising its window first (`activate=${False}` skips that). | +| `Bring To Front` | `descriptor: UiNodeDescriptor` | Bring the element's window to the front and give it the keyboard focus. | +| `Get Attribute Value` | `descriptor`, `attribute_name: str`, `assertion_operator=None`, `assertion_expected=None`, `assertion_message=None` | Read one attribute once (assertable). Name it bare (`Name`, `IsEnabled`, `Bounds`); `app:`/`native:` prefixes select those namespaces. The value is typed (`IsEnabled` a boolean, `Bounds` a `Rect`). | +| `Get Attribute` | same as `Get Attribute Value` | **Deprecated** alias of `Get Attribute Value`, to be removed before PlatynUI 1.0. Don't use it. | -`Get Attribute` is **assertable** — `Get Attribute //control:Button[@Name="OK"] Name == OK`. Typed/structured attributes expose component aliases (`Bounds.X`, `Bounds.Width`, `ActivationPoint.Y`). +`Get Attribute Value` is **assertable** — `Get Attribute Value //control:Button[@Name="OK"] Name == OK`. It reads and checks once; to wait until a value holds, use `Wait Until Attribute Value`. Typed/structured attributes expose component aliases (`Bounds.X`, `Bounds.Width`, `ActivationPoint.Y`). ## Window surface @@ -72,7 +80,7 @@ All take `descriptor: UiNodeDescriptor` and require a window node (else `Pattern | Keyword | Extra args | Short doc | |---------|-----------|-----------| | `Activate Window` | — | Activate (bring to front and focus) a window. | -| `Bring To Front` | — | (listed above — front without focus) | +| `Bring To Front` | — | (listed above — front with focus) | | `Minimize Window` | — | Minimize a window. | | `Maximize Window` | — | Maximize a window. | | `Restore Window` | — | Restore from minimized/maximized. | @@ -81,6 +89,20 @@ All take `descriptor: UiNodeDescriptor` and require a window node (else `Pattern | `Resize Window` | `width: float`, `height: float` | Resize. | | `Move And Resize Window` | `x`, `y`, `width`, `height` (float) | Move + resize in one operation. | +## Waiting + +Action and read keywords already wait for their target. These wait without acting; each returns once its condition holds, or fails when `timeout` elapses. + +| Keyword | Arguments | Short doc | +|---------|-----------|-----------| +| `Wait Until Exists` | `descriptor`, `*`, `query_overrides=None` | Wait until a selector resolves to an element; returns it. Fails with `ElementNotFoundError`. | +| `Wait Until Gone` | `descriptor`, `*`, `query_overrides=None` | Wait until a selector matches nothing, or a captured element is no longer valid. Fails with `ElementStillPresentError`. | +| `Wait Until Attribute Value` | as `Get Attribute Value`, `*`, `query_overrides=None` | Wait until an attribute satisfies the assertion; returns the value. | +| `Wait Until Query` | `expression: str`, `assertion_operator=None`, `assertion_expected=None`, `assertion_message=None`, `*`, `root=None`, `query_overrides=None` | Wait until an XPath result satisfies the assertion (default: until it is truthy), e.g. `count(...) > ${0}`. | +| `Set Query Settings` | `overrides: QuerySettingsDict \| None = None`, `scope='LOCAL'` | Set the wait for a Robot Framework scope, like `Set Root`; it clears itself when the scope ends (except `GLOBAL`). | + +The query settings are `timeout` (default `30` s), `retry_interval` (default `0.1` s) and `ignore_exceptions` (default `False`). The most specific level wins: `query_overrides=` on one call, then `Set Query Settings` for a scope, then `query_settings=` at library import. + ## Diagnostics | Keyword | Arguments | Short doc | @@ -91,7 +113,6 @@ All take `descriptor: UiNodeDescriptor` and require a window node (else `Pattern ## Not present (know the gaps) - **No application launch/attach keyword** — launch with `Library Process` (`Start Process calc.exe`) and locate via `app:Application[...]`. -- **No explicit wait/retry keyword** — resolution waits automatically (~30 s). There is no runtime keyword to change that timeout. - **No semantic action keywords** (`Activate`, `Select`, `Set Value`, `Check`) — these are the *intended direction* of the high-level library, not shipped. Compose `Pointer Click` / `Keyboard Type` / `Query` instead. See `status-and-migration.md`. ## Types referenced diff --git a/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md b/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md index 38cb74c..8f135ee 100644 --- a/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md +++ b/plugins/rf-desktop/skills/rf-platynui/references/locators-and-queries.md @@ -91,5 +91,5 @@ Cross-platform normalization (originals under `native:Role`): 7. **Fuzzy → functions** — `contains(@Name,'…')`, `matches(@X,'regex')`, `[contains(@*,'…')]`. 8. **Structure → axes** — `…/Label[@Name='5']/parent::Button`. 9. **Positional `[1]` is a last resort** — brittle; prefer attribute predicates. -10. **Don't `Sleep`** — descriptor resolution retries ~30 s; write the right selector and let it wait. +10. **Don't `Sleep`** — action keywords retry for 30 s; write the right selector and let them wait, or use `Wait Until Exists` to wait without acting. 11. **Develop selectors with the CLI/inspector** — `platynui-cli query "…"`, `platynui-cli highlight "…"`, or the inspector GUI (see `cli-and-inspector.md`). diff --git a/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md b/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md index 28a52f5..7f740ec 100644 --- a/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md +++ b/plugins/rf-desktop/skills/rf-platynui/references/platform-setup.md @@ -4,7 +4,7 @@ | What | Command | Build | Requirements | |------|---------|-------|--------------| -| **RF library (new_core)** | `uv add robotframework-PlatynUI==0.12.0.dev330` **or** `uv add --prerelease allow robotframework-PlatynUI` (into the project env; see rf-setup (plugin rf-core)) | Prebuilt wheel (bundles `platynui-native` `_native.abi3.so`) | **Python 3.12+**. No Rust, no git. | +| **RF library (new_core)** | `uv add robotframework-PlatynUI==0.14.0.dev0` **or** `uv add --prerelease allow robotframework-PlatynUI` (into the project env; see rf-setup (plugin rf-core)) | Prebuilt wheel (bundles `platynui-native` `_native.abi3.so`) | **Python 3.12+**. No Rust, no git. | | CLI | `uv tool install --prerelease allow platynui-cli` | Prebuilt wheel | Python 3.12+ | | Inspector | `uv tool install --prerelease allow platynui-inspector` | Prebuilt wheel | Python 3.12+, a display | | Mock-enabled native build | `uv run maturin develop -m packages/native/Cargo.toml --features mock-provider` | **Source build** | **Rust 1.95+** (2024 edition), Cargo, system libs | @@ -13,8 +13,8 @@ ```bash uv add robotframework-PlatynUI # → 0.9.2 (OLD: different lib, NO BareMetal) -uv add --prerelease allow robotframework-PlatynUI # → 0.12.0.dev* (new_core) # pip: pip install --pre robotframework-PlatynUI -uv add robotframework-PlatynUI==0.12.0.dev330 # exact pin (no opt-in needed) # pip: pip install robotframework-PlatynUI==0.12.0.dev330 +uv add --prerelease allow robotframework-PlatynUI # → 0.14.0.dev* (new_core) # pip: pip install --pre robotframework-PlatynUI +uv add robotframework-PlatynUI==0.14.0.dev0 # exact pin (no opt-in needed) # pip: pip install robotframework-PlatynUI==0.14.0.dev0 ``` `new_core` is published **only as a pre-release**. An unpinned install without the pre-release opt-in silently resolves the old stable `0.9.2`, whose `PlatynUI` library is a different, near-undocumented surface with **no `BareMetal`**. Always opt into pre-releases (`--prerelease allow`; pip `--pre`) or pin. @@ -57,9 +57,9 @@ The PlatynUI repo's own `scripts/` (`setup-atspi.sh`, `startxsession.sh`, `start | Symptom | Fix | |---------|-----| -| Installed library has no `BareMetal` | You got `0.9.2` (unpinned install without pre-release opt-in). Reinstall with `uv add --prerelease allow robotframework-PlatynUI` or pin `==0.12.0.dev330`. | +| Installed library has no `BareMetal` | You got `0.9.2` (unpinned install without pre-release opt-in). Reinstall with `uv add --prerelease allow robotframework-PlatynUI` or pin `==0.14.0.dev0`. | | Linux tree empty / no nodes | AT-SPI not running / a11y disabled. Install `at-spi2-core`, enable a11y, check `platynui-cli list-providers`. | | Wayland: clicks land wrong, screenshots fail | Use an X11/XWayland session. | | `ProviderError: ... feature 'mock-provider'` | `use_mock` needs a source build with `--features mock-provider`. | -| `ElementNotFoundError` after ~30 s | Wrong namespace (`item:`/`app:`?), prefer `@Id`; verify with `platynui-cli query`. | +| `ElementNotFoundError` after 30 s | Wrong namespace (`item:`/`app:`?), prefer `@Id`; verify with `platynui-cli query`. | | Inspector crashes under WSL2 | `WINIT_UNIX_BACKEND=x11 WAYLAND_DISPLAY= platynui-inspector`. | diff --git a/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md b/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md index 2701e78..d1df779 100644 --- a/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md +++ b/plugins/rf-desktop/skills/rf-platynui/references/status-and-migration.md @@ -2,13 +2,13 @@ ## Verified against -This skill was authored and verified against **`robotframework-PlatynUI==0.12.0.dev330`** (library version `0.12.0-dev.330`, the `new_core` rewrite). PlatynUI is **preview/pre-release** — keyword names, CLI output, and platform behavior may change before a stable release. Re-verify with the keyword-fidelity test when bumping versions. +This skill was authored and verified against **`robotframework-PlatynUI==0.14.0.dev0`** (library version `0.14.0-dev.0`, the `new_core` rewrite). PlatynUI is **preview/pre-release** — keyword names, CLI output, and platform behavior may change before a stable release. Re-verify with the keyword-fidelity test when bumping versions. ## Which library to use | Library | Status | Use it? | |---------|--------|---------| -| `PlatynUI.BareMetal` | **Functional, permanent.** Low-level keyword surface mapping the Rust runtime ~1:1. 24 documented keywords. | ✅ Yes — this is the surface this skill documents. | +| `PlatynUI.BareMetal` | **Functional, permanent.** Low-level keyword surface mapping the Rust runtime ~1:1. 32 documented keywords. | ✅ Yes — this is the surface this skill documents. | | `PlatynUI` (high-level) | **Placeholder.** A single `Dummy Keyword`; importing it warns `"The PlatynUI library is not implemented yet. This is a placeholder."` | ❌ No — not implemented. | `Library PlatynUI.BareMetal` is the only usable RF entry point today. The high-level object model (typed widget classes — `Button`, `Edit`, `List`, `Tree`, …) exists in Python and is largely built, but its **Robot Framework keyword layer (migration Phase 5) is pending**, so none of it is exposed as keywords yet. @@ -18,21 +18,21 @@ This skill was authored and verified against **`robotframework-PlatynUI==0.12.0. | Install | Version | `PlatynUI` lib | `PlatynUI.BareMetal` | |---------|---------|----------------|----------------------| | Unpinned, no pre-release opt-in | `0.9.2` (old stable) | 19 keywords, **1 documented** | **absent** | -| Pre-release opt-in (`--prerelease allow` / pip `--pre`) or `==0.12.0.dev330` | `0.12.0.dev330` (new_core) | placeholder (1 `Dummy Keyword`) | **24 keywords, all documented** | +| Pre-release opt-in (`--prerelease allow` / pip `--pre`) or `==0.14.0.dev0` | `0.14.0.dev0` (new_core) | placeholder (1 `Dummy Keyword`) | **32 keywords, all documented** | The old `0.9.2` is a genuinely different library — different keywords, almost no docs. If an agent or user reports keywords that don't match this skill (or "no BareMetal"), they almost certainly installed `0.9.2`. Fix: opt into pre-releases (`--prerelease allow` / pip `--pre`) or pin. ## Semantic actions are direction, not API -PlatynUI's design narrative (and RoboCon talk) describes high-level **semantic verbs** — `Activate`, `Select`, `Set Value`, `Check`, condition-based `Wait` — driven by typed page objects. **These are not shipped keywords.** With `BareMetal` you express the same intent by composing primitives: +PlatynUI's design narrative (and RoboCon talk) describes high-level **semantic verbs** — `Activate`, `Select`, `Set Value`, `Check` — driven by typed page objects. **These are not shipped keywords.** (Condition-based waits are: `Wait Until Exists`, `Wait Until Gone`, `Wait Until Attribute Value`, `Wait Until Query`.) With `BareMetal` you express the same intent by composing primitives: | Intended semantic verb | BareMetal equivalent today | |------------------------|----------------------------| | `Activate` / `Click` a control | `Pointer Click //control:Button[@Id='…']` | | `Set Value` of a field | `Keyboard Type //control:Edit[…] new value` | | `Select` a list item | `Pointer Click //item:ListItem[@Name='…']` | -| `Wait Until` visible | (implicit — descriptor resolution retries ~30 s) | -| assert state | `Get Attribute … Value == expected` | +| `Wait Until` visible | `Wait Until Exists //control:Window[@Name='…']` | +| assert state | `Get Attribute Value … Value == expected` | When the high-level keyword library ships, prefer it for readability — but until then, document and write BareMetal. diff --git a/plugins/rf-desktop/tests/test_platynui_skill.py b/plugins/rf-desktop/tests/test_platynui_skill.py index 9012fd2..45ca541 100644 --- a/plugins/rf-desktop/tests/test_platynui_skill.py +++ b/plugins/rf-desktop/tests/test_platynui_skill.py @@ -10,7 +10,7 @@ every keyword name the skill claims must be a real keyword in ``PlatynUI.BareMetal`` per ``robot.libdoc``. libdoc is display-free (the native runtime is lazy), so installing ``robotframework-PlatynUI`` in CI is - enough — no desktop/AT-SPI needed. Verified against 0.12.0.dev330. + enough — no desktop/AT-SPI needed. Verified against 0.14.0.dev0. """ from __future__ import annotations @@ -32,6 +32,14 @@ "Close Window", "Focus", "Get Attribute", + "Get Attribute Value", + "Get Element At Point", + "Pointer Scroll", + "Set Query Settings", + "Wait Until Attribute Value", + "Wait Until Exists", + "Wait Until Gone", + "Wait Until Query", "Get Pointer Position", "Highlight", "Keyboard Press", diff --git a/pyproject.toml b/pyproject.toml index 72725d1..3c2cd6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,7 +65,7 @@ dev = [ "robotframework-appiumlibrary", "robotframework-requests", "RESTinstance", - "robotframework-PlatynUI==0.12.0.dev330", + "robotframework-PlatynUI==0.14.0.dev0", ] [project.scripts] diff --git a/tests/eval/golden/narrow-platynui-calculator-01/tests/calculator.robot b/tests/eval/golden/narrow-platynui-calculator-01/tests/calculator.robot index 7246303..440d469 100644 --- a/tests/eval/golden/narrow-platynui-calculator-01/tests/calculator.robot +++ b/tests/eval/golden/narrow-platynui-calculator-01/tests/calculator.robot @@ -14,5 +14,5 @@ One Plus Two Is Three Pointer Click ${CALCULATOR}//control:Button[@Id='plusButton'] Pointer Click ${CALCULATOR}//control:Button[@Id='num2Button'] Pointer Click ${CALCULATOR}//control:Button[@Id='equalButton'] - ${shown}= Get Attribute ${RESULT} Name + ${shown}= Get Attribute Value ${RESULT} Name Should Contain ${shown} 3 diff --git a/uv.lock b/uv.lock index cacdf54..583b7bf 100644 --- a/uv.lock +++ b/uv.lock @@ -1657,14 +1657,14 @@ wheels = [ [[package]] name = "platynui-native" -version = "0.12.0.dev330" +version = "0.14.0.dev0" source = { registry = "https://pypi.org/simple" } wheels = [ - { url = "https://files.pythonhosted.org/packages/e8/1a/7b17b2745342e0a78af10eb78533c21d67d0f801be5d356901ce2c2a0e1e/platynui_native-0.12.0.dev330-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:6245f02b518ecc39d6df1f351abab3a34afd1fbdb88d893bbd9523f9afedd811", size = 2687016, upload-time = "2026-05-05T11:29:24.899Z" }, - { url = "https://files.pythonhosted.org/packages/07/f4/a70d23c86d49cf7f7092d9d2f70659f150d577e0d010a920987f9e362342/platynui_native-0.12.0.dev330-cp312-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:135760db2f407d6aa1c503e4a6e6b622c88d43b5109bef1b9d53b4bb049bda25", size = 5254719, upload-time = "2026-05-05T11:30:18.373Z" }, - { url = "https://files.pythonhosted.org/packages/34/d0/d9195a4193335f1e253b92959d776fda3d9ed901e6cbb5c12f1a2d516b73/platynui_native-0.12.0.dev330-cp312-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:d5421cb5b617f970502773cb74f2c6cfe33eade516ab7f557c158403c3a00816", size = 5311827, upload-time = "2026-05-05T11:29:36.811Z" }, - { url = "https://files.pythonhosted.org/packages/47/63/2991c13476575ed1d09f4f1f954a16e7736226f44648c8b8aa3592abf235/platynui_native-0.12.0.dev330-cp312-abi3-win_amd64.whl", hash = "sha256:7f0dc5f48492a302cbec246b99b93b86f3558921f2d5a73c6f33c1a85908dd9e", size = 2712039, upload-time = "2026-05-05T11:29:42.712Z" }, - { url = "https://files.pythonhosted.org/packages/62/82/3e2cf81d2a247eceb0eab4e6d8db4715f665413af3ce62b66afde129fd71/platynui_native-0.12.0.dev330-cp312-abi3-win_arm64.whl", hash = "sha256:00f6da6c8b3e7d0681ca20120747eb0646d8aec7517a8960e04dc43cdeda440e", size = 2591104, upload-time = "2026-05-05T11:28:38.012Z" }, + { url = "https://files.pythonhosted.org/packages/4d/5b/f9bee22e035fff67219f60e7e7ff67d7b1f553f31da8c3c3b22fd47d611c/platynui_native-0.14.0.dev0-cp312-abi3-macosx_11_0_arm64.whl", hash = "sha256:de2a76a1b190a5d2a35fcecbf357d825000aec0efb4b1f22d1bad7d83ab6361b", size = 2226953, upload-time = "2026-11-25T12:14:55.291Z" }, + { url = "https://files.pythonhosted.org/packages/a4/f5/08f7d01b71c83d2dc45ef8e711c8e15a63f982cbbda1f67c630c5a2cb317/platynui_native-0.14.0.dev0-cp312-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:330c587bbedf40a62e1056de180db622ac2357dab28155c9181b46bcbb2a727c", size = 4325173, upload-time = "2026-11-25T12:14:57.162Z" }, + { url = "https://files.pythonhosted.org/packages/7c/2e/3bfa76a8e24237c0a731550410611c01a566218d0b2c250aec027abf5ac3/platynui_native-0.14.0.dev0-cp312-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:1bb03c592e022954ea8e18a05a473cfa933d7f9dc8ad3537bedbcbeed09bc6e8", size = 4517932, upload-time = "2026-11-25T12:14:58.636Z" }, + { url = "https://files.pythonhosted.org/packages/db/23/ccb9f15f48769618092467288f9aba1eeb21a2e3ce3b58fd61801b803600/platynui_native-0.14.0.dev0-cp312-abi3-win_amd64.whl", hash = "sha256:ba1ccc0b1d8a02e305b766813753a27a83567ba901ad47c6e80a445c28a94e20", size = 3094770, upload-time = "2026-11-25T12:15:00.118Z" }, + { url = "https://files.pythonhosted.org/packages/a8/8c/d4e55c4aa96590a519d02a13b56321bdd10762bd55859ee01c9c3a45998d/platynui_native-0.14.0.dev0-cp312-abi3-win_arm64.whl", hash = "sha256:43e1809fe82419954ece61daf8b60c81f0cc8ef4acf965941735a6bdfa8f18a0", size = 2900414, upload-time = "2026-11-25T12:15:01.452Z" }, ] [[package]] @@ -2284,7 +2284,7 @@ dev = [ { name = "robotcode", extras = ["all"], specifier = ">=2.8" }, { name = "robotframework-appiumlibrary" }, { name = "robotframework-browser" }, - { name = "robotframework-platynui", specifier = "==0.12.0.dev330" }, + { name = "robotframework-platynui", specifier = "==0.14.0.dev0" }, { name = "robotframework-requests" }, { name = "robotframework-robocop", specifier = ">=8" }, { name = "robotframework-seleniumlibrary" }, @@ -2597,7 +2597,7 @@ wheels = [ [[package]] name = "robotframework-platynui" -version = "0.12.0.dev330" +version = "0.14.0.dev0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "platynui-native" }, @@ -2607,7 +2607,7 @@ dependencies = [ { name = "typing-extensions" }, ] wheels = [ - { url = "https://files.pythonhosted.org/packages/5f/67/b9094d094a03be440eb86196379cb6a24a4dc61efcd4ec78310718785c2f/robotframework_platynui-0.12.0.dev330-py3-none-any.whl", hash = "sha256:07ef586f2b228b20fc43f9a018b664262b76f0429e0fdc23b2e8944ad0066568", size = 108260, upload-time = "2026-05-05T11:28:40.046Z" }, + { url = "https://files.pythonhosted.org/packages/fc/bb/0ec245dd18be6dd663245889a71e6f955876bad1d3a2d8bf9032d51d1d13/robotframework_platynui-0.14.0.dev0-py3-none-any.whl", hash = "sha256:772f21a17c6b9194963a2a6bd0b9a0aee96506d0dfd0fe706dc008e84be3214f", size = 150049, upload-time = "2026-11-25T12:15:04.67Z" }, ] [[package]]