| 1 | <?php |
||
| 13 | class CountHelper extends \Codeception\Module |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @param string $cssOrXpath |
||
| 17 | * @throws \Codeception\Exception\ModuleException |
||
| 18 | * @return int |
||
| 19 | */ |
||
| 20 | public function countElements(string $cssOrXpath): int |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Returns position of the element in the set of elements. |
||
| 29 | * |
||
| 30 | * The position counts from 0. |
||
| 31 | * If the element is not found in the set -1 will be returned. |
||
| 32 | * |
||
| 33 | * ```html |
||
| 34 | * <ul> |
||
| 35 | * <li></li> |
||
| 36 | * <li></li> |
||
| 37 | * <li class="target"></li> |
||
| 38 | * <li></li> |
||
| 39 | * </ul> |
||
| 40 | * <img /> |
||
| 41 | * ''' |
||
| 42 | * |
||
| 43 | * ```php |
||
| 44 | * indexOf('li.target', 'li') => 2 |
||
| 45 | * indexOf('img', 'li') => -1 |
||
| 46 | * ``` |
||
| 47 | * @param string $elementSelector |
||
| 48 | * @param string $setSelector |
||
| 49 | * @return int |
||
| 50 | * @throws \Codeception\Exception\ModuleException |
||
| 51 | */ |
||
| 52 | public function indexOf(string $elementSelector, string $setSelector): int |
||
| 61 | } |
||
| 62 |