| @@ 34-36 (lines=3) @@ | ||
| 31 | ||
| 32 | public function extract() |
|
| 33 | { |
|
| 34 | if (!$this->webDriver->elementExists($this->theme->getAddToCartXpath(), 'byXpath')) { |
|
| 35 | throw new NoSuchElementException('Could not find the simple add to cart element with the Xpath: ' . $this->theme->getAddToCartXpath()); |
|
| 36 | }; |
|
| 37 | ||
| 38 | $elements = $this->webDriver->findElements(WebDriverBy::xpath($this->theme->getAddToCartXpath())); |
|
| 39 | foreach ($elements as $element) { |
|
| @@ 51-53 (lines=3) @@ | ||
| 48 | public function execute() |
|
| 49 | { |
|
| 50 | if ($this->requireQty || $this->addQty > 1) { |
|
| 51 | if (!$this->webDriver->elementExists($this->theme->getSimpleProductQtyXpath(), WebDriver::BY_XPATH)) { |
|
| 52 | throw new NoSuchElementException('Could not find the simple add to cart element with the Xpath: ' . $this->theme->getAddToCartXpath()); |
|
| 53 | } |
|
| 54 | $element = $this->webDriver->byXpath($this->theme->getSimpleProductQtyXpath()); |
|
| 55 | $element->clear(); |
|
| 56 | $element->sendKeys($this->addQty); |
|