all.php 636 B

123456789101112131415161718192021222324252627
  1. <?php
  2. // Usage: php /path/to/webdriver/main.php --browser=chrome
  3. $options = getopt('', array(
  4. "browser:",
  5. "help"
  6. ));
  7. if (isset($options['help'])) {
  8. echo 'php main.php --browser=chrome|firefox|"internet explorer"' . "\n";
  9. exit;
  10. }
  11. $browser = isset($options['browser']) ? $options['browser'] : 'internet explorer';
  12. $dirPath = dirname(__FILE__);
  13. $dirHandle = @opendir($dirPath);
  14. if ($dirHandle) {
  15. while (false !== ($fileName = readdir($dirHandle))) {
  16. if (preg_match('/test.*\.php/', $fileName)) {
  17. $cmd = "php $dirPath/$fileName --browser=\"$browser\"";
  18. echo $cmd . "\n";
  19. system($cmd);
  20. }
  21. }
  22. }
  23. echo "tests finished.\n";