b4bcc8ead8656c22ae849df1c3f7ffea429dac88
4 * This is implemented as a singleton.
7 if (!defined('MEDIAWIKI') ||
!defined('SELENIUMTEST')) {
8 echo "This script cannot be run standalone";
12 class Selenium
extends Testing_Selenium
14 protected static $_instance = null;
15 public $isStarted = false;
16 public static function getInstance()
18 global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost, $wgSeleniumTestsUseBrowser;
19 if (null === self
::$_instance)
21 self
::$_instance = new self($wgSeleniumTestsBrowsers[$wgSeleniumTestsUseBrowser], $wgSeleniumTestsSeleniumHost);
23 return self
::$_instance;
26 public function start()
28 global $wgSeleniumTestsBrowsers, $wgSeleniumTestsSeleniumHost;
30 $this->isStarted
= true;
33 public function stop()
36 $this->isStarted
= false;
39 public function login()
41 global $wgSeleniumTestsWikiUser, $wgSeleniumTestsWikiPassword, $wgSeleniumTestsWikiUrl;
43 $this->open($wgSeleniumTestsWikiUrl.'/index.php?title=Special:Userlogin');
44 $this->type("wpName1", $wgSeleniumTestsWikiUser);
45 $this->type("wpPassword1", $wgSeleniumTestsWikiPassword);
46 $this->click("//input[@id='wpLoginAttempt']");
47 $value = $this->doCommand('assertTitle', array('Anmeldung erfolgreich*'));
50 public function loadPage($title, $action)
52 global $wgSeleniumTestsWikiUrl;
53 $this->open($wgSeleniumTestsWikiUrl.'/index.php?title='.$title.'&action='.$action);
56 // Prevent external cloning
57 protected function __clone() {}
58 // Prevent external construction
59 //protected function __construct() {}