Codeception 2.2 Protocol error with code coverage

Created on 7 Jun 2016  路  4Comments  路  Source: Codeception/Codeception

I'm running the tests on a Vagrant provisioned VirtualBox with CentOS as the guest and Windows as the host OS using a vboxsf mounted file system.

With Codeception 2.1 it worked but with Codeception 2.2 I get a protocol error.

For me it looks like it's caused be the : in the filename like MyTestCest:myTestMethod.fail.html because the : is invalid for Windows filenames.

In Codeception 2.1 filenames looked like MyTestCest.myTestMethod.fail.html (. instead of :)

I can run the test successfully when I write the results to a directory inside the VM that's not mounted/mapped with/to Windows.

BUG

Most helpful comment

This bug seems to be related to the function _failed in \Codeception\Lib\InnerBrowser because changing line 61 from

$this->_savePageSource(codecept_output_dir().str_replace(['::', '\\', '/'], ['.', '.', '.'], Descriptor::getTestSignature($test)) . '.fail.html');

to

$this->_savePageSource(codecept_output_dir().str_replace([':', '\\', '/'], ['.', '.', '.'], Descriptor::getTestSignature($test)) . '.fail.html');

fixes the problem for me.
But I'm not sure if this is the wanted behavior

All 4 comments

This bug seems to be related to the function _failed in \Codeception\Lib\InnerBrowser because changing line 61 from

$this->_savePageSource(codecept_output_dir().str_replace(['::', '\\', '/'], ['.', '.', '.'], Descriptor::getTestSignature($test)) . '.fail.html');

to

$this->_savePageSource(codecept_output_dir().str_replace([':', '\\', '/'], ['.', '.', '.'], Descriptor::getTestSignature($test)) . '.fail.html');

fixes the problem for me.
But I'm not sure if this is the wanted behavior

sorry what are the difference between those 2 lines?

It's the double :: vs : as the first value of the first argument to str_replace

@DavertMik
I will close this issue because fix for #3207 will also be valid for this.

Thanks

Was this page helpful?
0 / 5 - 0 ratings