Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/web/TestsForWeb.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testSeeLinkFailsIfHrefDoesNotMatch()
public function testSeeLinkFailsIfHrefDoesNotMatchExactly()
{
$this->expectException('PHPUnit\Framework\AssertionFailedError');
$this->expectExceptionMessage("No links containing text 'Next' and URL 'http://codeception' were found in page /external_url");
$this->expectExceptionMessage("No links containing text 'Next' and URL 'https://codeception' were found in page /external_url");
$this->module->amOnPage('/external_url');
$this->module->seeLink('Next', 'https://codeception');
}
Expand Down
19 changes: 17 additions & 2 deletions tests/web/WebDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Codeception\Module\WebDriver;
use Codeception\Stub;
use Codeception\Stub\Expected;
use Codeception\Test\Metadata;
use Codeception\Util\Maybe;
use data;
use Facebook\WebDriver\Cookie;
Expand Down Expand Up @@ -581,13 +582,27 @@ public function testCreateCestScreenshotOnFail()
]),
]);
$module = Stub::make(self::MODULE_CLASS, ['webDriver' => $fakeWd]);
$cest = new \Codeception\Test\Cest(new \stdClass(), 'login', 'someCest.php');
$cest = new \Codeception\Test\Cest(
new class {
public function login()
{
}
},
'login',
'someCest.php',
);
$module->_failed($cest, new \PHPUnit\Framework\AssertionFailedError());
}

public function testCreateTestScreenshotOnFail()
{
$test = Stub::make(\Codeception\Test\Unit::class, ['getName' => 'testLogin']);
$test = Stub::make(
\Codeception\Test\TestCaseWrapper::class,
[
'getSignature' => 'testLogin',
'getMetadata' => new Metadata(),
]
);
$fakeWd = Stub::make(self::WEBDRIVER_CLASS, [
'takeScreenshot' => Expected::once(function ($filename) use ($test) {
Assert::assertSame(
Expand Down