1 | <?php |
||
38 | class RawTqContext extends RawPageContext implements TqContextInterface |
||
39 | { |
||
40 | use TqUtils\Interaction; |
||
41 | |||
42 | /** |
||
43 | * Parameters of TqExtension. |
||
44 | * |
||
45 | * @var array |
||
46 | */ |
||
47 | private $parameters = []; |
||
48 | /** |
||
49 | * @var string |
||
50 | */ |
||
51 | protected static $pageUrl = ''; |
||
52 | |||
53 | /** |
||
54 | * @param string $method |
||
55 | * @param array $arguments |
||
56 | * |
||
57 | * @throws \Exception |
||
58 | * @throws ContextNotFoundException |
||
59 | * When context class cannot be loaded. |
||
60 | * |
||
61 | * @return SnippetAcceptingContext |
||
62 | */ |
||
63 | public function __call($method, array $arguments) |
||
85 | |||
86 | /** |
||
87 | * @param array $variables |
||
88 | * An associative array where key is a variable name and a value - value. |
||
89 | */ |
||
90 | public static function setDrupalVariables(array $variables) |
||
96 | |||
97 | /** |
||
98 | * Get selector by name. |
||
99 | * |
||
100 | * @param string $name |
||
101 | * Selector name from the configuration file. |
||
102 | * |
||
103 | * @return string |
||
104 | * CSS selector. |
||
105 | * |
||
106 | * @throws \Exception |
||
107 | * If selector does not exits. |
||
108 | */ |
||
109 | public function getDrupalSelector($name) |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getDrupalText($name) |
||
128 | |||
129 | /** |
||
130 | * @param string $site |
||
131 | * Drupal site folder. |
||
132 | * |
||
133 | * @return string |
||
134 | * URL to files directory. |
||
135 | */ |
||
136 | public function getFilesUrl($site = 'default') |
||
140 | |||
141 | /** |
||
142 | * @param string $text |
||
143 | * JS code for processing. |
||
144 | * |
||
145 | * @return self |
||
146 | */ |
||
147 | protected function processJavaScript(&$text) |
||
153 | |||
154 | /** |
||
155 | * @return InitializedContextEnvironment |
||
156 | */ |
||
157 | public function getEnvironment() |
||
161 | |||
162 | /** |
||
163 | * @return Selenium2Driver |
||
164 | */ |
||
165 | public function getSessionDriver() |
||
169 | |||
170 | /** |
||
171 | * @return Session |
||
172 | */ |
||
173 | public function getWebDriverSession() |
||
177 | |||
178 | /** |
||
179 | * @todo Remove this when DrupalExtension will be used Mink >=1.6 and use $this->getSession->getWindowNames(); |
||
180 | * |
||
181 | * @return string[] |
||
182 | */ |
||
183 | public function getWindowNames() |
||
187 | |||
188 | /** |
||
189 | * @param NodeElement $element |
||
190 | * @param string $script |
||
191 | * |
||
192 | * @example |
||
193 | * $this->executeJsOnElement($this->element('*', 'Meta tags'), 'return jQuery({{ELEMENT}}).text();'); |
||
194 | * $this->executeJsOnElement($this->element('*', '#menu'), '{{ELEMENT}}.focus();'); |
||
195 | * |
||
196 | * @throws \Exception |
||
197 | * |
||
198 | * @return mixed |
||
199 | */ |
||
200 | public function executeJsOnElement(NodeElement $element, $script) |
||
214 | |||
215 | /** |
||
216 | * @param string $javascript |
||
217 | * JS code for execution. |
||
218 | * @param array $args |
||
219 | * Placeholder declarations. |
||
220 | * |
||
221 | * @return mixed |
||
222 | */ |
||
223 | public function executeJs($javascript, array $args = []) |
||
232 | |||
233 | /** |
||
234 | * Check JS events in step definition. |
||
235 | * |
||
236 | * @param StepScope $event |
||
237 | * |
||
238 | * @return int |
||
239 | */ |
||
240 | public static function isStepImpliesJsEvent(StepScope $event) |
||
244 | |||
245 | /** |
||
246 | * @return DrushDriver |
||
247 | */ |
||
248 | public function getDrushDriver() |
||
252 | |||
253 | /** |
||
254 | * Wait for all AJAX requests and jQuery animations. |
||
255 | */ |
||
256 | public function waitAjaxAndAnimations() |
||
261 | |||
262 | /** |
||
263 | * {@inheritdoc} |
||
264 | */ |
||
265 | public function setTqParameters(array $parameters) |
||
271 | |||
272 | /** |
||
273 | * @param string $name |
||
274 | * The name of parameter from behat.yml. |
||
275 | * |
||
276 | * @return mixed |
||
277 | */ |
||
278 | public function getTqParameter($name) |
||
282 | |||
283 | /** |
||
284 | * {@inheritdoc} |
||
285 | */ |
||
286 | public function locatePath($path = '') |
||
333 | |||
334 | /** |
||
335 | * @return string |
||
336 | */ |
||
337 | public function getCurrentUrl() |
||
341 | } |
||
342 |