Support attachments in BeforeAll/AfterAll hooks

Aperta
#2,276 8 commenti 3 reazioni 1 assegnatario Vedi su GitHub

@davidjgoss ci sta già lavorando.

Dal 1/9/2025.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

:zap: enhancement

I want to add a log file as an attachment to report after tests execution. I wanted to use AfterAll hook but according to this comment: https://github.com/cucumber/cucumber-js/issues/1109#issuecomment-400542113
this is impossible. How can I achieve that? Is this possible to import attach method directly to AfterAll hook?

// This is not working as AfterAll hook dosn't have acces to World instance 
AfterAll(async function () { 
      const file = await fs.readFileSync('./features/support/scp_util/file.txt') 
      this.attach(file, 'text/plain'); 
  });```
Lingua principale
Nessun dato sulla lingua
Stelle
3.4k
Fork
676
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

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 cucumber/common

Tutte le issue di cucumber/common

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.