MediaWiki
REL1_19
|
00001 <?php 00002 00030 class PreviewPageTestCase extends SeleniumTestCase { 00031 00032 // Verify adding a new page 00033 public function testPreviewPage() { 00034 $wikiText = "Adding this page to test the \n Preview button functionality"; 00035 $newPage = "Test Preview Page"; 00036 $this->open( $this->getUrl() . 00037 '/index.php?title=Main_Page&action=edit' ); 00038 $this->getNewPage( $newPage ); 00039 $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText."" ); 00040 $this->assertTrue($this->isElementPresent( "//*[@id='wpPreview']" )); 00041 00042 $this->click( "wpPreview" ); 00043 00044 // Verify saved page available 00045 $source = $this->gettext( "firstHeading" ); 00046 $correct = strstr( $source, "Test Preview Page" ); 00047 $this->assertEquals( $correct, true); 00048 00049 // Verify page content previewed succesfully 00050 $contentOfPreviewPage = $this->getText( "//*[@id='content']" ); 00051 $this->assertContains( $wikiText, $contentOfPreviewPage ); 00052 } 00053 }