playwright/tests/library/inspector
Max Schmitt 6d7d37061d
fix(recorder): Locator picker had wrong initial language in language bindings (#27706)
**Description**

When a language port was using Inspector with the "Locator Picker"
feature, it only recognised JavaScript as a language by default. As a
workaround the user was able to click record, interact with the page and
then the language would be correctly used -> csharp e.g. would work in
the "Locator Picker".

**Why?**

Our language bindings are setting `PW_LANG_NAME=<sdkLanguage>` env var
-> good. Our recorder harness also uses this along its internal state
here:


b9b289b641/packages/playwright-core/src/server/recorder.ts (L369)

and it gets used here (no parameter means: we use the first language
aka. primary language):


b9b289b641/packages/playwright-core/src/server/recorder.ts (L95)

The only issue is that the Inspector frontend in the beginning does not
know which language it should use and pass over to the server side, it
then falls back to JavaScript.

**Proposed fix**

Instead of passing it over from the frontend to the server side, we just
always use it from the server side, aka. "currentLanguage". When the
user switches languages in the frontend, "currentLanguage" already gets
updated properly via the "fileChanged" event.

https://github.com/microsoft/playwright-dotnet/issues/2718

---------

Signed-off-by: Max Schmitt <max@schmitt.mx>
2023-10-22 13:02:14 +02:00
..
cli-codegen-1.spec.ts fix(codegen): generate no Enter keyboard events for textareas (#23775) 2023-06-19 17:07:37 +02:00
cli-codegen-2.spec.ts chore: enable no-floating-promises ESLint rule for tests (#23376) 2023-06-02 21:59:12 +02:00
cli-codegen-3.spec.ts fix: use no internal selectors for frame locators (#19964) 2023-01-11 21:53:19 +01:00
cli-codegen-csharp.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-java.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-javascript.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-pytest.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-python-async.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-python.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
cli-codegen-test.spec.ts test: unflake inspector-cli tests (#22347) 2023-04-12 09:37:24 -07:00
console-api.spec.ts feat(locators): reland locator.and(locator) (#22850) 2023-05-05 11:14:01 -07:00
inspectorTest.ts tests: fix race condition in codegen tests (#26405) 2023-08-10 07:51:38 -07:00
pause.spec.ts fix(recorder): Locator picker had wrong initial language in language bindings (#27706) 2023-10-22 13:02:14 +02:00