@@ -348,7 +348,8 @@ public function waitFor(string $locator, int $timeoutInSecond = 30, int $interva
348
348
$ by = self ::createWebDriverByFromLocator ($ locator );
349
349
350
350
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
351
- WebDriverExpectedCondition::presenceOfElementLocated ($ by )
351
+ WebDriverExpectedCondition::presenceOfElementLocated ($ by ),
352
+ \sprintf ('Element "%s" not found within %d seconds. ' , $ locator , $ timeoutInSecond ),
352
353
);
353
354
354
355
return $ this ->crawler = $ this ->createCrawler ();
@@ -367,7 +368,8 @@ public function waitForStaleness(string $locator, int $timeoutInSecond = 30, int
367
368
$ element = $ this ->findElement ($ by );
368
369
369
370
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
370
- WebDriverExpectedCondition::stalenessOf ($ element )
371
+ WebDriverExpectedCondition::stalenessOf ($ element ),
372
+ \sprintf ('Element "%s" did not become stale within %d seconds. ' , $ locator , $ timeoutInSecond ),
371
373
);
372
374
373
375
return $ this ->crawler = $ this ->createCrawler ();
@@ -384,7 +386,8 @@ public function waitForVisibility(string $locator, int $timeoutInSecond = 30, in
384
386
$ by = self ::createWebDriverByFromLocator ($ locator );
385
387
386
388
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
387
- WebDriverExpectedCondition::visibilityOfElementLocated ($ by )
389
+ WebDriverExpectedCondition::visibilityOfElementLocated ($ by ),
390
+ \sprintf ('Element "%s" did not become visible within %d seconds. ' , $ locator , $ timeoutInSecond ),
388
391
);
389
392
390
393
return $ this ->crawler = $ this ->createCrawler ();
@@ -401,7 +404,8 @@ public function waitForInvisibility(string $locator, int $timeoutInSecond = 30,
401
404
$ by = self ::createWebDriverByFromLocator ($ locator );
402
405
403
406
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
404
- WebDriverExpectedCondition::invisibilityOfElementLocated ($ by )
407
+ WebDriverExpectedCondition::invisibilityOfElementLocated ($ by ),
408
+ \sprintf ('Element "%s" did not become invisible within %d seconds. ' , $ locator , $ timeoutInSecond ),
405
409
);
406
410
407
411
return $ this ->crawler = $ this ->createCrawler ();
@@ -418,7 +422,8 @@ public function waitForElementToContain(string $locator, string $text, int $time
418
422
$ by = self ::createWebDriverByFromLocator ($ locator );
419
423
420
424
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
421
- WebDriverExpectedCondition::elementTextContains ($ by , $ text )
425
+ WebDriverExpectedCondition::elementTextContains ($ by , $ text ),
426
+ \sprintf ('Element "%s" did not contain "%s" within %d seconds. ' , $ locator , $ text , $ timeoutInSecond ),
422
427
);
423
428
424
429
return $ this ->crawler = $ this ->createCrawler ();
@@ -435,7 +440,8 @@ public function waitForElementToNotContain(string $locator, string $text, int $t
435
440
$ by = self ::createWebDriverByFromLocator ($ locator );
436
441
437
442
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
438
- PantherWebDriverExpectedCondition::elementTextNotContains ($ by , $ text )
443
+ PantherWebDriverExpectedCondition::elementTextNotContains ($ by , $ text ),
444
+ \sprintf ('Element "%s" still contained "%s" after %d seconds. ' , $ locator , $ text , $ timeoutInSecond ),
439
445
);
440
446
441
447
return $ this ->crawler = $ this ->createCrawler ();
@@ -452,7 +458,8 @@ public function waitForAttributeToContain(string $locator, string $attribute, st
452
458
$ by = self ::createWebDriverByFromLocator ($ locator );
453
459
454
460
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
455
- PantherWebDriverExpectedCondition::elementAttributeContains ($ by , $ attribute , $ text )
461
+ PantherWebDriverExpectedCondition::elementAttributeContains ($ by , $ attribute , $ text ),
462
+ \sprintf ('Element "%s" attribute "%s" did not contain "%s" within %d seconds. ' , $ locator , $ attribute , $ text , $ timeoutInSecond ),
456
463
);
457
464
458
465
return $ this ->crawler = $ this ->createCrawler ();
@@ -469,7 +476,8 @@ public function waitForAttributeToNotContain(string $locator, string $attribute,
469
476
$ by = self ::createWebDriverByFromLocator ($ locator );
470
477
471
478
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
472
- PantherWebDriverExpectedCondition::elementAttributeNotContains ($ by , $ attribute , $ text )
479
+ PantherWebDriverExpectedCondition::elementAttributeNotContains ($ by , $ attribute , $ text ),
480
+ \sprintf ('Element "%s" attribute "%s" still contained "%s" after %d seconds. ' , $ locator , $ attribute , $ text , $ timeoutInSecond ),
473
481
);
474
482
475
483
return $ this ->crawler = $ this ->createCrawler ();
@@ -486,7 +494,8 @@ public function waitForEnabled(string $locator, int $timeoutInSecond = 30, int $
486
494
$ by = self ::createWebDriverByFromLocator ($ locator );
487
495
488
496
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
489
- PantherWebDriverExpectedCondition::elementEnabled ($ by )
497
+ PantherWebDriverExpectedCondition::elementEnabled ($ by ),
498
+ \sprintf ('Element "%s" did not become enabled within %d seconds. ' , $ locator , $ timeoutInSecond ),
490
499
);
491
500
492
501
return $ this ->crawler = $ this ->createCrawler ();
@@ -503,7 +512,8 @@ public function waitForDisabled(string $locator, int $timeoutInSecond = 30, int
503
512
$ by = self ::createWebDriverByFromLocator ($ locator );
504
513
505
514
$ this ->wait ($ timeoutInSecond , $ intervalInMillisecond )->until (
506
- PantherWebDriverExpectedCondition::elementDisabled ($ by )
515
+ PantherWebDriverExpectedCondition::elementDisabled ($ by ),
516
+ \sprintf ('Element "%s" did not become disabled within %d seconds. ' , $ locator , $ timeoutInSecond ),
507
517
);
508
518
509
519
return $ this ->crawler = $ this ->createCrawler ();
0 commit comments