Allow custom wsEndpoint for Playwright

Abierto
#33,115 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
angular, playwright, typescript

Línea de trabajo

Empieza leyendo browser-provider.ts alrededor de las líneas 164-187, especialmente providerFactory, y después inspecciona las sobrescrituras del proveedor en plugins.ts alrededor de las líneas 265-284. Sigue cómo la configuración de Playwright llega al Angular builder y determina qué opción compatible con versiones anteriores es adecuada. Se considera terminado cuando se respeta un wsEndpoint configurado explícitamente en lugar de sobrescribirlo implícitamente.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area: @angular-devkit/build-angular gemini-triaged
Command

build

Description

In our project, I've been trying to set up visual regression testing using Vitest, and to make the screenshot tests stable, we want to make those tests in the same environment, regardless of the developers' OS, which can impact the tests. When using Playwright as a browser provider, Vites allows for providing/overriding the WS endpoint, which is not respected & overridden in the unit test builder.

After a quick look at the code, presumably this is being dropped in browser-provider.ts:164-87 - providerFactory(..) function is called with only baseOptions, and also, plugins.ts:265-284 has some more overrides, and comments (// CLI provider browser options override, if present)

Describe the solution you'd like

Ideally, as a developer, I'd like to have better control over the browser provider configuration, instead of having it implicitly overridden on the builder side.

These are the options that I have on my mind, both of them backward compatible with the existing API:

  1. Allow full customization for the browser provider

The solution is as simple as not overriding the provider value if defined explicitly in vitetest-base.config.ts. This option would be backward compatible with the existing API, but might break the projects that've attempted to override the provider property and haven't noticed that it has no impact.

  1. Add wsEndpoint property to the builder schema, and allow overriding the value from angular.json

Safer solution, but less flexible.

Describe alternatives you've considered

All other alternatives require significant efforts to support, and require bypassing the Angular builders, or using a different framework for the same purpose.

I'm also happy to make a contribution, but first, I'd like to get an opinion, and maybe get more context on why the browser config is overridden from Angular's side.

Lenguaje dominante
TypeScript
Estrellas
27k
Forks
11.8k
Merge medio
16 h 21 min
PR fusionados (30 d)
170

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de angular/angular-cli

Todos los issues de angular/angular-cli

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.