@@ 87-97 (lines=11) @@ | ||
84 | * |
|
85 | * @BeforeStep |
|
86 | */ |
|
87 | public function beforeJavascriptStep($event) { |
|
88 | /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ |
|
89 | $tags = $event->getFeature()->getTags(); |
|
90 | if (!in_array('javascript', $tags)) { |
|
91 | return; |
|
92 | } |
|
93 | $text = $event->getStep()->getText(); |
|
94 | if (preg_match('/(follow|press|click|submit)/i', $text)) { |
|
95 | $this->iWaitForAjaxToFinish(); |
|
96 | } |
|
97 | } |
|
98 | ||
99 | /** |
|
100 | * For javascript enabled scenarios, always wait for AJAX after clicking. |
|
@@ 104-114 (lines=11) @@ | ||
101 | * |
|
102 | * @AfterStep |
|
103 | */ |
|
104 | public function afterJavascriptStep($event) { |
|
105 | /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ |
|
106 | $tags = $event->getFeature()->getTags(); |
|
107 | if (!in_array('javascript', $tags)) { |
|
108 | return; |
|
109 | } |
|
110 | $text = $event->getStep()->getText(); |
|
111 | if (preg_match('/(follow|press|click|submit)/i', $text)) { |
|
112 | $this->iWaitForAjaxToFinish(); |
|
113 | } |
|
114 | } |
|
115 | ||
116 | /** |
|
117 | * Wait for AJAX to finish. |