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

Fail or Skip if selenium server is not running? #450

Open
bobemoe opened this issue Oct 11, 2020 · 1 comment
Open

Fail or Skip if selenium server is not running? #450

bobemoe opened this issue Oct 11, 2020 · 1 comment

Comments

@bobemoe
Copy link

bobemoe commented Oct 11, 2020

I know this has been discussed quite a bit, but I'm in exactly the same situation as I know others are; we've just had some bugs get into production because the selenium server failed to start which meant all the phpunit functional tests were skipped and phpunit/CI considered this passed and allowed merge.

I agree that failed is not really appropriate as it hasn't technically failed as the test never ran. But it's also not technically successful, also as the test never ran.

But I also agree at certain points in the testing that all the tests need to run successfully for the CI to be considered passed, and there needs to be some way tell phpunit/selenium that a skipped test is not acceptable at certain stages.

The line in question is Selenium2TestCase.php#L345 and it looks like it might be quite simple to override prepareSession in my tests to change this behaviour.

This is were the functionality was added: #31 and it was questioned there. And here #307 but both these issues are very old. What is the current take on this?

Should I be overriding Selenium2TestCase:prepareSession and implementing this myself for each test-suite I maintain?

Should it be implemented within phpunit? They don't think so. sebastianbergmann/phpunit#2840

Should it be implemented in phpunit-selenium??

Or am I really misusing the system?

Thanks all :)

@bobemoe bobemoe changed the title Fail or Skip if selenium server is not running. Fail or Skip if selenium server is not running? Oct 11, 2020
@bobemoe
Copy link
Author

bobemoe commented Oct 11, 2020

OK, so not quite as easy to override Selenium2TestCase:prepareSession as getStrategy() and $session are both private.

Maybe the exception should be allowed to bubble up? This would cause a failed test, but allow the test to catch it and mark as skipped if it so wishes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant