MediaWiki
REL1_19
|
00001 <?php 00002 /* 00003 * This test case is part of the SimpleSeleniumTestSuite. 00004 * Configuration for these tests are documented as part of SimpleSeleniumTestSuite.php 00005 */ 00006 class SimpleSeleniumTestCase extends SeleniumTestCase { 00007 public function testBasic() { 00008 $this->open( $this->getUrl() . 00009 '/index.php?title=Selenium&action=edit' ); 00010 $this->type( "wpTextbox1", "This is a basic test" ); 00011 $this->click( "wpPreview" ); 00012 $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); 00013 00014 // check result 00015 $source = $this->getText( "//div[@id='wikiPreview']/p" ); 00016 $correct = strstr( $source, "This is a basic test" ); 00017 $this->assertEquals( $correct, true ); 00018 } 00019 00024 public function testGlobalVariableForDefaultSkin() { 00025 $this->open( $this->getUrl() . '/index.php' ); 00026 $bodyClass = $this->getAttribute( "//body/@class" ); 00027 $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set'); 00028 } 00029 00033 public function testDatabaseResourceLoadedCorrectly() { 00034 $this->open( $this->getUrl() . '/index.php/TestResources?action=purge' ); 00035 $testString = $this->gettext( "//body//*[@id='firstHeading']" ); 00036 $this-> assertEquals('TestResources', $testString, 'Article that should be present in the test db was not found.'); 00037 } 00038 00039 }