Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Test timeout doesn't work with BDD scenarios

Aperta
#3,055 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js, playwright
Ambito
testing

Direzione di ricerca

Riproducete il problema con la configurazione CodeceptJS, l’helper Playwright e lo scenario BDD mostrati, quindi tracciate come vengono applicati il timeout globale e il timeout dell’hook Before. Confermate il comportamento per entrambi gli approcci e aggiungete un test di regressione che mostri che uno scenario si arresta al limite configurato.

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

Descrizione

bug critical
What are you trying to achieve?

I would like to define a test timeout in order to prevent being stuck during the execution - native applications & websites can be down / blocked during the execution and I want to skip a test when it reaches a limit.

So I tried (without success) to use the 2 following features available in codeceptjs:

  1. Timeout setting in the configuration file: https://codecept.io/configuration/#configuration
exports.config = {
...
  timeout: 10000,
...
}
  1. Dynamic timeout override by using advanced options: https://codecept.io/advanced/#test-options
Before((test) => {
  test.timeout(10000);
});
What do you get instead?
  • Approach 1 - Timeout setting: has no effect at all
  • Approach 2 - Dynamic timeout override: test execution continues until the end and fails with timeout message if execution exceeds the threshold (see screenshot)

Example: timeout set to 10s, execution ran in 36s before displaying the error message

image

Details
  • CodeceptJS version: 3.1.2
  • NodeJS Version: 16.4.2
  • Operating System: Mac OS
  • Configuration file:
exports.config = {
  output: './output',
  timeout: 10000,
  helpers: {
    Playwright: {
      url: 'http://localhost',
      show: true,
      browser: 'chromium',
      waitForNavigation: 'domcontentloaded'
    },
    ChaiWrapper: {
      require: "codeceptjs-chai"
    }
  },
  include: {},
  mocha: {},
  bootstrap: null,
  teardown: null,
  hooks: [],
  gherkin: {
    features: './features/*.feature',
    steps: './step_definitions/*.js'
  },
  plugins: {
    screenshotOnFail: {
      enabled: true
    },
    pauseOnFail: {},
    retryFailedStep: {
      enabled: true
    },
    tryTo: {
      enabled: true
    }
  },
  tests: './*_test.js',
  name: 'cjs-training'
}
Lingua principale
JavaScript
Stelle
4.2k
Fork
756
Merge medio
2g 9h
PR unite (30g)
16

Guida per i contributori

Apri la guida per i contributori

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 codeceptjs/CodeceptJS

Tutte le issue di codeceptjs/CodeceptJS

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.