作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一辈子都无法使用这些屏幕截图:
应该很简单,但是没有错误消息,什么也没有。在我开始挖掘源代码之前,任何人都可以阐明一些信息吗?
class ScreenshotTest extends PHPUnit_Extensions_Selenium2TestCase {
protected $captureScreenshotOnFailure = TRUE;
protected $screenshotPath = 'C:\\';
protected $screenshotUrl = 'http://127.0.0.1/';
protected function setUp()
{
$this->setBrowser('firefox');
$this->setBrowserUrl('http://127.0.0.1/');
}
public function testTitle()
{
$this->url('http://127.0.0.1');
$this->assertEquals('foobarbaz', $this->title());
} }
最佳答案
啊哈 - 发现问题了。
extends PHPUnit_Extensions_Selenium2TestCase
应该是
extends PHPUnit_Extensions_SeleniumTestCase
明白了!
文档中的第一个示例是针对 PHPUnit_Extensions_Selenium2TestCase
的。页面上的所有其他内容均用于 PHPUnit_Extensions_SeleniumTestCase
。
编辑
这个问题让我开始了几天来寻找答案的斗争。对于遇到这个问题的下一个人/女孩,有一些初学者级别的头痛没有在任何地方明确说明,我在 Where the heck is any Selenium 2 documentation for PHPUnit? 记录了它们。 .
关于php - captureScreenshotOnFailure 不工作,损坏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19085777/
我一辈子都无法使用这些屏幕截图: 目录存在 测试按预期执行(并失败) 我正在使用 Firefox (14.1) 阅读文档(只有几段) 我已经阅读了我能找到的所有内容: http://www.devin
我正在使用 PHPUnit 3.4.12 来驱动我的 selenium 测试。我希望能够在测试失败时自动截取屏幕截图。这应该得到支持,如 http://www.phpunit.de/manual/cu
我是一名优秀的程序员,十分优秀!