selenium
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Browser testing for Wikibase == Setup == You need to install Ruby and RubyGems (>=1.3.6) Then: (1) run "(sudo) gem install bundler" to install bundler (2) WINDOWS ONLY: install DevKit 2.1 Download DevKit from http://rubyinstaller.org/downloads 2.2 Unzip it to C:\devkit 2.3 Run "ruby dk.rb init" and finally "ruby dk.rb install" (2) run "bundle" in the /tests/selenium/ directory to install all necessary gems Copy "configuration.yml.sample", rename it to "configuration.yml" and set configuration parameters to your needs before running the tests! == Prerequisites for the MW instance you want to test == * You need to have an administrator user, an user which can be blocked during testing and an ordinary user (without admin rights) registered for the wikidata repo instance you want to test You have to set username and password of those users in your local configuration.yml * Make sure you clean the MW instance (no data items should be left) You can do this by running "php /lib/maintenance/deleteAllData.php" in the Wikibase extension. == Running the tests on your local machine == * In configuration.yml set the WIKI_REPO_URL to point to your local MW instance you want to test and WIKI_CLIENT_URL to the connected client wiki **!!don't forget a slash in the end!!** * From your command line, run "rake run_tests[<taskname>,<browser>]" in the selenium directory, whereas <taskname> specifies the task to run, e.g. default (for all tests) or "label" for just the label tests, and <browser> specifies the browser you want to use for the tests, e.g. "firefox" || "chrome" || "ie". * Firefox (if installed) should work out of the box. For other browsers you should check the corresponding Webdriver on http://code.google.com/p/selenium/w/list See also: http://code.google.com/p/selenium/wiki/OperaDriver http://code.google.com/p/selenium/wiki/InternetExplorerDriver http://code.google.com/p/selenium/wiki/SafariDriver http://code.google.com/p/selenium/wiki/FirefoxDriver http://code.google.com/p/selenium/wiki/ChromeDriver == Running the tests remotely via Selenium Grid2 == * In configuration.yml set the WIKI_REPO_URL to point to the remote MW instance you want to test and WIKI_CLIENT_URL to the connected client wiki **!!don't forget a slash in the end!!** * Set REMOTE_SELENIUM_HUB to point to the Selenium Hub instance * From your command line, run rake[browser,remote] in the selnium directory (where "browser" specifies the browser you want to use for the tests, e.g. "firefox") == EXAMPLE RUNS == rake rake run_tests rake run_tests[all] this will run all tests locally in the browser you specified in configuration.yml as DEFAULT_BROWSER rake run_tests[all,chrome] this will run all tests locally in chrome rake run_tests[label,firefox] this will run the label tests locally in firefox rake run_tests[all,firefox,remote] this will run all tests on remote selenium grid hub in firefox rake run_tests[description,chrome,remote,linux] this will run the description tests on a remote linux box (if available) in chrome rake run_tests[all,ie,remote,windows] this will run all tests on a remote windows box (if available) in internet explorer