Skip to content

1962 add locator type#1972

Open
emanlove wants to merge 12 commits intorobotframework:masterfrom
emanlove:1962-add-locator-type
Open

1962 add locator type#1972
emanlove wants to merge 12 commits intorobotframework:masterfrom
emanlove:1962-add-locator-type

Conversation

@emanlove
Copy link
Copy Markdown
Member

@emanlove emanlove commented Apr 6, 2026

Reowrked previous solution to fix cascading locators with this using Type Alias instead of modifying the individual types at each usage of locator.

This solution's syntax requires a minimum Python version of 3.10.

- Fixed a couple incorrectly modified type hints on click button
  and click image
- Added type hints to get webelement(s) keywords
With using the type union syntax we will require atleast Python 3.10.
Also v3.8 and v3.9 have reached end of life.
The `Get Cookies` test started to fail. It was written to expect
just the another and test cookies but was also receiving the far_future
cookie. I'm a bit unsure as to why this wasn't failing sooner. I would
have expected this cookie to also appear. So not sure what was happening
here. Git blame shows this has been unchanged for a while.

I have updated the expected return value from get cookies. I do see some
possible improvements. The previous check allowed for the order to be swapped.
With three that is a bit more complicated. Instead of going into a complex
check for any order I am going to leave this till we see that appear.
Copy link
Copy Markdown
Member

@yuriverweij yuriverweij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Minor change requested to keep it all in line. Should work for 3.10 compatibility

When locator can also be none would probably be better written as:
locator: Locator | None = None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants