9 use Magento\Mtf\Client\Locator;
22 protected $edit =
'.action-edit';
36 protected $bundleOptions =
'.//dl[contains(@class, "item-options")]/dd[%d]/span[@class="price"][%d]';
50 protected $name =
'.product-item-name a';
59 return $this->_rootElement->find($this->productName)->getText();
69 $cartProductPrice = $this->_rootElement->find($this->price, Locator::SELECTOR_XPATH);
70 return $cartProductPrice->isVisible()
71 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
82 $cartProductPrice = $this->_rootElement->find($this->priceInclTax, Locator::SELECTOR_XPATH);
83 return $cartProductPrice->isVisible()
84 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
95 $cartProductPrice = $this->_rootElement->find($this->priceExclTax, Locator::SELECTOR_XPATH);
96 return $cartProductPrice->isVisible()
97 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
109 $this->_rootElement->find($this->qty, Locator::SELECTOR_XPATH)->setValue(
$qty);
119 return $this->_rootElement->find($this->qty, Locator::SELECTOR_XPATH)->getValue();
129 $cartProductPrice = $this->_rootElement->find($this->subtotalPrice);
130 return $cartProductPrice->isVisible()
131 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
142 $cartProductPrice = $this->_rootElement->find($this->subTotalPriceExclTax);
143 return $cartProductPrice->isVisible()
144 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
155 $cartProductPrice = $this->_rootElement->find($this->subTotalPriceInclTax);
156 return $cartProductPrice->isVisible()
157 ? str_replace(
',',
'', $this->
escapeCurrency($cartProductPrice->getText()))
168 $optionsBlock = $this->_rootElement->find($this->optionsBlock, Locator::SELECTOR_XPATH);
172 $titles =
$optionsBlock->getElements(
'./dt', Locator::SELECTOR_XPATH);
175 foreach ($titles as $key =>
$title) {
178 'title' =>
$title->getText(),
194 $optionsName = $this->_rootElement->find($this->optionsBlock .
'//dt', Locator::SELECTOR_XPATH);
195 if (!$optionsName->isVisible()) {
198 return $optionsName->getText();
208 $optionsValue = $this->_rootElement->find($this->optionsBlock .
'//dd', Locator::SELECTOR_XPATH);
209 if (!$optionsValue->isVisible()) {
212 return $optionsValue->getText();
225 $formatPrice = sprintf($this->bundleOptions,
$index, $itemIndex);
226 return trim($this->_rootElement->find($formatPrice, Locator::SELECTOR_XPATH)->getText(), $currency);
236 return $this->_rootElement->find($this->
name, Locator::SELECTOR_CSS)->getText();
246 $this->_rootElement->find($this->
edit)->click();
256 $this->_rootElement->find($this->
removeItem)->click();
267 return preg_replace(
'/^(\d+) x (\w+) \W([\d\.,]+)$/',
'$1 x $2 $3',
$label);
277 $this->_rootElement->find($this->wishlistButton)->click();
287 return $this->_rootElement->find($this->
edit)->isVisible();
getSubtotalPriceExclTax()
getSubtotalPriceInclTax()
getPriceBundleOptions($index, $itemIndex=1, $currency='$')
escapeCurrencyForOption($label)