/** * Executes a search on Google's home page using return key. * * @covers SauceExtension */ public function testGoogleSearchResults() { $this->webGuy->am('Anonymous User'); $this->webGuy->wantTo('execute search on home page'); $this->webGuy->amOnPage('/'); $this->webGuy->canSeeInTitle('Google'); $this->webGuy->fillField('#gbqfq', 'dogecoin'); $this->webGuy->pressKey('#gbqfq', WebDriverKeys::ENTER); $this->webGuy->canSeeInField('input#gbqfq', 'dogecoin'); $this->webGuy->canSeeInTitle('dogecoin - Google Search'); }
<?php $I = new WebGuy($scenario); $I->wantTo('find facebook/php-webdriver on GitHub'); $I->amOnPage('/'); $I->fillField('.js-site-search-focus', 'php-webdriver'); $I->pressKey('.js-site-search-focus', WebDriverKeys::ENTER); $I->seeLink('facebook', '/facebook/php-webdriver');