1

使用 Thucydides 运行自动化测试时遇到间歇性问题:

结果:WARN 无法为 net.thucydides.core.model.Screenshot@82df887 写入缩放屏幕截图:{} java.io.IOException:无法将完整内容从“target/site/thucydides/2a645999ca0b3b04597680646ce26149_NONE.png”复制到“target/”站点/修昔底德/scaled_2a645999ca0b3b04597680646ce26149_NONE.png'

我运行的命令是这样的: mvn -Dit.test=MyTestClass verify

我在@Steps、@StepGroup、@WithTag 和@Story 注释方面使用了许多修昔底德结构。

在运行多个测试而不仅仅是一个测试时,我似乎得到了这个错误。

玩 thucydides.keep.unscaled.screenshots 没有区别。

我发现只有一个其他相关问题发布在 Google 群组上,但没有解决方案(截至 2014 年 11 月 6 日)。

我的配置设置:

  • 操作系统:Mac OSX Yosemite (10.10)(也发生在 10.9 上)
  • mvn:阿帕奇 Maven 3.1.1
  • 爪哇:1.7.0_51
  • 修昔底德:0.9.273(0.9.275 也失败)
  • 硒:2.42.2 -
  • 浏览器:FireFox v28(我尝试过 27 和 31 相同的问题,Chrome 38、Safari 7.1 似乎都出现类似或相同的问题)

任何指针都非常感谢。这里的一个相关问题是,如果您将 thucydides:aggregate 标记到 mvn 命令行上,并且如上所示失败,则 Thucydides 将不会生成 index.html 文件。

4

1 回答 1

0

This appears to be a problem with how screenshots are managed. The working theory (unconfirmed by Thucydides authors) on why this happens seems to be rooted in the strategy of Thucydides saving time and space by reusing screenshots. Apparently, the reporting engine will take a screenshot, do some scaling, resave the file, etc...If a second test comes along that has an md5-identical screenshot to that of another test, it will try to reuse it. However, if for some reason that file is not available (due to a lock or not present, etc...) then you can see this error.
To confirm this suspicion I took the sample Thucydides app built from instructions here:

and duplicated one of the tests (copy the test method, alter the name slightly) and ran 'verify'. Sure enough, I was able to reproduce the problem.

于 2014-11-21T22:55:00.117 回答