After hook is NOT working and browser does NOT close when more than 1 Feature sections exists in test file
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, node.js
- Ambito
- testing
Direzione di ricerca
Inizia con i test corrispondenti a tests/*_tests.ts e alla configurazione CodeceptJS mostrata, concentrandoti sull'interazione tra più sezioni Feature, restart: true e l'helper Puppeteer. Riproduci il problema con più di una sezione Feature e verifica se After e AfterSuite vengono eseguiti. Il lavoro è completato quando gli hook vengono eseguiti e le pagine del browser si chiudono dopo ogni test senza accumulare processi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What are you trying to achieve?
When there are more than 1 Feature sections in the test file:
- the browser/page does NOT close after each test, so at the end I have many browsers opened, which slowing down my system.
- the
AfterandAfterSuitehooks are NOT working at all (are NOT called).
Tests behave (passed/failed) normally and the next test is conducted on newly opened browser, but After and AfterSuite hooks are NOT even called after test(s). Additional hooks / teardown implemented in the codecept.conf do NOT help. Any suggestion?
What do you get instead?
Tests behave (passed/failed) normally and the next test is conducted on newly opened browser, but After and AfterSuite hooks are NOT even called after test(s). Additional hooks / teardown implemented in the codecept.conf do NOT help, so at the end I have many browsers/threads opened, which slowing down my system.
Details
- CodeceptJS version: 3.6.10
- NodeJS Version: 20.15.0
- Operating System: Win11 Pro
- puppeteer version: 23.11.1
- Configuration file:
/// <reference types='./steps' />
import { testConfig } from "./testConfig";
const fullScreen: string = "false";
export const config: CodeceptJS.MainConfig = {
tests: "./tests/*_tests.ts",
timeout: 60,
output: "./output",
helpers: {
REST: {},
Puppeteer: {
url: testUrl,
browser: "chrome",
show: true,
fullPageScreenshots: true,
uniqueScreenshotNames: false,
waitForNavigation: ["load", "domcontentloaded"] as any,
pressKeyDelay: 7,
waitForTimeout: 30000,
restart: true,
windowSize: screenResolution.join("x") as any,
chrome: {
args: ["--no-sandbox", `--lang=${lang}`, fullScreen === "true" ? "--start-fullscreen" : ""],
},
},
CustomHelper: {
require: "./helpers/customHelper.ts",
},
AssertWrapper: {
require: "codeceptjs-assert",
},
ResembleHelper: {
require: "codeceptjs-resemblehelper",
screenshotFolder: "./output/",
baseFolder: "./screenshots/base/",
diffFolder: "./screenshots/diff/",
prepareBaseImage: false,
tolerance: 2,
needsSameDimension: true,
},
},
};
- 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di codeceptjs/CodeceptJS
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
codeceptjs/CodeceptJS#5420 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
codeceptjs/CodeceptJS#5358 · 1 commento ·
-
stale
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
codeceptjs/CodeceptJS#4958 · 10 commenti · 2 reazioni ·
-
stale
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
codeceptjs/CodeceptJS#4778 · 3 commenti ·
-
stale
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
codeceptjs/CodeceptJS#5618 · 1 commento ·