Skip to content

Commit 07925d3

Browse files
committed
added tests for PW
1 parent b865906 commit 07925d3

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

tests/web/WebDriverTest.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,39 @@ public function testSwitchToIframe()
426426
$this->module->see('Lots of valuable data here');
427427
}
428428

429+
public function testReloadPage()
430+
{
431+
$this->module->amOnPage('/');
432+
$this->module->reloadPage();
433+
$this->module->see('Welcome to test app!');
434+
}
435+
436+
public function testExecuteJS()
437+
{
438+
$this->module->amOnPage('/');
439+
$this->module->see('Test Link');
440+
$this->module->executeJS("document.getElementById('area1').style.display = 'none'");
441+
$this->module->dontSee('Test Link');
442+
}
443+
444+
public function testGrabFromCurrentUrl()
445+
{
446+
$this->module->amOnPage('/');
447+
$this->module->click('Test');
448+
$url = $this->module->grabFromCurrentUrl();
449+
$this->assertEquals('http://127.0.0.1:8000/form/hidden', $url);
450+
$this->module->seeCurrentUrlMatches('~hidden~');
451+
}
452+
453+
public function testWaiters()
454+
{
455+
$this->module->amOnPage('/');
456+
$this->module->waitForElementClickable('#link');
457+
$this->module->waitForElementVisible('#link');
458+
459+
$this->module->amOnPage('/info');
460+
$this->module->waitForElementNotVisible('Invisible text');
461+
}
429462

430463
public function testGrabPageSourceWhenOnPage()
431464
{

0 commit comments

Comments
 (0)