protractor - 报告/显示 Protractor Cucumber html 中的断言失败报告为步骤失败
问题描述
我一直试图在量角器的黄瓜 html 报告中将断言失败报告为步骤失败,但没有成功。在 hooks.ts 文件中,After 步骤配置如下,用于场景级别故障;
After(async function(scenario) {
if (scenario.result.status === Status.FAILED) {
// screenShot is a base-64 encoded PNG
const screenShot = await browser.takeScreenshot();
this.attach(screenShot, "image/png");
}
我如何对报告中的步骤级别失败(或断言失败)执行相同的操作,这样,如果场景失败,我只需查看报告即可知道哪个步骤完全失败。
解决方案
推荐阅读
- c++ - 如何访问指向指针向量的指针向量数组中的转发列表以转发指向对象的指针列表?
- c++ - (C++) 我似乎无法多次运行我的 for 循环。难道我做错了什么?
- docker - Docker 停止响应并出现错误“超出上下文期限”
- mysql - mysql join没有返回所需的结果
- algorithm - Hackerrank 上组织球容器问题的解决方案逻辑
- python-3.x - 一个程序来计算最少数量的笔记,这些笔记将结合起来给出卢比。ñ?
- java - 从内部列表中删除项目 - 没有得到 ConcurrentModificationException
- typescript - 连续的承诺,声明的方式。如何?
- javascript - React Native TouchableWithoutFeedback is not working
- python - 拒绝访问文件 [apache2,flask,python]