e2e | rework setup `host` and `port` option

Aperta
#1,607 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
nuxt, playwright, typescript
Ambito
testing

Direzione di ricerca

Inizia dal punto di ingresso setup() di e2e e leggi la gestione attuale delle opzioni del server di sviluppo/test. Confronta il comportamento proposto di testServer host, port, build, already-running-server e baseURL con il runner Vitest e il flusso del browser; il lavoro è completato quando queste opzioni supportano la baseURL non-localhost indicata e le configurazioni del server.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

pending triage
Describe the feature

I think we should consider reworking the host and port options for the e2e setup() function.

In my opinion, it is currently not possible to specify a base URL with the default setup dev/test server. Sometimes e2e needs a non-localhost base URL to be able to implement csrf token/session cookies.

The current workaround would be to start the dev server before testing.

Proposal

await setup({
  runner: 'vitest',
  // testServer: false // run against an already running server
  testServer: {
    build: true, // boolean
    host: '0.0.0.0', // or whatever
    port: 80,
  },
  baseURL: 'http://frontend.local.test', // https://playwright.dev/docs/api/class-testoptions#test-options-base-url 
  browser: true,
})

baseURL can be different form testServer.host. (echo "127.0.0.1 frontend.local.test" >> /etc/hosts)

Additional information
  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?
Final checks
Lingua principale
TypeScript
Stelle
445
Fork
121
Merge medio
3g 11h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nuxt/test-utils

Tutte le issue di nuxt/test-utils

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.