Last active
December 19, 2015 02:39
-
-
Save DominicFinn/5884833 to your computer and use it in GitHub Desktop.
Basic Selenium Automation with PHP and PHPUnit for Jons perusal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class WebTest extends PHPUnit_Extensions_Selenium2TestCase | |
| { | |
| protected function setUp() | |
| { | |
| $this->setBrowser('firefox'); | |
| $this->setBrowserUrl('http://www.example.com/'); | |
| } | |
| public function testTitle() | |
| { | |
| $this->url('http://www.example.com/'); | |
| $this->assertEquals('Example WWW Page', $this->title()); | |
| } | |
| public function clickOnSomething() { | |
| $this->clickOnElement('submitButton'); | |
| } | |
| public function getValueOutOfElement() { | |
| $inputfield = $this->byName('txtField'); | |
| $this->assertEquals('test text', $inputfield->value()); | |
| } | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment