【发布时间】:2013-12-13 14:13:23
【问题描述】:
我有一个关于使用 phpunit 和 selenium 进行自动化测试的问题。我要测试的选项卡显示文本和整数,例如。 'All Open (56)',其中整数可以根据它拥有的记录数而改变。我有一个测试用例,用于测试此菜单选项卡上的文本:
public function testHasAllOpenTab()
{
$this->url('index.php'); // Set the URL to test
// check for the existence of the strin 'All Open'
$this->assertRegExp( '/All Open/i', $this->source() );
}
但我想要测试文本是否也包含一个从 0 到 100 的数字。 我努力了: $this->assertRegExp('/全部打开(/(s*0,\s*255)/', $element->source());
但我仍然得到错误。有人可以帮忙吗? 谢谢 康纳
【问题讨论】:
标签: php phpunit selenium-webdriver