Skip to content

Commit

Permalink
Merge pull request #101 from kschroeder/master
Browse files Browse the repository at this point in the history
Added a wait condition to make sure that the button for the search is…
  • Loading branch information
kschroeder authored Feb 21, 2017
2 parents ce5f635 + f629824 commit b35a63f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Magento/Actions/Search/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

namespace Magium\Magento\Actions\Search;

use Facebook\WebDriver\WebDriverBy;
use Magium\Actions\WaitForPageLoaded;
use Magium\Magento\Themes\AbstractThemeConfiguration;
use Magium\WebDriver\ExpectedCondition;
use Magium\WebDriver\WebDriver;

class Search
Expand All @@ -27,7 +29,9 @@ public function __construct(
public function search($characters)
{
$this->type($characters);
$element = $this->webDriver->byXpath($this->theme->getSearchSubmitXpath());
$searchButtonXpath = $this->theme->getSearchSubmitXpath();
$element = $this->webDriver->byXpath($searchButtonXpath);
$this->webDriver->wait()->until(ExpectedCondition::elementToBeClickable(WebDriverBy::xpath($searchButtonXpath)));
$element->click();
$this->loaded->execute($element);
}
Expand All @@ -41,4 +45,4 @@ public function type($characters, $clear = false)
$box->sendKeys($characters);
}

}
}

0 comments on commit b35a63f

Please sign in to comment.