1 | <?php |
||
42 | class RawTqContext extends RawPageContext implements TqContextInterface |
||
43 | { |
||
44 | use Debugger; |
||
45 | use Tags; |
||
46 | |||
47 | /** |
||
48 | * Parameters of TqExtension. |
||
49 | * |
||
50 | * @var array |
||
51 | */ |
||
52 | private $parameters = []; |
||
53 | /** |
||
54 | * @var string |
||
55 | */ |
||
56 | protected static $pageUrl = ''; |
||
57 | |||
58 | /** |
||
59 | * @param string $method |
||
60 | * @param array $arguments |
||
61 | * |
||
62 | * @throws \Exception |
||
63 | * @throws ContextNotFoundException |
||
64 | * When context class cannot be loaded. |
||
65 | * |
||
66 | * @return SnippetAcceptingContext |
||
67 | */ |
||
68 | public function __call($method, array $arguments) |
||
90 | |||
91 | /** |
||
92 | * Get selector by name. |
||
93 | * |
||
94 | * @param string $name |
||
95 | * Selector name from the configuration file. |
||
96 | * |
||
97 | * @return string |
||
98 | * CSS selector. |
||
99 | * |
||
100 | * @throws \Exception |
||
101 | * If selector does not exits. |
||
102 | */ |
||
103 | public function getDrupalSelector($name) |
||
113 | |||
114 | /** |
||
115 | * {@inheritdoc} |
||
116 | */ |
||
117 | public function getDrupalText($name) |
||
122 | |||
123 | /** |
||
124 | * @param string $site |
||
125 | * Drupal site folder. |
||
126 | * |
||
127 | * @return string |
||
128 | * URL to files directory. |
||
129 | */ |
||
130 | public function getFilesUrl($site = 'default') |
||
134 | |||
135 | /** |
||
136 | * @param string $text |
||
137 | * JS code for processing. |
||
138 | * |
||
139 | * @return self |
||
140 | */ |
||
141 | protected function processJavaScript(&$text) |
||
147 | |||
148 | /** |
||
149 | * @return InitializedContextEnvironment |
||
150 | */ |
||
151 | public function getEnvironment() |
||
155 | |||
156 | /** |
||
157 | * @return Selenium2Driver |
||
158 | */ |
||
159 | public function getSessionDriver() |
||
163 | |||
164 | /** |
||
165 | * @return Session |
||
166 | */ |
||
167 | public function getWebDriverSession() |
||
171 | |||
172 | /** |
||
173 | * @todo Remove this when DrupalExtension will be used Mink >=1.6 and use $this->getSession->getWindowNames(); |
||
174 | * |
||
175 | * @return string[] |
||
176 | */ |
||
177 | public function getWindowNames() |
||
181 | |||
182 | /** |
||
183 | * @param NodeElement $element |
||
184 | * @param string $script |
||
185 | * |
||
186 | * @example |
||
187 | * $this->executeJsOnElement($this->element('*', 'Meta tags'), 'return jQuery({{ELEMENT}}).text();'); |
||
188 | * $this->executeJsOnElement($this->element('*', '#menu'), '{{ELEMENT}}.focus();'); |
||
189 | * |
||
190 | * @throws \Exception |
||
191 | * |
||
192 | * @return mixed |
||
193 | */ |
||
194 | public function executeJsOnElement(NodeElement $element, $script) |
||
208 | |||
209 | /** |
||
210 | * @param string $javascript |
||
211 | * JS code for execution. |
||
212 | * @param array $args |
||
213 | * Placeholder declarations. |
||
214 | * |
||
215 | * @return mixed |
||
216 | */ |
||
217 | public function executeJs($javascript, array $args = []) |
||
226 | |||
227 | /** |
||
228 | * Check JS events in step definition. |
||
229 | * |
||
230 | * @param StepScope $event |
||
231 | * |
||
232 | * @return int |
||
233 | */ |
||
234 | public static function isStepImpliesJsEvent(StepScope $event) |
||
238 | |||
239 | /** |
||
240 | * @return DrushDriver |
||
241 | */ |
||
242 | public function getDrushDriver() |
||
246 | |||
247 | /** |
||
248 | * Wait for all AJAX requests and jQuery animations. |
||
249 | */ |
||
250 | public function waitAjaxAndAnimations() |
||
258 | |||
259 | /** |
||
260 | * {@inheritdoc} |
||
261 | */ |
||
262 | public function setTqParameters(array $parameters) |
||
268 | |||
269 | /** |
||
270 | * {@inheritdoc} |
||
271 | */ |
||
272 | public function getTqParameter($name) |
||
276 | |||
277 | /** |
||
278 | * {@inheritdoc} |
||
279 | */ |
||
280 | public function locatePath($path = '') |
||
284 | |||
285 | /** |
||
286 | * @return string |
||
287 | * Absolute URL. |
||
288 | */ |
||
289 | public function getCurrentUrl() |
||
293 | } |
||
294 |