1 | <?php |
||
13 | trait Spinner |
||
14 | { |
||
15 | /** |
||
16 | * @param $lambda |
||
17 | * @param int $wait |
||
18 | * @return bool |
||
19 | * @throws \Exception |
||
20 | */ |
||
21 | public function spin($lambda, $wait = 60) |
||
37 | |||
38 | /** |
||
39 | * Spin until element is visible. Default timeout is 60 seconds. |
||
40 | * |
||
41 | * @param string|Object $element |
||
42 | * @param int $wait |
||
43 | */ |
||
44 | public function spinUntilVisible($element, $wait = 60) |
||
50 | |||
51 | /** |
||
52 | * Spin until element is not visible. Default timeout is 60 seconds. |
||
53 | * |
||
54 | * @param string|Object $element |
||
55 | * @param int $wait |
||
56 | */ |
||
57 | public function spinUntilInvisible($element, $wait = 60) |
||
63 | |||
64 | /** |
||
65 | * Spin and click element. Default timeout is 60 seconds. |
||
66 | * |
||
67 | * @param string|Object $element |
||
68 | * @param int $wait |
||
69 | */ |
||
70 | public function spinAndClick($element, $wait = 60) |
||
76 | |||
77 | /** |
||
78 | * Spin and press element. Default timeout is 60 seconds. |
||
79 | * |
||
80 | * @param string|Object $element |
||
81 | * @param int $wait |
||
82 | */ |
||
83 | public function spinAndPress($element, $wait = 60) |
||
89 | |||
90 | /** |
||
91 | * @throws \Exception |
||
92 | */ |
||
93 | protected function _throwBacktraceException() |
||
102 | |||
103 | /** |
||
104 | * @param $context |
||
105 | * @param $element |
||
106 | * @param $action |
||
107 | * @param null $condition |
||
108 | * @return bool |
||
109 | */ |
||
110 | private function _spinnerAction($context, $element, $action, $condition = null) |
||
126 | } |
||
127 |