Skip to content

Commit

Permalink
added tests for PW
Browse files Browse the repository at this point in the history
  • Loading branch information
DavertMik committed Sep 22, 2024
1 parent b865906 commit 07925d3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/web/WebDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,39 @@ public function testSwitchToIframe()
$this->module->see('Lots of valuable data here');
}

public function testReloadPage()
{
$this->module->amOnPage('/');
$this->module->reloadPage();
$this->module->see('Welcome to test app!');
}

public function testExecuteJS()
{
$this->module->amOnPage('/');
$this->module->see('Test Link');
$this->module->executeJS("document.getElementById('area1').style.display = 'none'");
$this->module->dontSee('Test Link');
}

public function testGrabFromCurrentUrl()
{
$this->module->amOnPage('/');
$this->module->click('Test');
$url = $this->module->grabFromCurrentUrl();
$this->assertEquals('http://127.0.0.1:8000/form/hidden', $url);
$this->module->seeCurrentUrlMatches('~hidden~');
}

public function testWaiters()
{
$this->module->amOnPage('/');
$this->module->waitForElementClickable('#link');
$this->module->waitForElementVisible('#link');

$this->module->amOnPage('/info');
$this->module->waitForElementNotVisible('Invisible text');
}

public function testGrabPageSourceWhenOnPage()
{
Expand Down

0 comments on commit 07925d3

Please sign in to comment.