I am running codeception 2 with selenium. I can see selenium open the browser and run through the tests. Then I get an error from codeception that there is a failed assertion.
I know there is an HTML file that is saved, but there is a lot of JS, so I can't really analyze that. I need the firefox window to stay open so I can see the output and figure out what is wrong.
How can I do this? I am already running selenium with -browserSessionReuse
If it makes a difference, it's happening inside $I->haveFriend(); $friend->does() statement.
There no straight solution how to do this, but some tricks can be used:
If you are running Cest style tests, try
public function _failed(AcceptanceTester $I)
{
$I->pauseExecution();
}
That will hold the browser window open until you hit enter in case of a failure.
Alternatively, you could take a screenshot upon test failure.
public function _failed(AcceptanceTester $I)
{
$I->makeScreenshot('test_failed_screenshot' . time());
}
This will save a screenshot at the point of failure in tests > output > debug. My cests have several tests within them, so I use the time() to give variation to the failed screenshot names to ensure I have a screenshot for every failed tests.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With