Skip to content

Commit 7a692ed

Browse files
author
Oleksii Korshenko
committed
MAGETWO-57568: [Backport] Functional upgrade test fail - 2.0
1 parent ccbb1db commit 7a692ed

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Client\Element;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Custom checkbox that hidden by label
13+
*/
14+
class CheckboxwithlabelElement extends CheckboxElement
15+
{
16+
/**
17+
* Set checkbox value by clicking on label
18+
*
19+
* @param string $value
20+
*/
21+
public function setValue($value)
22+
{
23+
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
24+
if (($this->isSelected() && $value == 'No') || (!$this->isSelected() && $value == 'Yes')) {
25+
$this->find('./following-sibling::label', Locator::SELECTOR_XPATH)->click();
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)