Topic on Talk:Selenium/PHP/Selenium Framework

Running selenium tests for extensions

3
174.70.101.237 (talkcontribs)

How are we going to run selenium tests for extensions? As of right now, extension tests must be hard coded in. We need to figure out a way of integrating the tests automatically when MediaWiki is undergoing selenium testing.

Ryan lane (talkcontribs)

Idea:

  • Each extension has a hook that is called for adding/running tests.
  • The hooks are only called when MediaWiki is configured to use Selenium.
Pdhanda (talkcontribs)

On the test framework side, running tests for extensions can be done by adding the test suite name to the selenium_settings.ini. Eg:
testSuite[WikiEditorTestSuite] = "extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php"
On the test wiki side, seems like the setup needs to happen before the Setup.php. So instead of using hooks this is what I'm thinking of doing:

  • LocalSettings.php should contain
require_once("extensions/WikiEditor/tests/selenium/WikiEditorSeleniumConfig.php");
$wgSeleniumTestConfigs['WikiEditorTestSuite'] = 'WikiEditorSeleniumConfig::getSettings';

WikiEditorSeleniumConfig::getSettings returns an array of include files and configuration variables needed by the extension.

  • If a cookie has been set, indicating this is part of the WikiEditorTestSuite test run, we use the configuration we get from WikiEditorSeleniumConfig::getSettings


I'm doing some final testing and cleanup, and then I'll update the page and check in.