9
9
use Codeception \Module \WebDriver ;
10
10
use Codeception \Test \Descriptor ;
11
11
use Codeception \TestInterface ;
12
+ use Yandex \Allure \Adapter \Allure ;
12
13
use Facebook \WebDriver \Interactions \WebDriverActions ;
13
14
use Codeception \Exception \ModuleConfigException ;
14
15
use Codeception \Exception \ModuleException ;
18
19
use Magento \FunctionalTestingFramework \Util \Protocol \CurlTransport ;
19
20
use Magento \FunctionalTestingFramework \Util \Protocol \CurlInterface ;
20
21
use Magento \FunctionalTestingFramework \Util \ConfigSanitizerUtil ;
22
+ use Yandex \Allure \Adapter \Event \AddAttachmentEvent ;
23
+ use Yandex \Allure \Adapter \Event \AddParameterEvent ;
21
24
use Yandex \Allure \Adapter \Support \AttachmentSupport ;
22
25
use Magento \FunctionalTestingFramework \Exceptions \TestFrameworkException ;
23
26
@@ -198,7 +201,10 @@ public function _getCurrentUri()
198
201
*/
199
202
public function dontSeeCurrentUrlEquals ($ url )
200
203
{
201
- $ this ->assertNotEquals ($ url , $ this ->webDriver ->getCurrentURL ());
204
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
205
+ $ comparison = "Expected: $ url \nActual: $ actualUrl " ;
206
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
207
+ $ this ->assertNotEquals ($ url , $ actualUrl );
202
208
}
203
209
204
210
/**
@@ -209,7 +215,10 @@ public function dontSeeCurrentUrlEquals($url)
209
215
*/
210
216
public function dontSeeCurrentUrlMatches ($ regex )
211
217
{
212
- $ this ->assertNotRegExp ($ regex , $ this ->webDriver ->getCurrentURL ());
218
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
219
+ $ comparison = "Expected: $ regex \nActual: $ actualUrl " ;
220
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
221
+ $ this ->assertNotRegExp ($ regex , $ actualUrl );
213
222
}
214
223
215
224
/**
@@ -220,7 +229,10 @@ public function dontSeeCurrentUrlMatches($regex)
220
229
*/
221
230
public function dontSeeInCurrentUrl ($ needle )
222
231
{
223
- $ this ->assertNotContains ($ needle , $ this ->webDriver ->getCurrentURL ());
232
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
233
+ $ comparison = "Expected: $ needle \nActual: $ actualUrl " ;
234
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
235
+ $ this ->assertNotContains ($ needle , $ actualUrl );
224
236
}
225
237
226
238
/**
@@ -254,7 +266,10 @@ public function grabFromCurrentUrl($regex = null)
254
266
*/
255
267
public function seeCurrentUrlEquals ($ url )
256
268
{
257
- $ this ->assertEquals ($ url , $ this ->webDriver ->getCurrentURL ());
269
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
270
+ $ comparison = "Expected: $ url \nActual: $ actualUrl " ;
271
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
272
+ $ this ->assertEquals ($ url , $ actualUrl );
258
273
}
259
274
260
275
/**
@@ -265,7 +280,10 @@ public function seeCurrentUrlEquals($url)
265
280
*/
266
281
public function seeCurrentUrlMatches ($ regex )
267
282
{
268
- $ this ->assertRegExp ($ regex , $ this ->webDriver ->getCurrentURL ());
283
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
284
+ $ comparison = "Expected: $ regex \nActual: $ actualUrl " ;
285
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
286
+ $ this ->assertRegExp ($ regex , $ url );
269
287
}
270
288
271
289
/**
@@ -276,7 +294,10 @@ public function seeCurrentUrlMatches($regex)
276
294
*/
277
295
public function seeInCurrentUrl ($ needle )
278
296
{
279
- $ this ->assertContains ($ needle , $ this ->webDriver ->getCurrentURL ());
297
+ $ actualUrl = $ this ->webDriver ->getCurrentURL ();
298
+ $ comparison = "Expected: $ needle \nActual: $ actualUrl " ;
299
+ Allure::lifecycle ()->fire (new AddAttachmentEvent ($ comparison , 'Comparison ' ));
300
+ $ this ->assertContains ($ needle , $ actualUrl );
280
301
}
281
302
282
303
/**
0 commit comments