MediaWiki  REL1_19
MyContributionsTestCase.php
Go to the documentation of this file.
00001 <?php
00002 
00030 require_once dirname( dirname( __FILE__ ) ) . '/SeleniumTestConstants.php';
00031 
00032 class MyContributionsTestCase extends SeleniumTestCase {
00033 
00034     // Verify user contributions
00035     public function testRecentChangesAvailability() {
00036 
00037         $newPage = $this->createNewTestPage( "MyContributionsTest" );
00038         
00039         // Verify My contributions Link available
00040         $this->assertTrue($this->isElementPresent( "link=Contributions" ));
00041 
00042         
00043         $this->click( "link=Contributions" );
00044         $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
00045 
00046         // Verify recent page adding available on My Contributions list
00047         $this->assertEquals( $newPage, $this->getText( "link=".$newPage ));
00048 
00049         $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $newPage );
00050         $this->click( SeleniumTestConstants::BUTTON_SEARCH );
00051         $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
00052         
00053         $this->click( SeleniumTestConstants::LINK_EDIT );
00054         $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
00055         $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage . " text changed" );
00056         $this->click( SeleniumTestConstants::BUTTON_SAVE );
00057         $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
00058         $this->click( "link=Contributions" );
00059         $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
00060 
00061         // Verify recent page changes available on My Contributions
00062         $this->assertTrue( $this->isTextPresent( $newPage ) );
00063     }
00064 }
00065