Skip to content

leandersikma/PHP-Formatter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Formatter for Selenium IDE

This PHP Formatter is based on the latest code of Dan Chan's PHP Formatter. With this fully updated PHP Formatter for Selenium IDE you can easily build integrations tests in Selenium and export it to valid PHPUnit code (test suite + all tests) and run it directly in PHPUnit.

This offers you many extra possibilities like Code Coverage and Continuous integration, based on the Selenium IDE tests.

What to do first?

Be sure to have installed the following software:

Selenium tests

If you already have an existing Selenium test suite, you should only change some small things to be compatible with the PHP Formatter. Every selenium test suite should contain a setup test case.

Setup test The first test in your test case should always be a 'setup' test case. This 'setup' test case should contain all of the global variables that you use in your test suite. Local variables (variables only used by a specific test case) can be declared in the corresponding test case.

Export it! To export your test suite, we use the Test Suite Batch Converter. This extension add the possibility to export all test cases, including the test suite, by a formatter. To export, go to: File > Batch convert test suites > PHP (PHPUnit). Choose your destination folder and select your test suite file. That's all! You've now a folder with one 1 test suite file and many test cases.

Running your test suite

Before we can run our test suite with PHPUnit, we have to start the Selenium Server. To start the Selenium Server, execute this command in your command line:

""" java -jar /path/to/selenium-server-standalone.jar """

After the server is running, you can execute the Selenium Test Suite by navigating to your folder in the terminal/console and execute the following command:

""" phpunit your_test_suite.php """

Not familiar with PHPUnit? Read this section to know how to run the test suite file: http://www.phpunit.de/manual/3.8/en/textui.html (or use an IDE to run Selenium-PHPUnit test files, such as Netbeans)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.3%
  • Shell 2.7%