Skip to content

Instantly share code, notes, and snippets.

@pboethig
Created August 5, 2016 11:05
public function testSearch()
{
$term = 'vagrant_puppet_magento';
//get url
$this->_webdriver->get($this->_url);
//find the searchfield
$search = $this->_webdriver->findElement(WebDriverBy::cssSelector('.header-search-input'));
//set focus on this field
$search->click();
//type in searchstring and submit the form
$search->sendKeys($term)->submit();
$searchUrl = $this->_url . "/search?utf8=%E2%9C%93&q=".$term;
$this->_webdriver->get($searchUrl);
$content = $this->_webdriver->findElement(WebDriverBy::tagName('body'))->getText();
$this->assertContains($term, $content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment