feat: support more PW API for Get Text#4904
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends the existing Get Text keyword to expose additional Playwright text-retrieval APIs (allInnerTexts, allTextContents, innerText, inputValue, innerHTML) via a new text_type argument, while preserving the original behavior when no text_type is specified. The gRPC contract is updated so GetText returns a ListString (with log) and accepts a new ElementSelectorWithTextType request. Tests are reorganized and expanded, and a <select id="pet-select"> is added to the dynamic test app to exercise the new types. A separate cleanup also renames the highlight sentinel ROBOT_FRAMEWORK_BROWSER_NO_ELEMENT to a shared ROBOT_FRAMEWORK_BROWSER_NO_SET constant.
Changes:
- Add
TextTypeenum andtext_typeoption toGet Text, returning a list forall*types and a string otherwise. - Update proto, Node
getTextserver, and helpers to useListStringresponse and dispatch by text type. - Reorganize acceptance tests, add new
basic_getters_get_text.robot, and add a<select>to the test app.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| protobuf/playwright.proto | New ElementSelectorWithTextType, ListString.log, and updated GetText signature. |
| node/playwright-wrapper/response-util.ts | Adds listStringResponse helper. |
| node/playwright-wrapper/getters.ts | Implements TextType dispatch in getText with per-type Playwright calls. |
| node/playwright-wrapper/interaction.ts | Switches waitForAlerts to listStringResponse. |
| node/playwright-wrapper/evaluation.ts | Renames highlight sentinel to ROBOT_FRAMEWORK_BROWSER_NO_SET. |
| node/playwright-wrapper/tests/getters.test.ts | Adds unit tests for new getText paths. |
| node/playwright-wrapper/tests/evaluation.test.ts | Updates highlight sentinel test. |
| node/dynamic-test-app/src/login.tsx | Adds <select id="pet-select"> element. |
| Browser/utils/data_types.py | Adds TextType enum and ROBOT_FRAMEWORK_BROWSER_NO_SET constant. |
| Browser/utils/init.py | Exports TextType and the new constant. |
| Browser/keywords/getters.py | Updates Get Text keyword to send text_type and handle list/string returns. |
| Browser/keywords/evaluation.py | Uses new shared sentinel constant. |
| Browser/gen_stub.py | Imports TextType in generated stub header. |
| atest/test/02_Content_Keywords/text_keywords.robot | Removes Text Area Access (moved). |
| atest/test/02_Content_Keywords/basic_getters.robot | Moves Get Text tests out, renames setup, updates label count to 14. |
| atest/test/02_Content_Keywords/basic_getters_get_text.robot | New suite covering all text_type variants. |
Support allInnerTexts, allTextContents, innerText, inputValue, innerHTML and the old functionality Fixes: MarketSquare#4763
Support allInnerTexts, allTextContents, innerText, inputValue, innerHTML and the old functionality
Fixes: #4763