After hook is NOT working and browser does NOT close when more than 1 Feature sections exists in test file
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
- 技术栈
- javascript, node.js
- 领域
- testing
调研方向
从与 tests/*_tests.ts 匹配的测试以及所示的 CodeceptJS 配置开始,重点关注多个 Feature 部分、restart: true 和 Puppeteer helper 之间的交互。使用多个 Feature 部分复现该问题,并跟踪 After 和 AfterSuite 是否运行。完成的标准是 hooks 能够执行,并且每次测试后浏览器页面都会关闭,而不会累积进程。
由索引模型根据 Issue 内容生成。
描述
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,
},
},
};
- 主要语言
- JavaScript
- 星标
- 4.2k
- 派生
- 756
- 平均合并
- 2 天 9 小时
- 30 天内合并 PR
- 16
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
codeceptjs/CodeceptJS 的其他 Issue
-
stale
难度 2/5 1-3 小时 新手友好度 72/100
codeceptjs/CodeceptJS#5420 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 76/100
codeceptjs/CodeceptJS#5358 · 1 条评论 ·
-
stale
难度 2/5 1-3 小时 新手友好度 78/100
codeceptjs/CodeceptJS#4958 · 10 条评论 · 2 个 reaction ·
-
stale
难度 1/5 1 小时以内 新手友好度 72/100
codeceptjs/CodeceptJS#4778 · 3 条评论 ·
-
stale
难度 4/5 3-5 天 新手友好度 38/100
codeceptjs/CodeceptJS#5618 · 1 条评论 ·
查看 codeceptjs/CodeceptJS 的全部 Issue
相似的 Issue
-
ai-observability bug team/ai-observability
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 68/100
AllTheMods/ATM-10-L#19 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
SignalK/n2k-signalk#345 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 1/5 1-3 小时 新手友好度 88/100
JuliaPluto/PlutoPlotly.jl#72 ·