Test timeout doesn't work with BDD scenarios
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, node.js, playwright
- 領域
- testing
研究方向
使用所示的 CodeceptJS 設定、Playwright helper 和 BDD 情境重現問題,然後追蹤全域逾時與 Before hook 逾時的套用方式。確認兩種方法的行為,並新增一個回歸測試,顯示情境會在設定的限制處停止。
由索引模型根據 Issue 內容生成。
描述
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:
- Timeout setting in the configuration file: https://codecept.io/configuration/#configuration
exports.config = {
...
timeout: 10000,
...
}
- 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

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'
}
- 主要語言
- 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
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 70/100
georgestephanis/p2026#40 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·