playwright/packages/recorder
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
..
public chore: use SVG icons for web apps (#26564) 2023-08-21 18:33:02 +02:00
src fix(recorder): Locator picker had wrong initial language in language bindings (#27706) 2023-10-22 13:02:14 +02:00
.gitignore fix(debug): do not pause on internal calls, update ct docs (#14018) 2022-05-07 19:56:25 -07:00
index.html chore: use SVG icons for web apps (#26564) 2023-08-21 18:33:02 +02:00
package.json chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
tsconfig.json chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
tsconfig.node.json chore: migrate trace-viewer and recorder to vite (#13076) 2022-03-25 14:12:00 -07:00
vite.config.ts chore: remove old webpack folder structure (#26560) 2023-08-19 16:16:44 -07:00