Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
dev
tests
functional
lib
Magento
Mtf
Client
Element
SwitcherElement.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\Mtf\Client\Element
;
8
9
use Magento\Mtf\Client\Locator;
10
15
class
SwitcherElement
extends
SimpleElement
16
{
22
protected
$parentContainer
=
'parent::div[@data-role="switcher"]'
;
23
29
private
$labelText =
'./following-sibling::label'
;
30
37
public
function
setValue
(
$value
)
38
{
39
if
((
$value
!=
'Yes'
) && (
$value
!=
'No'
)) {
40
throw
new \UnexpectedValueException(
41
sprintf(
'Switcher element accepts only "Yes" and "No" values.'
)
42
);
43
}
44
if
(
$value
!= $this->
getValue
()) {
45
$this->
find
($this->labelText, Locator::SELECTOR_XPATH)->click();
46
}
47
}
48
55
public
function
getValue
()
56
{
57
if
($this->
find
($this->parentContainer,
'xpath'
)->
find
(
'input:checked'
)->isVisible()) {
58
return
'Yes'
;
59
}
elseif
($this->
find
($this->parentContainer,
'xpath'
)->
find
(
'input'
)->isVisible()) {
60
return
'No'
;
61
}
else
{
62
throw
new \Exception(
63
sprintf(
'Element %s not found on page'
, $this->getLocator())
64
);
65
}
66
}
67
}
Magento\Mtf\Client\Element\SwitcherElement
Definition:
SwitcherElement.php:15
elseif
elseif(isset( $params[ 'redirect_parent']))
Definition:
iframe.phtml:17
Magento\Mtf\Client\Element\SwitcherElement\$parentContainer
$parentContainer
Definition:
SwitcherElement.php:22
Magento\Mtf\Client\Element\SwitcherElement\setValue
setValue($value)
Definition:
SwitcherElement.php:37
find
taxRateField find('.mselect-list') .on( 'click.mselect-edit'
Definition:
edit.phtml:162
$value
$value
Definition:
gender.phtml:16
Magento\Mtf\Client\Element
Definition:
ConditionsElement.php:7
Magento\Mtf\Client\Element\SwitcherElement\getValue
getValue()
Definition:
SwitcherElement.php:55