Skip to content

Conversation

AlinaVarkki
Copy link
Collaborator

Fixes #185

The standard selector value is not included in the AXNode, so add it separately.

@AlinaVarkki AlinaVarkki requested a review from OrKoN October 1, 2025 11:58
Copy link
Collaborator

@OrKoN OrKoN left a comment

Choose a reason for hiding this comment

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

Thanks! Let us use conventional commits for the PR title.

I think we should do the approach we discussed previously in which we resolve option label to a value when we will out an option. WDYT? I think doing evals during snapshot generation would be too expensive and bug-prone

@AlinaVarkki
Copy link
Collaborator Author

Thanks! Let us use conventional commits for the PR title.

I think we should do the approach we discussed previously in which we resolve option label to a value when we will out an option. WDYT? I think doing evals during snapshot generation would be too expensive and bug-prone

Do you mean check if it is an option within fill_form and get the value then?
We can do that, but do you think there is no other case when we might need the value in the snapshot?
Maybe for some other tool to use?

await handle.asLocator().fill(request.params.value);
// The AXNode for an option doesn't contain its `value`. We set text content of the option as value.
// To fill the form, get the correct option by its text value.
const isSelectElement = await handle.evaluate(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we lookup the a11y node by uid in the snapshot instead and check if it is an option?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the uid here is not for the option, but for a selector element.
We can look up that selector element by uid and check which of its childen value matches the one we are looking for. We still need to get its Element since we need to get the value that does not exist in the AXNode.

I changed it to do that

@AlinaVarkki AlinaVarkki changed the title Add an option value to the snapshot fix: add an option value to the snapshot Oct 2, 2025
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.

Cannot select <select> option by text
2 participants