I want to measure code coverage of an HTML test suite for selenium. Therefore I want to use PHPUnit in order to execute the suite, because PHPUnit has nice support for code coverage analysis.
Therefore: Is it possible to run an HTML test suite from PHPUnit?
Short answer
Running individual HTML test files is not a problem, running HTML suites files however does not seem to work. As long as you put all the HTML test files from a suit in a directory by themselves you can just run
runSelenese($folderName)Long answer
I had no idea that running Selenium HTML files directly was even possible until I did some more digging.
What I used to do is convert/export them first with the Selenium IDE PHP Formatter plugin for Firefox.
Apparently this is not necessary. All the way at the bottom of
Chapter 17. PHPUnit and Seleniumthe manual states:Once you have your Tests in PHPUnit you can use it to get code coverage from the Selenium Server.
Again, from the manual:
As this can be a bit of a hassle to set up, I’ve always just used the Page Coverage plugin to get an insight into HTML page coverage.