9 use Magento\Mtf\Client\Locator;
28 protected $website =
'optgroup[following-sibling::optgroup[option[contains(.,"%s")]]]';
37 $selectedLabel = trim(parent::getValue());
38 $element = $this->
find(sprintf($this->website, $selectedLabel), Locator::SELECTOR_XPATH);
40 $element = $this->
find(sprintf($this->storeGroup, $selectedLabel), Locator::SELECTOR_XPATH);
41 $value .=
'/' . trim(
$element->getAttribute(
'label'), chr(0xC2) . chr(0xA0));
42 $value .=
'/' . $selectedLabel;
55 $pieces = explode(
'/',
$value);
57 if (1 == count($pieces)) {
58 $optionLocator =
'.//option[contains(text(),"' . $pieces[0] .
'")]';
60 $optionLocator =
'.//optgroup[contains(@label,"' 61 . $pieces[0] .
'")]/following-sibling::optgroup[contains(@label,"' 62 . $pieces[1] .
'")]/option[contains(text(), "' 66 $option = $this->context->find($optionLocator, Locator::SELECTOR_XPATH);
68 throw new \Exception(
'[' . implode(
'/', $pieces) .
'] option is not visible in store switcher.');
taxRateField find('.mselect-list') .on( 'click.mselect-edit'