|
@@ 48-60 (lines=13) @@
|
| 45 |
|
* RAW definitions of simple functions to be used in MultilingualContext |
| 46 |
|
*/ |
| 47 |
|
|
| 48 |
|
public function iClickOnTheText($text) { |
| 49 |
|
|
| 50 |
|
$session = $this->getSession(); |
| 51 |
|
$element = $session->getPage()->find( |
| 52 |
|
'xpath', |
| 53 |
|
$session->getSelectorsHandler()->selectorToXpath('xpath', '//*[contains(text(),"' . $text . '")]')); |
| 54 |
|
|
| 55 |
|
if (null === $element) { |
| 56 |
|
throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
| 57 |
|
} |
| 58 |
|
|
| 59 |
|
$element->click(); |
| 60 |
|
} |
| 61 |
|
|
| 62 |
|
public function assertValueInInput($value, $input) { |
| 63 |
|
|
|
@@ 130-141 (lines=12) @@
|
| 127 |
|
return $text; |
| 128 |
|
} |
| 129 |
|
|
| 130 |
|
public function iClickOnTheTextInRegion($text, $region) { |
| 131 |
|
|
| 132 |
|
$session = $this->getSession(); |
| 133 |
|
$element = $session->getPage()->find('region', $region)->find('xpath', $session->getSelectorsHandler()->selectorToXpath('xpath', |
| 134 |
|
'//*[contains(text(),"' . $text . '")]')); |
| 135 |
|
|
| 136 |
|
if (null === $element) { |
| 137 |
|
throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
| 138 |
|
} |
| 139 |
|
|
| 140 |
|
$element->click(); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
public function selectOptionWithJavascript($text, $region) { |
| 144 |
|
|
|
@@ 143-154 (lines=12) @@
|
| 140 |
|
$element->click(); |
| 141 |
|
} |
| 142 |
|
|
| 143 |
|
public function selectOptionWithJavascript($text, $region) { |
| 144 |
|
|
| 145 |
|
$session = $this->getSession(); |
| 146 |
|
$element = $session->getPage()->find('region', $region)->find('xpath', $session->getSelectorsHandler()->selectorToXpath('xpath', |
| 147 |
|
'//*[contains(text(),"' . $text . '")]')); |
| 148 |
|
|
| 149 |
|
if (null === $element) { |
| 150 |
|
throw new \InvalidArgumentException(sprintf('Cannot find text: "%s"', $text)); |
| 151 |
|
} |
| 152 |
|
|
| 153 |
|
$element->click(); |
| 154 |
|
} |
| 155 |
|
|
| 156 |
|
public function assertSelectRadioById($label, $id = '') { |
| 157 |
|
$element = $this->getSession()->getPage(); |