|
@@ 83-88 (lines=6) @@
|
| 80 |
|
$name = trim($nameElement->getText()); |
| 81 |
|
|
| 82 |
|
$xpath = $this->theme->getCartSummaryCheckoutProductLoopPriceXpath($count); |
| 83 |
|
if ($this->webDriver->elementExists($xpath, WebDriver::BY_XPATH)) { |
| 84 |
|
$priceElement = $this->webDriver->byXpath($xpath); |
| 85 |
|
$price = trim($priceElement->getText()); // We do not extract the number value so currency checks can be done |
| 86 |
|
} else { |
| 87 |
|
$price = 0; |
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
$xpath = $this->theme->getCartSummaryCheckoutProductLoopQtyXpath($count); |
| 91 |
|
if ($this->webDriver->elementExists($xpath, WebDriver::BY_XPATH)) { |
|
@@ 91-96 (lines=6) @@
|
| 88 |
|
} |
| 89 |
|
|
| 90 |
|
$xpath = $this->theme->getCartSummaryCheckoutProductLoopQtyXpath($count); |
| 91 |
|
if ($this->webDriver->elementExists($xpath, WebDriver::BY_XPATH)) { |
| 92 |
|
$qtyElement = $this->webDriver->byXpath($xpath); |
| 93 |
|
$qty = trim($qtyElement->getText()); |
| 94 |
|
} else { |
| 95 |
|
$qty = 0; |
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
$xpath = $this->theme->getCartSummaryCheckoutProductLoopSubtotalXpath($count); |
| 99 |
|
if ($this->webDriver->elementExists($xpath, WebDriver::BY_XPATH)) { |
|
@@ 99-104 (lines=6) @@
|
| 96 |
|
} |
| 97 |
|
|
| 98 |
|
$xpath = $this->theme->getCartSummaryCheckoutProductLoopSubtotalXpath($count); |
| 99 |
|
if ($this->webDriver->elementExists($xpath, WebDriver::BY_XPATH)) { |
| 100 |
|
$subtotalElement = $this->webDriver->byXpath($xpath); |
| 101 |
|
$subtotal = trim($subtotalElement->getText()); |
| 102 |
|
} else { |
| 103 |
|
$subtotal = 0; |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
$product = new Product($name, $qty, $price, $subtotal); |
| 107 |
|
$productIterator->addProduct($product); |