API: trunk/phase3 is now mediawiki/core
[lhc/web/wiklou.git] / tests / selenium / suites / SimpleSeleniumTestCase.php
1 <?php
2 /*
3 * This test case is part of the SimpleSeleniumTestSuite.
4 * Configuration for these tests are documented as part of SimpleSeleniumTestSuite.php
5 */
6 class SimpleSeleniumTestCase extends SeleniumTestCase {
7 public function testBasic() {
8 $this->open( $this->getUrl() .
9 '/index.php?title=Selenium&action=edit' );
10 $this->type( "wpTextbox1", "This is a basic test" );
11 $this->click( "wpPreview" );
12 $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
13
14 // check result
15 $source = $this->getText( "//div[@id='wikiPreview']/p" );
16 $correct = strstr( $source, "This is a basic test" );
17 $this->assertEquals( $correct, true );
18 }
19
20 /**
21 * All this test really does is verify that a global var was set.
22 * It depends on $wgDefaultSkin = 'chick'; being set
23 */
24 public function testGlobalVariableForDefaultSkin() {
25 $this->open( $this->getUrl() . '/index.php' );
26 $bodyClass = $this->getAttribute( "//body/@class" );
27 $this-> assertContains('skin-chick', $bodyClass, 'Chick skin not set');
28 }
29
30 /**
31 * Just verify that the test db was loaded correctly
32 */
33 public function testDatabaseResourceLoadedCorrectly() {
34 $this->open( $this->getUrl() . '/index.php/TestResources?action=purge' );
35 $testString = $this->gettext( "//body//*[@id='firstHeading']" );
36 $this-> assertEquals('TestResources', $testString, 'Article that should be present in the test db was not found.');
37 }
38
39 }