Is it possible to run a test HTML package from PHPUnit?

I want to measure the coverage of HTML test case code for selenium. Therefore, I want to use PHPUnit to execute the package, because PHPUnit has nice support for code coverage analysis.

Therefore: Is it possible to run the HTML test package from PHPUnit?

+5
source share
1 answer

Short answer

Running individual HTML test files is not a problem, but running HTML package files does not seem to work. As long as you put all the HTML test files from the costume into the directory yourself, you can simply runrunSelenese($folderName)

Long answer

I did not even suspect that running Selenium HTML files directly is possible even until I have worked.

, , - / Selenium IDE PHP Formatter Firefox.

-, . Chapter 17. PHPUnit and Selenium :

runSelenese($filename), Selenium Selenese/HTML. , $seleneseDirectory, , Selenese/HTML. .htm, Selenese/HTML. 17.5 .

17.5: Selenese/HTML

<?php
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';

class SeleneseTests extends PHPUnit_Extensions_SeleniumTestCase
{
    public static $seleneseDirectory = '/path/to/files';
}
?>

PHPUnit, Selenium.

:

PHPUnit_Extensions_SeleniumTestCase Selenium:

  • PHPUnit/Extensions/SeleniumTestCase/phpunit_coverage.php -.
  • - php.ini PHPUnit/Extensions/SeleniumTestCase/prepend.php PHPUnit/Extensions/SeleniumTestCase/append.php auto_prepend_file auto_append_file .
  • , PHPUnit_Extensions_SeleniumTestCase, protected $coverageScriptUrl = 'http://host/phpunit_coverage.php';
    URL- phpunit_coverage.php script.

, , HTML-.

+5

All Articles