-
Notifications
You must be signed in to change notification settings - Fork 21
internal(browser): Add exact option to text-based locators #1152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
37eaaf1
f2c28f6
58cd8ea
755f182
c2ea0da
0692a0d
053e705
5e84ddd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,9 +91,15 @@ function emitLocatorNode(context: IntermediateContext, node: m.LocatorNode) { | |
| type: 'NewLabelLocatorExpression', | ||
| text: { | ||
| type: 'StringLiteral', | ||
| value: node.selector.text, | ||
| value: node.selector.text.value, | ||
| }, | ||
| page, | ||
| options: node.selector.text.exact | ||
| ? { | ||
| type: 'TextLocatorOptionsExpression', | ||
| exact: node.selector.text.exact, | ||
| } | ||
| : null, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Existing saved locators silently lose exact matching behaviorMedium Severity Previously, the code generation hardcoded Additional Locations (1)Reviewed by Cursor Bugbot for commit 053e705. Configure here.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is fine, because it's not a user-facing feature yet. The user-facing recording-to-script conversion should not be affected. |
||
| }) | ||
| break | ||
|
|
||
|
|
@@ -102,9 +108,15 @@ function emitLocatorNode(context: IntermediateContext, node: m.LocatorNode) { | |
| type: 'NewPlaceholderLocatorExpression', | ||
| text: { | ||
| type: 'StringLiteral', | ||
| value: node.selector.text, | ||
| value: node.selector.text.value, | ||
| }, | ||
| page, | ||
| options: node.selector.text.exact | ||
| ? { | ||
| type: 'TextLocatorOptionsExpression', | ||
| exact: node.selector.text.exact, | ||
| } | ||
| : null, | ||
| }) | ||
| break | ||
|
|
||
|
|
@@ -113,9 +125,15 @@ function emitLocatorNode(context: IntermediateContext, node: m.LocatorNode) { | |
| type: 'NewTitleLocatorExpression', | ||
| text: { | ||
| type: 'StringLiteral', | ||
| value: node.selector.text, | ||
| value: node.selector.text.value, | ||
| }, | ||
| page, | ||
| options: node.selector.text.exact | ||
| ? { | ||
| type: 'TextLocatorOptionsExpression', | ||
| exact: node.selector.text.exact, | ||
| } | ||
| : null, | ||
| }) | ||
| break | ||
|
|
||
|
|
@@ -124,9 +142,15 @@ function emitLocatorNode(context: IntermediateContext, node: m.LocatorNode) { | |
| type: 'NewAltTextLocatorExpression', | ||
| text: { | ||
| type: 'StringLiteral', | ||
| value: node.selector.text, | ||
| value: node.selector.text.value, | ||
| }, | ||
| page, | ||
| options: node.selector.text.exact | ||
| ? { | ||
| type: 'TextLocatorOptionsExpression', | ||
| exact: node.selector.text.exact, | ||
| } | ||
| : null, | ||
| }) | ||
| break | ||
|
|
||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe something like
TextBasedLocatorOptionsExpressionis a better choice, sincegetByTextexists?