keepTraceForPassedTests failure

未关闭
#5,433 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
javascript, playwright
领域
testing-qa

调研方向

从 server.js 第 37 行附近以及 Playwright.js:2509 的 Playwright helper 开始,使用报告中的配置,并启用 keepVideoForPassedTests 或 keepTraceForPassedTests。重现该失败,并跟踪通过测试选项如何影响 helper 状态;完成的标准是任一选项都能正常工作,不出现 undefined screenshot 错误,同时保留所请求的 trace 或 video。

由索引模型根据 Issue 内容生成。

描述

stale

I try to use the config options keepTraceForPassedTests and keepVideoForPassedTests.

I use the codeception module for php.

trace and video works. But when i try to activate one of the keepTraceForPassedTests and keepVideoForPassedTests options. it fails.

it use the playwright helper object. https://github.com/Codeception/module-playwright/blob/main/server.js#L37

playwright-1  | Init:  {
playwright-1  |   pw_debug: true,
playwright-1  |   timeout: 5000,
playwright-1  |   url: 'https://event-ticketing.local',
playwright-1  |   browser: 'webkit',
playwright-1  |   show: true,
playwright-1  |   fullPageScreenshots: true,
playwright-1  |   trace: true,
playwright-1  |   video: true,
playwright-1  |   ignoreHTTPSErrors: true,
playwright-1  |   emulate: {
playwright-1  |     userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1',
playwright-1  |     viewport: { width: 375, height: 812 },
playwright-1  |     deviceScaleFactor: 3,
playwright-1  |     isMobile: true,
playwright-1  |     hasTouch: true,
playwright-1  |     defaultBrowserType: 'webkit'
playwright-1  |   },
playwright-1  |   keepVideoForPassedTests: true
playwright-1  | }
playwright-1  | Error saving screenshot:  TypeError: Cannot read properties of undefined (reading 'screenshot')
playwright-1  |     at Playwright.saveScreenshot (/usr/lib/node_modules/codeception-module-playwright/node_modules/codeceptjs/lib/helper/Playwright.js:2509:21)
playwright-1  |     at /usr/lib/node_modules/codeception-module-playwright/server.js:69:28
playwright-1  |     at Layer.handle [as handle_request] (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/layer.js:95:5)
playwright-1  |     at next (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/route.js:149:13)
playwright-1  |     at Route.dispatch (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/route.js:119:3)
playwright-1  |     at Layer.handle [as handle_request] (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/layer.js:95:5)
playwright-1  |     at /usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/index.js:284:15
playwright-1  |     at router.process_params (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/index.js:346:12)
playwright-1  |     at next (/usr/lib/node_modules/codeception-module-playwright/node_modules/express/lib/router/index.js:280:10)
playwright-1  |     at /usr/lib/node_modules/codeception-module-playwright/node_modules/body-parser/lib/read.js:137:5
主要语言
JavaScript
星标
4.2k
派生
756
平均合并
2 天 9 小时
30 天内合并 PR
16

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codeceptjs/CodeceptJS 的其他 Issue

查看 codeceptjs/CodeceptJS 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。