Skip to content

Commit cc384bd

Browse files
reinholdfuerederNaktibalda
authored andcommitted
Add HTML snapshots of failing tests to HTML Report
* #5568 Missing HTML snapshots of failing PhpBrowser acceptance tests in HTML Report after update to v3.0.x Bug was introduced via Codeception/Codeception@cca5463 Fix: In addition to saving the PhpBrowser as report 'response', also again save it as report 'html' (which is then picked up by HTML report generator in https://github.com/Codeception/phpunit-wrapper/blob/04a825f35706fce8be1c51bb975c20b450aa4571/src/ResultPrinter/HTML.php#L139-L150) Add reproducer test case in RunCest based on new "phpbrowser_html_report" test suite * #5568 Missing HTML snapshots of failing PhpBrowser acceptance tests in HTML Report after update to v3.0.x Add (actually generated) "_support/AcceptanceTester.php" like by other Codeception test (suites) * #5568 Missing HTML snapshots of failing PhpBrowser acceptance tests in HTML Report after update to v3.0.x Fix: Since using URL 'http://127.0.0.1:8000' (like in other test suites) does not work in CI (see https://ci.appveyor.com/project/DavertMik/codeception/builds/27522016) => let's naively try another rather very reliable URL, namely 'https://www.google.com' * #5568 Missing HTML snapshots of failing PhpBrowser acceptance tests in HTML Report after update to v3.0.x Fix: Test failed due to hard-coded '/' in expected absolute filename output (see https://ci.appveyor.com/project/DavertMik/codeception/builds/27522721) => use platform dependent DIRECTORY_SEPARATOR when building the expected absolute filename * #5568 Missing HTML snapshots of failing PhpBrowser acceptance tests in HTML Report after update to v3.0.x Fix: Failed again in M$ Windows CI because not the full output uses platform dependent directory separator (see https://ci.appveyor.com/project/DavertMik/codeception/builds/27523181) => make the test hopefully succeed at long last by also hard-coding the relative report path
1 parent 1bc7de3 commit cc384bd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Codeception/Lib/InnerBrowser.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function _failed(TestInterface $test, $fail)
8383

8484
$filename = mb_strcut($filename, 0, 244, 'utf-8') . '.fail.' . $extension;
8585
$this->_savePageSource($report = codecept_output_dir() . $filename);
86+
$test->getMetadata()->addReport('html', $report);
8687
$test->getMetadata()->addReport('response', $report);
8788
}
8889

0 commit comments

Comments
 (0)