From c4372dd38a4d109b4f3881ea63b667e33adbe503 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 26 Apr 2012 18:23:31 +0200 Subject: Update to MediaWiki 1.18.3 --- .../tests/selenium/WikiDialogs_Links.php | 10 +- .../tests/selenium/WikiDialogs_Links_Setup.php | 74 +++++------ .../tests/selenium/WikiEditorConstants.php | 136 ++++++++++----------- .../tests/selenium/WikiEditorSeleniumConfig.php | 8 +- .../tests/selenium/WikiEditorTestSuite.php | 6 +- 5 files changed, 117 insertions(+), 117 deletions(-) (limited to 'extensions/WikiEditor/tests') diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php index 07f1b41b..8b0ab5c0 100644 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php +++ b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php @@ -4,10 +4,10 @@ require_once 'WikiDialogs_Links_Setup.php'; * Description of WikiNewPageDialogs * * @author bhagyag, pdhanda - * + * * This test case is part of the WikiEditorTestSuite. * Configuration for these tests are dosumented as part of extensions/WikiEditor/tests/selenium/WikiEditorTestSuite.php - * + * */ class WikiDialogs_Links extends WikiDialogs_Links_Setup { // Set up the testing environment @@ -15,13 +15,13 @@ class WikiDialogs_Links extends WikiDialogs_Links_Setup { parent::setUp(); parent::doCreateInternalTestPageIfMissing(); } - + function tearDown() { parent::doLogout(); parent::tearDown(); - } + } - //Create a new page temporary + // Create a new page temporary function createNewPage() { parent::doOpenLink(); parent::login(); diff --git a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php index 7e399a03..d7636a9a 100644 --- a/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php +++ b/extensions/WikiEditor/tests/selenium/WikiDialogs_Links_Setup.php @@ -1,5 +1,5 @@ waitForPageToLoad( WIKI_TEST_WAIT_TIME ); } - //Expand advance tool bar section if its not + // Expand advance tool bar section if its not function doExpandAdvanceSection() { - if ( !$this->isTextPresent( TEXT_HEADING ) ){ + if ( !$this->isTextPresent( TEXT_HEADING ) ) { $this->click( LINK_ADVANCED ); } } @@ -23,16 +23,16 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { // Log out from the application function doLogout() { $this->open( $this->getUrl() . '/index.php' ); - if ($this->isTextPresent( TEXT_LOGOUT ) ) { + if ( $this->isTextPresent( TEXT_LOGOUT ) ) { $this->click( LINK_LOGOUT ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals(TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN )); + $this->assertEquals( TEXT_LOGOUT_CONFIRM, $this->getText( LINK_LOGIN ) ); $this->open( $this->getUrl() . '/index.php' ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); } } - //Create a temporary fixture page + // Create a temporary fixture page function doCreateInternalTestPageIfMissing() { $this->type( INPUT_SEARCH_BOX, WIKI_INTERNAL_LINK ); $this->click( BUTTON_SEARCH ); @@ -40,16 +40,16 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( LINK_START . WIKI_INTERNAL_LINK ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $location = $this->getLocation() . "\n"; - if ( strpos( $location, '&redlink=1') !== false ) { + if ( strpos( $location, '&redlink=1' ) !== false ) { $this->type( TEXT_EDITOR, "Test fixture page. No real content here" ); $this->click( BUTTON_SAVE_WATCH ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), + $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); } } - //Create a temporary new page + // Create a temporary new page function doCreateNewPageTemporary() { $this->type( INPUT_SEARCH_BOX, WIKI_TEMP_NEWPAGE ); $this->click( BUTTON_SEARCH ); @@ -59,7 +59,7 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add a internal link and verify - function verifyInternalLink(){ + function verifyInternalLink() { $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDLINK ); $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); @@ -70,16 +70,16 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( ( WIKI_INTERNAL_LINK ), $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); - $this->click( LINK_START. WIKI_INTERNAL_LINK ); + $this->click( LINK_START . WIKI_INTERNAL_LINK ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText(TEXT_PAGE_HEADING ) ); + $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); } // Add a internal link with different display text and verify - function verifyInternalLinkWithDisplayText(){ + function verifyInternalLinkWithDisplayText() { $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDLINK ); - $this->waitForPopup('addLink', WIKI_TEST_WAIT_TIME); + $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); $this->type ( TEXT_LINKDISPLAYNAME, WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); @@ -87,27 +87,27 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( BUTTON_INSERTLINK ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT, + $this->assertEquals( WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT, $this->getText( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ) ); $this->click( LINK_START . WIKI_INTERNAL_LINK . TEXT_LINKDISPLAYNAME_APPENDTEXT ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertTrue( $this->isTextPresent( WIKI_INTERNAL_LINK ), $this->getText( TEXT_PAGE_HEADING ) ); - + } // Add a internal link with blank display text and verify - function verifyInternalLinkWithBlankDisplayText(){ + function verifyInternalLinkWithBlankDisplayText() { $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDLINK ); $this->waitForPopup( 'addLink', WIKI_TEST_WAIT_TIME ); $this->type( TEXT_LINKNAME, WIKI_INTERNAL_LINK ); $this->type( TEXT_LINKDISPLAYNAME, "" ); $this->assertTrue( $this->isElementPresent( ICON_PAGEEXISTS ) ); - $this->assertEquals("on", $this->getValue(OPT_INTERNAL)); + $this->assertEquals( "on", $this->getValue( OPT_INTERNAL ) ); $this->click( BUTTON_INSERTLINK ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START. WIKI_INTERNAL_LINK ) ); + $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( LINK_START . WIKI_INTERNAL_LINK ) ); $this->click( LINK_START . WIKI_INTERNAL_LINK ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_INTERNAL_LINK, $this->getText( TEXT_PAGE_HEADING ) ); @@ -115,7 +115,7 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add external link and verify - function verifyExternalLink(){ + function verifyExternalLink() { $this->type( LINK_PREVIEW, "" ); $this->click( LINK_ADDLINK ); $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); @@ -125,14 +125,14 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_EXTERNAL_LINK, $this->getText( LINK_START . WIKI_EXTERNAL_LINK ) ); - + $this->click( LINK_START . WIKI_EXTERNAL_LINK ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); } // Add external link with different display text and verify - function verifyExternalLinkWithDisplayText(){ + function verifyExternalLinkWithDisplayText() { $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDLINK ); $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); @@ -143,13 +143,13 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getText( LINK_START . WIKI_EXTERNAL_LINK_TITLE ) ); - $this->click(LINK_START.(WIKI_EXTERNAL_LINK_TITLE)); + $this->click( LINK_START . ( WIKI_EXTERNAL_LINK_TITLE ) ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE , $this->getTitle() ); } // Add external link with Blank display text and verify - function verifyExternalLinkWithBlankDisplayText(){ + function verifyExternalLinkWithBlankDisplayText() { $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDLINK ); $this->type( TEXT_LINKNAME, WIKI_EXTERNAL_LINK ); @@ -159,14 +159,14 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( BUTTON_INSERTLINK ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertEquals( "[1]", $this->getText(LINK_START . "[1]" ) ); + $this->assertEquals( "[1]", $this->getText( LINK_START . "[1]" ) ); $this->click( LINK_START . "[1]" ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); $this->assertEquals( WIKI_EXTERNAL_LINK_TITLE, $this->getTitle() ); } // Add a table and verify - function verifyCreateTable(){ + function verifyCreateTable() { $WIKI_TABLE_ROW = 2; $WIKI_TABLE_COL = "5"; $this->doExpandAdvanceSection(); @@ -187,19 +187,19 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add a table and verify only with head row - function verifyCreateTableWithHeadRow(){ + function verifyCreateTableWithHeadRow() { $WIKI_TABLE_ROW = 3; $WIKI_TABLE_COL = "4"; $this->doExpandAdvanceSection(); $this->type( TEXT_EDITOR, "" ); $this->click( LINK_ADDTABLE ); - $this->click( CHK_BOARDER); + $this->click( CHK_BOARDER ); $this->type( TEXT_ROW, $WIKI_TABLE_ROW ); $this->type( TEXT_COL, $WIKI_TABLE_COL ); $this->click( BUTTON_INSERTABLE ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1; + $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_OTHER . TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . @@ -207,7 +207,7 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add a table and verify only with borders - function verifyCreateTableWithBorders(){ + function verifyCreateTableWithBorders() { $WIKI_TABLE_ROW = "4"; $WIKI_TABLE_COL = "6"; $this->type( TEXT_EDITOR, "" ); @@ -226,7 +226,7 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add a table and verify only with sort row - function verifyCreateTableWithSortRow(){ + function verifyCreateTableWithSortRow() { $WIKI_TABLE_ROW = "2"; $WIKI_TABLE_COL = "5"; $this->type( TEXT_EDITOR, "" ); @@ -242,14 +242,14 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( CHK_SORT ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $this->assertTrue( $this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES . + $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . TEXT_VALIDATE_TABLE_PART3 ) ); } // Add a table without headers,borders and sort rows - function verifyCreateTableWithNoSpecialEffects(){ + function verifyCreateTableWithNoSpecialEffects() { $WIKI_TABLE_ROW = "6"; $WIKI_TABLE_COL = "2"; $this-> @@ -272,7 +272,7 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { } // Add a table with headers,borders and sort rows - function verifyCreateTableWithAllSpecialEffects(){ + function verifyCreateTableWithAllSpecialEffects() { $WIKI_TABLE_ROW = 6; $WIKI_TABLE_COL = "2"; $this->doExpandAdvanceSection(); @@ -285,11 +285,11 @@ class WikiDialogs_Links_Setup extends SeleniumTestCase { $this->click( CHK_SORT ); $this->click( LINK_PREVIEW ); $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); - $WIKI_TABLE_ROW = $WIKI_TABLE_ROW+1; - $this->assertTrue( $this->isElementPresent(TEXT_TABLEID_WITHALLFEATURES . + $WIKI_TABLE_ROW = $WIKI_TABLE_ROW + 1; + $this->assertTrue( $this->isElementPresent( TEXT_TABLEID_WITHALLFEATURES . TEXT_VALIDATE_TABLE_PART1 . $WIKI_TABLE_ROW . TEXT_VALIDATE_TABLE_PART2 . $WIKI_TABLE_COL . - TEXT_VALIDATE_TABLE_PART3)); + TEXT_VALIDATE_TABLE_PART3 ) ); } } diff --git a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php index 11eeb01e..090f96bf 100644 --- a/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php +++ b/extensions/WikiEditor/tests/selenium/WikiEditorConstants.php @@ -1,84 +1,84 @@ false, 'user' => false ); * $wgWikiEditorFeatures['highlight'] = array( 'global' => false, 'user' => false ); * $wgWikiEditorFeatures['dialogs'] = array( 'global' => true, 'user' => true ); - * + * */ class WikiEditorTestSuite extends SeleniumTestSuite { public function setUp() { $this->setLoginBeforeTests( false ); parent::setUp(); - } + } public function addTests() { $testFiles = array( 'extensions/WikiEditor/tests/selenium/WikiDialogs_Links.php' -- cgit v1.2.3-54-g00ecf