1 | <?php |
||
39 | class RawTqContext extends RawPageContext implements TqContextInterface |
||
40 | { |
||
41 | use Debugger; |
||
42 | use Tags; |
||
43 | |||
44 | /** |
||
45 | * Parameters of TqExtension. |
||
46 | * |
||
47 | * @var array |
||
48 | */ |
||
49 | private $parameters = []; |
||
50 | /** |
||
51 | * @var string |
||
52 | */ |
||
53 | protected static $pageUrl = ''; |
||
54 | |||
55 | /** |
||
56 | * @param string $method |
||
57 | * @param array $arguments |
||
58 | * |
||
59 | * @throws \Exception |
||
60 | * @throws ContextNotFoundException |
||
61 | * When context class cannot be loaded. |
||
62 | * |
||
63 | * @return SnippetAcceptingContext |
||
64 | */ |
||
65 | public function __call($method, array $arguments) |
||
87 | |||
88 | /** |
||
89 | * @param array $variables |
||
90 | * An associative array where key is a variable name and a value - value. |
||
91 | */ |
||
92 | public static function setDrupalVariables(array $variables) |
||
98 | |||
99 | /** |
||
100 | * Get selector by name. |
||
101 | * |
||
102 | * @param string $name |
||
103 | * Selector name from the configuration file. |
||
104 | * |
||
105 | * @return string |
||
106 | * CSS selector. |
||
107 | * |
||
108 | * @throws \Exception |
||
109 | * If selector does not exits. |
||
110 | */ |
||
111 | public function getDrupalSelector($name) |
||
121 | |||
122 | /** |
||
123 | * {@inheritdoc} |
||
124 | */ |
||
125 | public function getDrupalText($name) |
||
130 | |||
131 | /** |
||
132 | * @param string $site |
||
133 | * Drupal site folder. |
||
134 | * |
||
135 | * @return string |
||
136 | * URL to files directory. |
||
137 | */ |
||
138 | public function getFilesUrl($site = 'default') |
||
142 | |||
143 | /** |
||
144 | * @param string $text |
||
145 | * JS code for processing. |
||
146 | * |
||
147 | * @return self |
||
148 | */ |
||
149 | protected function processJavaScript(&$text) |
||
155 | |||
156 | /** |
||
157 | * @return InitializedContextEnvironment |
||
158 | */ |
||
159 | public function getEnvironment() |
||
163 | |||
164 | /** |
||
165 | * @return Selenium2Driver |
||
166 | */ |
||
167 | public function getSessionDriver() |
||
171 | |||
172 | /** |
||
173 | * @return Session |
||
174 | */ |
||
175 | public function getWebDriverSession() |
||
179 | |||
180 | /** |
||
181 | * @todo Remove this when DrupalExtension will be used Mink >=1.6 and use $this->getSession->getWindowNames(); |
||
182 | * |
||
183 | * @return string[] |
||
184 | */ |
||
185 | public function getWindowNames() |
||
189 | |||
190 | /** |
||
191 | * @param NodeElement $element |
||
192 | * @param string $script |
||
193 | * |
||
194 | * @example |
||
195 | * $this->executeJsOnElement($this->element('*', 'Meta tags'), 'return jQuery({{ELEMENT}}).text();'); |
||
196 | * $this->executeJsOnElement($this->element('*', '#menu'), '{{ELEMENT}}.focus();'); |
||
197 | * |
||
198 | * @throws \Exception |
||
199 | * |
||
200 | * @return mixed |
||
201 | */ |
||
202 | public function executeJsOnElement(NodeElement $element, $script) |
||
216 | |||
217 | /** |
||
218 | * @param string $javascript |
||
219 | * JS code for execution. |
||
220 | * @param array $args |
||
221 | * Placeholder declarations. |
||
222 | * |
||
223 | * @return mixed |
||
224 | */ |
||
225 | public function executeJs($javascript, array $args = []) |
||
234 | |||
235 | /** |
||
236 | * @param string $file |
||
237 | * Existing file from "src/JavaScript" without ".js" extension. |
||
238 | * @param bool $delete |
||
239 | * Whether injection should be deleted. |
||
240 | */ |
||
241 | protected static function injectCustomJavascript($file, $delete = false) |
||
266 | |||
267 | /** |
||
268 | * Check JS events in step definition. |
||
269 | * |
||
270 | * @param StepScope $event |
||
271 | * |
||
272 | * @return int |
||
273 | */ |
||
274 | public static function isStepImpliesJsEvent(StepScope $event) |
||
278 | |||
279 | /** |
||
280 | * @return DrushDriver |
||
281 | */ |
||
282 | public function getDrushDriver() |
||
286 | |||
287 | /** |
||
288 | * Wait for all AJAX requests and jQuery animations. |
||
289 | */ |
||
290 | public function waitAjaxAndAnimations() |
||
295 | |||
296 | /** |
||
297 | * {@inheritdoc} |
||
298 | */ |
||
299 | public function setTqParameters(array $parameters) |
||
305 | |||
306 | /** |
||
307 | * @param string $name |
||
308 | * The name of parameter from behat.yml. |
||
309 | * |
||
310 | * @return mixed |
||
311 | */ |
||
312 | public function getTqParameter($name) |
||
316 | |||
317 | /** |
||
318 | * {@inheritdoc} |
||
319 | */ |
||
320 | public function locatePath($path = '') |
||
367 | |||
368 | /** |
||
369 | * @return string |
||
370 | */ |
||
371 | public function getCurrentUrl() |
||
375 | } |
||
376 |