|
7 | 7 | use Codeception\Module\WebDriver; |
8 | 8 | use Codeception\Stub; |
9 | 9 | use Codeception\Stub\Expected; |
10 | | -use Codeception\Test\Metadata; |
11 | | -use Codeception\Util\Maybe; |
12 | 10 | use data; |
13 | 11 | use Facebook\WebDriver\Cookie; |
14 | 12 | use Facebook\WebDriver\Remote\DesiredCapabilities; |
@@ -569,82 +567,6 @@ public function testCreateCeptScreenshotFail() |
569 | 567 | $module->_failed($cept, new \PHPUnit\Framework\AssertionFailedError()); |
570 | 568 | } |
571 | 569 |
|
572 | | - public function testCreateCestScreenshotOnFail() |
573 | | - { |
574 | | - $fakeWd = Stub::make(self::WEBDRIVER_CLASS, [ |
575 | | - 'takeScreenshot' => Expected::once(function ($filename) { |
576 | | - Assert::assertSame(codecept_log_dir('stdClass.login.fail.png'), $filename); |
577 | | - }), |
578 | | - 'getPageSource' => Expected::once(function () { |
579 | | - }), |
580 | | - 'manage' => Stub::make('\Facebook\WebDriver\WebDriverOptions', [ |
581 | | - 'getAvailableLogTypes' => Expected::atLeastOnce(fn() => []), |
582 | | - ]), |
583 | | - ]); |
584 | | - $module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]); |
585 | | - $cest = new \Codeception\Test\Cest( |
586 | | - new class { |
587 | | - public function login() |
588 | | - { |
589 | | - } |
590 | | - }, |
591 | | - 'login', |
592 | | - 'someCest.php', |
593 | | - ); |
594 | | - $module->_failed($cest, new \PHPUnit\Framework\AssertionFailedError()); |
595 | | - } |
596 | | - |
597 | | - public function testCreateTestScreenshotOnFail() |
598 | | - { |
599 | | - $test = Stub::make( |
600 | | - \Codeception\Test\TestCaseWrapper::class, |
601 | | - [ |
602 | | - 'getSignature' => 'testLogin', |
603 | | - 'getMetadata' => new Metadata(), |
604 | | - ] |
605 | | - ); |
606 | | - $fakeWd = Stub::make(self::WEBDRIVER_CLASS, [ |
607 | | - 'takeScreenshot' => Expected::once(function ($filename) use ($test) { |
608 | | - Assert::assertSame( |
609 | | - codecept_log_dir(get_class($test) . '.testLogin.fail.png'), |
610 | | - $filename |
611 | | - ); |
612 | | - }), |
613 | | - 'getPageSource' => Expected::once(function () { |
614 | | - }), |
615 | | - 'manage' => Stub::make('\Facebook\WebDriver\WebDriverOptions', [ |
616 | | - 'getAvailableLogTypes' => Expected::atLeastOnce(fn() => []), |
617 | | - ]), |
618 | | - ]); |
619 | | - $module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]); |
620 | | - $module->_failed($test, new \PHPUnit\Framework\AssertionFailedError()); |
621 | | - } |
622 | | - |
623 | | - public function testWebDriverWaits() |
624 | | - { |
625 | | - $fakeWd = Stub::make(self::WEBDRIVER_CLASS, ['wait' => Expected::exactly(16, fn() => new Maybe())]); |
626 | | - $module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]); |
627 | | - $module->waitForElement(WebDriverBy::partialLinkText('yeah')); |
628 | | - $module->waitForElement(['id' => 'user']); |
629 | | - $module->waitForElement(['css' => '.user']); |
630 | | - $module->waitForElement('//xpath'); |
631 | | - |
632 | | - $module->waitForElementVisible(WebDriverBy::partialLinkText('yeah')); |
633 | | - $module->waitForElementVisible(['id' => 'user']); |
634 | | - $module->waitForElementVisible(['css' => '.user']); |
635 | | - $module->waitForElementVisible('//xpath'); |
636 | | - |
637 | | - $module->waitForElementNotVisible(WebDriverBy::partialLinkText('yeah')); |
638 | | - $module->waitForElementNotVisible(['id' => 'user']); |
639 | | - $module->waitForElementNotVisible(['css' => '.user']); |
640 | | - $module->waitForElementNotVisible('//xpath'); |
641 | | - |
642 | | - $module->waitForElementClickable(WebDriverBy::partialLinkText('yeah')); |
643 | | - $module->waitForElementClickable(['id' => 'user']); |
644 | | - $module->waitForElementClickable(['css' => '.user']); |
645 | | - $module->waitForElementClickable('//xpath'); |
646 | | - } |
647 | | - |
648 | 570 | public function testWaitForElement() |
649 | 571 | { |
650 | 572 | $this->module->amOnPage('/form/timeout'); |
|
0 commit comments