Yii Framework Forum: Selenium Code Coverage is blank - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Selenium Code Coverage is blank

#1 User is offline   Asterisk Pound 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 11
  • Joined: 18-September 10

Posted 30 April 2012 - 06:10 PM

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
0

#2 User is offline   sjg 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 05-November 10
  • Location:Los Angeles

Posted 09 August 2012 - 04:49 PM

View PostAsterisk 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


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.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users