public function NodeElementTest::testWaitForTimeout in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/behat/mink/tests/Element/NodeElementTest.php \Behat\Mink\Tests\Element\NodeElementTest::testWaitForTimeout()
@medium
File
- vendor/
behat/ mink/ tests/ Element/ NodeElementTest.php, line 99
Class
Namespace
Behat\Mink\Tests\ElementCode
public function testWaitForTimeout() {
$node = new NodeElement('some xpath', $this->session);
$expectedTimeout = 2;
$startTime = microtime(true);
$result = $node
->waitFor($expectedTimeout, function () {
return null;
});
$endTime = microtime(true);
$this
->assertNull($result, '->waitFor() returns whatever callback gives');
$this
->assertEquals($expectedTimeout, round($endTime - $startTime));
}