Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML result writer images/source have incorrect img src/href src #3857

CABellamy opened this issue Dec 21, 2016 · 2 comments

HTML result writer images/source have incorrect img src/href src #3857

CABellamy opened this issue Dec 21, 2016 · 2 comments


Copy link

@CABellamy CABellamy commented Dec 21, 2016

What are you trying to achieve?

using the default --html result printer this is currently expecting the supporting files to be located in a folder called _output/_output

my output folder is configured in my codeception.yml file as such

actor: Tester
    tests: tests
    log: tests/_output
    data: tests
    support: tests/_support

I expect the html reports to put the supporting files in tests/_output and the html report to reference these locations from tests/output

What do you get instead?

The HTML report is referencing tests/_output/_output as the location of the supporting files

Setting this to tests/_output/_output will actually make the report use /_output/_output/_output/_output as the location this appears to be a bug where the key is used but doubled. No matter what I set this to the supporting files are always just put in tests/output as expected but the html report is looking for them in output/output erroneously.

The failure image here is prepending _output to the img src despite not putting the files here. IF you create a folder called _output the result printer isn't writing the files here and putting them in the root of the folder specified in log: config key.

<td class="error"><div class="screenshot"><img src="_output/" alt="failure screenshot"></div></td>

  • Codeception version: 2.2.7
  • PHP Version: 5.6.27 (also happens on 7)
  • Operating System: OS X
  • Installation type: Composer
  • List of installed packages (composer show)
behat/gherkin                      v4.4.5 Gherkin DSL parser for PHP 5.3
codeception/base                   2.2.7  BDD-style testing framework
doctrine/instantiator              1.0.5  A small, lightweight utility to instantiate objects in PHP without invoking their constructors
facebook/webdriver                 1.2.0  A PHP client for WebDriver
flow/jsonpath                      0.3.4  JSONPath implementation for parsing, searching and flattening arrays
gaming/codeception                 v1.0.0 A series of common testing functionality that can be shared across all gaming products.
guzzlehttp/guzzle                  6.2.2  Guzzle is a PHP HTTP client library
guzzlehttp/promises                1.3.0  Guzzle promises library
guzzlehttp/psr7                    1.3.1  PSR-7 message implementation
myclabs/deep-copy                  1.5.5  Create deep copies (clones) of your objects
phpdocumentor/reflection-common    1.0    Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock  3.1.1  With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve informa...
phpdocumentor/type-resolver        0.2.1
phpspec/prophecy                   v1.6.2 Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage          4.0.3  Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator          1.4.2  FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template          1.2.1  Simple template engine.
phpunit/php-timer                  1.0.8  Utility class for timing
phpunit/php-token-stream           1.4.9  Wrapper around PHP's tokenizer extension.
phpunit/phpunit                    5.7.4  The PHP Unit Testing framework.
phpunit/phpunit-mock-objects       3.4.3  Mock Object library for PHPUnit
psr/http-message                   1.0.1  Common interface for HTTP messages
psr/log                            1.0.2  Common interface for logging libraries
sebastian/code-unit-reverse-lookup 1.0.0  Looks up which function or method a line of code belongs to
sebastian/comparator               1.2.2  Provides the functionality to compare PHP values for equality
sebastian/diff                     1.4.1  Diff implementation
sebastian/environment              2.0.0  Provides functionality to handle HHVM/PHP environments
sebastian/exporter                 2.0.0  Provides the functionality to export PHP variables for visualization
sebastian/global-state             1.1.1  Snapshotting of global state
sebastian/object-enumerator        2.0.0  Traverses array structures and object graphs to enumerate all referenced objects
sebastian/recursion-context        2.0.0  Provides functionality to recursively process PHP variables
sebastian/resource-operations      1.0.0  Provides a list of PHP built-in functions that operate on resources
sebastian/version                  2.0.1  Library that helps with managing the version number of Git-hosted PHP projects
sky/aapi                           1.0.6  Sky Betting & Gaming Automation API
sky/util                           1.0.11 Sky Betting & Gaming Automation Utilities
symfony/browser-kit                v3.2.1 Symfony BrowserKit Component
symfony/console                    v3.2.1 Symfony Console Component
symfony/css-selector               v3.2.1 Symfony CssSelector Component
symfony/debug                      v3.2.1 Symfony Debug Component
symfony/dom-crawler                v3.2.1 Symfony DomCrawler Component
symfony/event-dispatcher           v3.2.1 Symfony EventDispatcher Component
symfony/finder                     v3.2.1 Symfony Finder Component
symfony/polyfill-mbstring          v1.3.0 Symfony polyfill for the Mbstring extension
symfony/yaml                       v3.2.1 Symfony Yaml Component
webmozart/assert                   1.2.0  Assertions to validate method input/output with nice error messages.
  • Suite configuration:
actor: Tester
    tests: tests
    log: tests/_output
    data: tests/_data
    support: tests/_Support
    colors: true
    memory_limit: 2048M
        - Codeception\Extension\RunFailed
Copy link

@DavertMik DavertMik commented Jan 17, 2017

Thanks for the report, looks interesting. In my case image URI was prepended by ../ so it was


need to check it

Copy link

@DavertMik DavertMik commented Jan 17, 2017

Oh, I see the bug was at this line:

$localPath = PathResolver::getRelativeDir($reports['png'], codecept_data_dir());

Somehow I've mistaken and used data dir as current directory. In case of data dir was configured to be tests/_data, this worked without problems. But definitely this is a bug

DavertMik added a commit that referenced this issue Jan 17, 2017
DavertMik added a commit that referenced this issue Jan 18, 2017
* Fixed output path in HTML reporter. Fixes #3857

* referted removal of var
chris1312 pushed a commit to chris1312/Codeception that referenced this issue Jun 16, 2017
* Fixed output path in HTML reporter. Fixes Codeception#3857

* referted removal of var
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.