I was able to install Selenium and able to install PHPUnit.
When I run unit tests, it writes a great looking report of my code coverage from the standpoint of my unit tests.
But when I run the functional tests, it writes files to my coverage directory that says 0/0 lines passed 100%
I have been up and down trying to figure out how to get the coverage to work for Selenium / functional tests.
Thanks,
Alan
Page 1 of 1
Selenium Code Coverage is blank
#2
Posted 09 August 2012 - 04:49 PM
Asterisk Pound, on 30 April 2012 - 06:10 PM, said:
I was able to install Selenium and able to install PHPUnit.
When I run unit tests, it writes a great looking report of my code coverage from the standpoint of my unit tests.
But when I run the functional tests, it writes files to my coverage directory that says 0/0 lines passed 100%
I have been up and down trying to figure out how to get the coverage to work for Selenium / functional tests.
Thanks,
Alan
When I run unit tests, it writes a great looking report of my code coverage from the standpoint of my unit tests.
But when I run the functional tests, it writes files to my coverage directory that says 0/0 lines passed 100%
I have been up and down trying to figure out how to get the coverage to work for Selenium / functional tests.
Thanks,
Alan
I know I'm resurrecting a very old question, but I found that by following the instructions in this forum, I got 85% of the way there (I haven't posted enough to be allowed to include links, so search the forum for "installation guideline code coverage report" and follow the first link).
I ended up moving the prepend.php and append.php into my project's document root. I also found that the temporary file location made a difference - I originally was trying to save them to /tmp/ and PHP was silently failing. When I changed $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] to myroot/protected/runtime/tmp and did a chmod 777 on that directory, it started working.
One thing that might frustrate you a bit is that code run through Ajax does not get flagged as being covered. This appears to be a known problem with Selenium. Google "github sebastianbergmann phpunit-selenium issues" and track down closed issue #22 for more information.
Share this topic:
Page 1 of 1

Help










