Skip to content

chore: make sure _generateLocatorString does not timeout - #36381

Merged
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:chore-generate-locator-no-timeout
Jun 24, 2025
Merged

chore: make sure _generateLocatorString does not timeout#36381
Dmitry Gozman (dgozman) merged 1 commit into
microsoft:mainfrom
dgozman:chore-generate-locator-no-timeout

Conversation

@dgozman

Copy link
Copy Markdown
Collaborator

There is no reason to wait for the locator to match an element, because this method is used to convert between a locator and a preferred locator.

If nothing matches, just throw an error right away.

Comment thread packages/protocol/src/protocol.yml Outdated
element: ElementHandle

generateLocatorString:
title: Generate locator

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: if it's internal, why does it need a title?

}
frame = frame.parentFrame();
}
return asLocator('javascript', result.reverse().join(' >> internal:control=enter-frame >> '));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is it intentional we always use javascript here, instead of sdkLanguage?

There is no reason to wait for the locator to match an
element, because this method is used to convert between
a locator and a preferred locator.

If nothing matches, just throw an error right away.
@dgozman
Dmitry Gozman (dgozman) force-pushed the chore-generate-locator-no-timeout branch from 9736b44 to eb893a2 Compare June 23, 2025 12:58
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

7 flaky ⚠️ [chromium-library] › library/chromium/tracing.spec.ts:49:3 › should run with custom categories if provided @chromium-ubuntu-22.04-node20
⚠️ [chromium-library] › library/chromium/tracing.spec.ts:49:3 › should run with custom categories if provided @chromium-ubuntu-22.04-node22
⚠️ [firefox-library] › library/inspector/cli-codegen-1.spec.ts:986:7 › cli codegen › should not throw csp directive violation errors @firefox-ubuntu-22.04-node18
⚠️ [firefox-page] › page/page-wait-for-function.spec.ts:104:3 › should work with strict CSP policy @firefox-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-trace.spec.ts:587:5 › should indicate current test status @macos-latest-node18-1
⚠️ [webkit-page] › page/page-screenshot.spec.ts:345:5 › page screenshot › should work while navigating @webkit-ubuntu-22.04-node18
⚠️ [playwright-test] › ui-mode-test-watch.spec.ts:145:5 › should watch all @windows-latest-node18-1

39453 passed, 823 skipped
✔️✔️✔️

Merge workflow run.

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.

2 participants