Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: https://github.com/microsoft/playwright/blob/b9b289b6415515b1b8e1a2524ed6425c8992af5a/packages/playwright-core/src/server/recorder.ts#L369 and it gets used here (no parameter means: we use the first language aka. primary language): https://github.com/microsoft/playwright/blob/b9b289b6415515b1b8e1a2524ed6425c8992af5a/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. microsoft/playwright-dotnet#2718 --------- Signed-off-by: Max Schmitt <max@schmitt.mx>
- Loading branch information