Search code examples
unit-testingphpunitautomated-teststest-suite

How can I create test-suites to run on VisualPHPUnit?


I am using VisualPHPUnit and I am trying to organize my tests into suites (due to the fact that Selenium IDE does not export PHPUnit test suites). I am currently implementing the option of the configuration XML file.

Yet,it is very limiting cause I want to run test suites on demand and not uploading each time on the server a new XML file (aka test suite).

I know that I can create an XML file with many test-suites in it but I would like to run them individually.

As you understand i am struggling towards DontRepeatYourself principle and code reuse.You know..just choose login.php , then the testcase and them logout.php and run them. Is something like this possible???

Moreover...would it be difficult VisualPHPUnit to parse only one XML file and create a dropdown box of testsuites to choose from and run?

This is my XML file

<phpunit>

<!-- This is required for VPU to work correctly -->
<listeners>
         <listener class="PHPUnit_Util_Log_JSON"></listener>
</listeners>

  <testsuites>
    <testsuite name="TestSuite1">

    <file>/var/www/VisualPHPUnit/app/unitTests/Login/Login.php</file>

    <file>/var/www/VisualPHPUnit/app/unitTests/CreateCourse/CreateCourse1.php</file>

    <file>/var/www/VisualPHPUnit/app/unitTests/Logout.php</file>

    </testsuite>
  </testsuites>
</phpunit>

Solution

  • actually the PHP formaters are once again available for Selenium IDE. You may want to check this out: https://addons.mozilla.org/en-us/firefox/addon/selenium-ide-php-formatters/

    there are 2 php formaters: PHP_unit and PHP_Selenium