r79437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79436‎ | r79437 | r79438 >
Date:20:56, 1 January 2011
Author:platonides
Status:deferred
Tags:
Comment:
I am fed up of selenium constants which aren't properly defined by all files using them.
Making those of SeleniumTestConstants.php into class constants.

for i in $(grep -o 'const [A-Z_]*' SeleniumTestConstants.php | cut -c 7-); do
find -name \*.php -and -not -name SeleniumTestConstants.php -exec sed -i s/$i/SeleniumTestConstants::$i/g \{\} +
done
Modified paths:
  • /trunk/phase3/tests/selenium/SeleniumTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/SeleniumTestConstants.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/AddContentToNewPageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/AddNewPageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/CreateAccountTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/DeletePageAdminTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/EmailPasswordTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/MovePageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/MyContributionsTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/MyWatchListTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/PageSearchTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/PreviewPageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/SavePageTestCase.php (modified) (history)
  • /trunk/phase3/tests/selenium/suites/UserPreferencesTestCase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/selenium/SeleniumTestCase.php
@@ -31,24 +31,24 @@
3232
3333 /**
3434 * Create a test fixture page if one does not exist
35 - * @param $pageName The fixture page name. If none is supplied, it uses WIKI_INTERNAL_LINK
 35+ * @param $pageName The fixture page name. If none is supplied, it uses SeleniumTestConstants::WIKI_INTERNAL_LINK
3636 */
3737 function createTestPageIfMissing( $pageName = null ) {
3838 if ( $pageName == null ) {
39 - $pageName = WIKI_INTERNAL_LINK;
 39+ $pageName = SeleniumTestConstants::WIKI_INTERNAL_LINK;
4040 }
41 - $this->type( INPUT_SEARCH_BOX, $pageName );
42 - $this->click( BUTTON_SEARCH );
43 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
44 - $this->click( LINK_START . $pageName );
45 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 41+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName );
 42+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 43+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 44+ $this->click( SeleniumTestConstants::LINK_START . $pageName );
 45+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4646 $location = $this->getLocation() . "\n";
4747 if ( strpos( $location, '&redlink=1') !== false ) {
48 - $this->type( TEXT_EDITOR, "Test fixture page. No real content here" );
49 - $this->click( BUTTON_SAVE );
50 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 48+ $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" );
 49+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 50+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5151 $this->assertTrue( $this->isTextPresent( $pageName ),
52 - $this->getText( TEXT_PAGE_HEADING ) );
 52+ $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) );
5353 }
5454 }
5555
@@ -59,21 +59,21 @@
6060 */
6161 function createNewTestPage( $pagePrefix, $watchThis = false ) {
6262 $pageName = $pagePrefix . date("Ymd-His");
63 - $this->type( INPUT_SEARCH_BOX, $pageName );
64 - $this->click( BUTTON_SEARCH );
65 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
66 - $this->click( LINK_START . $pageName );
67 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 63+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $pageName );
 64+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 65+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 66+ $this->click( SeleniumTestConstants::LINK_START . $pageName );
 67+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6868 $location = $this->getLocation() . "\n";
6969 $this->assertContains( '&redlink=1', $location ).
70 - $this->type( TEXT_EDITOR, "Test fixture page. No real content here" );
 70+ $this->type( SeleniumTestConstants::TEXT_EDITOR, "Test fixture page. No real content here" );
7171 if ( $watchThis ) {
7272 $this->click( "wpWatchthis" );
7373 }
74 - $this->click( BUTTON_SAVE );
75 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 74+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 75+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7676 $this->assertTrue( $this->isTextPresent( $pageName ),
77 - $this->getText( TEXT_PAGE_HEADING ) );
 77+ $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) );
7878 return $pageName;
7979 }
8080
Index: trunk/phase3/tests/selenium/SeleniumTestConstants.php
@@ -1,20 +1,24 @@
22 <?php
3 -define ('WIKI_TEST_WAIT_TIME', "3000"); // Waiting time
43
5 -//commonly used links
6 -define ('LINK_MAIN_PAGE',"link=Main page");
7 -define ('LINK_RANDOM_PAGE',"link=Random article");
8 -define ('TEXT_PAGE_HEADING',"firstHeading");
 4+class SeleniumTestConstants {
 5+ const WIKI_TEST_WAIT_TIME = 3000; // Waiting time
96
10 -define ('LINK_START',"link=");
11 -define ('TEXT_EDITOR',"wpTextbox1");
12 -define ('LINK_PREVIEW',"wpPreview");
13 -define ('LINK_EDIT',"link=Edit");
 7+ //commonly used links
 8+ const LINK_MAIN_PAGE = 'link=Main page';
 9+ const LINK_RANDOM_PAGE = 'link=Random article';
 10+ const TEXT_PAGE_HEADING = 'firstHeading';
1411
15 -define ('WIKI_SEARCH_PAGE',"Hair (musical)"); // Page name to search
16 -define ('WIKI_TEXT_SEARCH',"TV"); // Text to search
17 -define ('WIKI_INTERNAL_LINK',"Wikieditor-Fixture-Page"); // Exisiting page name to add as an internal tag
 12+ const LINK_START = 'link=';
 13+ const TEXT_EDITOR = 'wpTextbox1';
 14+ const LINK_PREVIEW = 'wpPreview';
 15+ const LINK_EDIT = 'link=Edit';
1816
19 -define ('INPUT_SEARCH_BOX', "searchInput");
20 -define ('BUTTON_SEARCH',"mw-searchButton");
21 -define ('BUTTON_SAVE',"wpSave");
 17+ const WIKI_SEARCH_PAGE = 'Hair (musical)'; // Page name to search
 18+ const WIKI_TEXT_SEARCH = 'TV'; // Text to search
 19+ const WIKI_INTERNAL_LINK = 'Wikieditor-Fixture-Page'; // Exisiting page name to add as an internal tag
 20+
 21+ const INPUT_SEARCH_BOX = 'searchInput';
 22+ const BUTTON_SEARCH = 'mw-searchButton';
 23+ const BUTTON_SAVE = 'wpSave';
 24+}
 25+
Index: trunk/phase3/tests/selenium/suites/AddContentToNewPageTestCase.php
@@ -40,7 +40,7 @@
4141 $this->clearWikiEditor();
4242 $this->click( "//*[@id='mw-editbutton-bold']" );
4343 $this->clickShowPreviewBtn();
44 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 44+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4545
4646 // Verify bold text displayed on mediawiki preview
4747 $this->assertTrue($this->isElementPresent( "//div[@id='wikiPreview']/p/b" ));
@@ -56,7 +56,7 @@
5757 $this->clearWikiEditor();
5858 $this->click( "//*[@id='mw-editbutton-italic']" );
5959 $this->clickShowPreviewBtn();
60 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 60+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6161
6262 // Verify italic text displayed on mediawiki preview
6363 $this->assertTrue($this->isElementPresent("//div[@id='wikiPreview']/p/i"));
@@ -71,15 +71,15 @@
7272 $this->clearWikiEditor();
7373 $this->click( "//*[@id='mw-editbutton-link']" );
7474 $this->clickShowPreviewBtn();
75 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 75+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7676
7777 // Verify internal link displayed on mediawiki preview
7878 $source = $this->getText( "//*[@id='wikiPreview']/p/a" );
7979 $correct = strstr( $source, "Link title" );
8080 $this->assertEquals( $correct, true );
8181
82 - $this->click( LINK_START."Link title" );
83 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 82+ $this->click( SeleniumTestConstants::LINK_START."Link title" );
 83+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8484
8585 // Verify internal link open as a new page - editing mode
8686 $source = $this->getText( "firstHeading" );
@@ -94,17 +94,17 @@
9595 $this->loadWikiEditor();
9696 $this->clearWikiEditor();
9797 $this->click( "//*[@id='mw-editbutton-extlink']" );
98 - $this->type( TEXT_EDITOR, "[http://www.google.com Google]" );
 98+ $this->type( SeleniumTestConstants::TEXT_EDITOR, "[http://www.google.com Google]" );
9999 $this->clickShowPreviewBtn();
100 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 100+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
101101
102102 // Verify external links displayed on mediawiki preview
103103 $source = $this->getText( "//*[@id='wikiPreview']/p/a" );
104104 $correct = strstr( $source, "Google" );
105105 $this->assertEquals( $correct, true );
106106
107 - $this->click( LINK_START."Google" );
108 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 107+ $this->click( SeleniumTestConstants::LINK_START."Google" );
 108+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
109109
110110 // Verify external link opens
111111 $source = $this->getTitle();
@@ -122,7 +122,7 @@
123123 $this->clearWikiEditor();
124124 $this->click( "mw-editbutton-headline" );
125125 $this->clickShowPreviewBtn();
126 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 126+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
127127 $this->assertTrue($this->isElementPresent( "//div[@id='wikiPreview']/h2" ));
128128
129129 // Verify level 2 headline displayed on mediawiki preview
@@ -139,7 +139,7 @@
140140 $this->clearWikiEditor();
141141 $this->click( "//*[@id='mw-editbutton-nowiki']" );
142142 $this->clickShowPreviewBtn();
143 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 143+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
144144
145145 // Verify ignore wiki format text displayed on mediawiki preview
146146 $source = $this->getText( "//div[@id='wikiPreview']/p" );
@@ -155,7 +155,7 @@
156156 $this->clearWikiEditor();
157157 $this->click( "mw-editbutton-signature" );
158158 $this->clickShowPreviewBtn();
159 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 159+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
160160
161161 // Verify signature displayed on mediawiki preview
162162 $source = $this->getText( "//*[@id='wikiPreview']/p/a" );
@@ -173,7 +173,7 @@
174174 $this->click( "mw-editbutton-hr" );
175175
176176 $this->clickShowPreviewBtn();
177 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 177+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
178178
179179 // Verify horizontal line displayed on mediawiki preview
180180 $this->assertTrue( $this->isElementPresent( "//div[@id='wikiPreview']/hr" ));
Index: trunk/phase3/tests/selenium/suites/AddNewPageTestCase.php
@@ -38,7 +38,7 @@
3939 '/index.php?title=Main_Page&action=edit' );
4040 $this->type( "searchInput", $newPage );
4141 $this->click( "searchGoButton" );
42 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 42+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4343
4444 // Verify 'Search results' text available
4545 $source = $this->gettext( "firstHeading" );
@@ -50,12 +50,12 @@
5151 $correct = strstr ( $source, "Create the page \"New\" on this wiki!" );
5252 $this->assertEquals( $correct, true );
5353
54 - $this->click( LINK_START.$displayName );
55 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 54+ $this->click( SeleniumTestConstants::LINK_START.$displayName );
 55+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5656
57 - $this->assertTrue($this->isElementPresent( LINK_START."Create" ));
 57+ $this->assertTrue($this->isElementPresent( SeleniumTestConstants::LINK_START."Create" ));
5858 $this->type( "wpTextbox1", "add new test page" );
59 - $this->click( BUTTON_SAVE );
 59+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
6060
6161 // Verify new page added
6262 $source = $this->gettext( "firstHeading" );
Index: trunk/phase3/tests/selenium/suites/UserPreferencesTestCase.php
@@ -34,8 +34,8 @@
3535
3636 $this->open( $this->getUrl() .
3737 '/index.php?title=Main_Page&action=edit' );
38 - $this->click( LINK_START."My preferences" );
39 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 38+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 39+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4040
4141 // Verify correct username displayed in User Preferences
4242 $this->assertEquals( $this->getText( "//li[@id='pt-userpage']/a" ),
@@ -51,38 +51,38 @@
5252
5353 $this->open( $this->getUrl() .
5454 '/index.php?title=Main_Page&action=edit' );
55 - $this->click( LINK_START."My preferences" );
56 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 55+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 56+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5757
58 - $this->click( LINK_START."Change password" );
59 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 58+ $this->click( SeleniumTestConstants::LINK_START."Change password" );
 59+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6060
6161 $this->type( "wpPassword", "12345" );
6262 $this->type( "wpNewPassword", "54321" );
6363 $this->type( "wpRetype", "54321" );
6464 $this->click( "//input[@value='Change password']" );
65 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 65+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6666
6767 $this->assertEquals( "Preferences", $this->getText( "firstHeading" ));
6868
69 - $this->click( LINK_START."Change password" );
70 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 69+ $this->click( SeleniumTestConstants::LINK_START."Change password" );
 70+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7171
7272 $this->type( "wpPassword", "54321" );
7373 $this->type( "wpNewPassword", "12345" );
7474 $this->type( "wpRetype", "12345" );
7575 $this->click( "//input[@value='Change password']" );
76 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 76+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7777 $this->assertEquals( "Preferences", $this->getText( "firstHeading" ));
7878
79 - $this->click( LINK_START."Change password" );
80 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 79+ $this->click( SeleniumTestConstants::LINK_START."Change password" );
 80+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8181
8282 $this->type( "wpPassword", "54321" );
8383 $this->type( "wpNewPassword", "12345" );
8484 $this->type( "wpRetype", "12345" );
8585 $this->click( "//input[@value='Change password']" );
86 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 86+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8787 }
8888
8989 // Verify successful preferences save
@@ -90,19 +90,19 @@
9191
9292 $this->open( $this->getUrl() .
9393 '/index.php?title=Main_Page&action=edit' );
94 - $this->click( LINK_START."My preferences" );
95 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 94+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 95+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
9696
9797 $this->type( "mw-input-realname", "Test User" );
9898 $this->click( "prefcontrol" );
99 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 99+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
100100
101101 // Verify "Your preferences have been saved." message
102102 $this->assertEquals( "Your preferences have been saved.",
103103 $this->getText( "//div[@id='bodyContent']/div[4]/strong/p" ));
104104 $this->type( "mw-input-realname", "" );
105105 $this->click( "prefcontrol" );
106 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 106+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
107107
108108 }
109109
@@ -111,18 +111,18 @@
112112
113113 $this->open( $this->getUrl() .
114114 '/index.php?title=Main_Page&action=edit' );
115 - $this->click( LINK_START."My preferences" );
116 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 115+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 116+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
117117
118118 $this->type( "mw-input-nickname", "TestSignature" );
119119 $this->click( "prefcontrol" );
120 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 120+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
121121
122122 // Verify change user signature
123 - $this->assertEquals( "TestSignature", $this->getText( LINK_START."TestSignature" ));
 123+ $this->assertEquals( "TestSignature", $this->getText( SeleniumTestConstants::LINK_START."TestSignature" ));
124124 $this->type( "mw-input-nickname", "Test" );
125125 $this->click( "prefcontrol" );
126 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 126+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
127127 }
128128
129129 // Verify change date format
@@ -131,15 +131,15 @@
132132 $this->open( $this->getUrl() .
133133 '/index.php?title=Main_Page&action=edit' );
134134
135 - $this->click( LINK_START."My preferences" );
136 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
137 - $this->click( LINK_START."Date and time" );
138 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 135+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 136+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 137+ $this->click( SeleniumTestConstants::LINK_START."Date and time" );
 138+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
139139
140140 $this->click( "mw-input-date-dmy" );
141141 $this->select( "mw-input-timecorrection", "label=Asia/Colombo" );
142142 $this->click( "prefcontrol" );
143 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 143+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
144144
145145 // Verify Date format and time zome saved
146146 $this->assertEquals( "Your preferences have been saved.",
@@ -151,15 +151,15 @@
152152
153153 $this->open( $this->getUrl() .
154154 '/index.php?title=Main_Page&action=edit' );
155 - $this->click( LINK_START."My preferences" );
156 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 155+ $this->click( SeleniumTestConstants::LINK_START."My preferences" );
 156+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
157157
158158 // Verify restoring all default settings
159159 $this->assertEquals( "Restore all default settings",
160 - $this->getText( LINK_START."Restore all default settings" ));
 160+ $this->getText( SeleniumTestConstants::LINK_START."Restore all default settings" ));
161161
162162 $this->click("//*[@id='preferences']/div/a");
163 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 163+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
164164
165165 // Verify 'This can not be undone' warning message displayed
166166 $this->assertTrue($this->isElementPresent("//input[@value='Restore all default settings']"));
@@ -169,7 +169,7 @@
170170 $this->getText("//div[@id='bodyContent']/p"));
171171
172172 $this->click("//input[@value='Restore all default settings']");
173 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 173+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
174174
175175 // Verify preferences saved successfully
176176 $this->assertEquals("Your preferences have been saved.",
Index: trunk/phase3/tests/selenium/suites/PageSearchTestCase.php
@@ -34,9 +34,9 @@
3535
3636 $this->open( $this->getUrl() .
3737 '/index.php?title=Main_Page&action=edit' );
38 - $this->type( INPUT_SEARCH_BOX, "calcey qa" );
 38+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, "calcey qa" );
3939 $this->click( "searchGoButton" );
40 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 40+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4141
4242 // Verify no page matched with the entered search text
4343 $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" );
@@ -44,11 +44,11 @@
4545 $this->assertEquals( $correct, true );
4646
4747 $this->click( "link=Calcey qa" );
48 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 48+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4949
50 - $this->type( TEXT_EDITOR , "Calcey QA team" );
 50+ $this->type( SeleniumTestConstants::TEXT_EDITOR , "Calcey QA team" );
5151 $this->click( "wpSave" );
52 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 52+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5353
5454 }
5555
@@ -57,9 +57,9 @@
5858
5959 $this->open( $this->getUrl() .
6060 '/index.php?title=Main_Page&action=edit' );
61 - $this->type( INPUT_SEARCH_BOX, "Calcey web" );
62 - $this->click( BUTTON_SEARCH );
63 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 61+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, "Calcey web" );
 62+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 63+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6464
6565 // Verify no page is available as the search text
6666 $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p[2]/b" );
@@ -67,16 +67,16 @@
6868 $this->assertEquals( $correct, true );
6969
7070 $this->click( "link=Calcey web" );
71 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 71+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7272
73 - $this->type( TEXT_EDITOR, "Calcey web team" );
74 - $this->click( BUTTON_SAVE );
75 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 73+ $this->type( SeleniumTestConstants::TEXT_EDITOR, "Calcey web team" );
 74+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 75+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7676
7777 // Verify saved page is opened when the exact page name is given
78 - $this->type( INPUT_SEARCH_BOX, "Calcey web" );
79 - $this->click( BUTTON_SEARCH );
80 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 78+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, "Calcey web" );
 79+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 80+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8181
8282 // Verify exact page matched with the entered search text using 'Search' button
8383 $source = $this->getText( "//*[@id='bodyContent']/div[4]/p/b" );
@@ -84,9 +84,9 @@
8585 $this->assertEquals( $correct, true );
8686
8787 // Verify resutls available when partial page name is entered as the search text
88 - $this->type( INPUT_SEARCH_BOX, "Calcey" );
89 - $this->click( BUTTON_SEARCH );
90 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 88+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, "Calcey" );
 89+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 90+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
9191
9292 // Verify text avaialble in the search result under the page titles
9393 if($this->isElementPresent( "Page_title_matches" )) {
Index: trunk/phase3/tests/selenium/suites/MovePageTestCase.php
@@ -39,18 +39,18 @@
4040 '/index.php?title=Main_Page&action=edit' );
4141 $this->type( "searchInput", $newPage );
4242 $this->click( "searchGoButton" );
43 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 43+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4444 $this->click( "link=".$displayName );
45 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
46 - $this->type( TEXT_EDITOR, $newPage." text" );
47 - $this->click( BUTTON_SAVE );
48 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 45+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 46+ $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage." text" );
 47+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 48+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4949
5050 // Verify link 'Move' available
5151 $this->assertTrue($this->isElementPresent( "link=Move" ));
5252
5353 $this->click( "link=Move" );
54 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 54+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5555
5656 // Verify correct page name displayed under 'Move Page' field
5757 $this->assertEquals($displayName,
@@ -64,7 +64,7 @@
6565
6666 $this->type( "wpNewTitle", $displayName );
6767 $this->click( "wpMove" );
68 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 68+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6969
7070 // Verify warning message for the same source and destination titles
7171 $this->assertEquals( "Source and destination titles are the same; cannot move a page over itself.",
@@ -73,7 +73,7 @@
7474 // Verify warning message for the blank title
7575 $this->type( "wpNewTitle", "" );
7676 $this->click( "wpMove" );
77 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 77+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7878
7979 // Verify warning message for the blank title
8080 $this->assertEquals( "The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.",
@@ -82,13 +82,13 @@
8383 // Verify warning messages for the invalid titles
8484 $this->type( "wpNewTitle", "# < > [ ] | { }" );
8585 $this->click( "wpMove" );
86 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 86+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8787 $this->assertEquals( "The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.",
8888 $this->getText( "//div[@id='bodyContent']/p[4]/strong" ));
8989
9090 $this->type( "wpNewTitle", $displayName."move" );
9191 $this->click( "wpMove" );
92 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 92+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
9393
9494 // Verify move success message displayed correctly
9595 $this->assertEquals( "\"".$displayName."\" has been moved to \"".$displayName."move"."\"",
@@ -96,14 +96,14 @@
9797
9898 $this->type( "searchInput", $newPage."move" );
9999 $this->click( "searchGoButton" );
100 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 100+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
101101
102102 // Verify search using new page name
103103 $this->assertEquals( $displayName."move", $this->getText( "firstHeading" ));
104104
105105 $this->type( "searchInput", $newPage );
106106 $this->click( "searchGoButton" );
107 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 107+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
108108
109109 // Verify search using old page name
110110 $redirectPageName = $this->getText( "//*[@id='contentSub']" );
Index: trunk/phase3/tests/selenium/suites/DeletePageAdminTestCase.php
@@ -41,40 +41,40 @@
4242
4343 $this->type( "searchInput", $newPage );
4444 $this->click( "searchGoButton" );
45 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
46 - $this->click( LINK_START.$displayName );
47 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
48 - $this->type( TEXT_EDITOR, $newPage." text" );
49 - $this->click( BUTTON_SAVE );
 45+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 46+ $this->click( SeleniumTestConstants::LINK_START.$displayName );
 47+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 48+ $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage." text" );
 49+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
5050
5151 $this->open( $this->getUrl() .
5252 '/index.php?title=Main_Page&action=edit' );
53 - $this->click( LINK_START."Log out" );
54 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
55 - $this->click( LINK_START."Log in / create account" );
56 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 53+ $this->click( SeleniumTestConstants::LINK_START."Log out" );
 54+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 55+ $this->click( SeleniumTestConstants::LINK_START."Log in / create account" );
 56+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5757
5858 $this->type( "wpName1", $this->selenium->getUser() );
5959 $this->type( "wpPassword1", $this->selenium->getPass() );
6060 $this->click( "wpLoginAttempt" );
61 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 61+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6262 $this->type( "searchInput", "new" );
6363 $this->click( "searchGoButton");
64 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 64+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6565
6666 // Verify 'Delete' link displayed
67 - $source = $this->gettext( LINK_START."Delete" );
 67+ $source = $this->gettext( SeleniumTestConstants::LINK_START."Delete" );
6868 $correct = strstr ( $source, "Delete" );
6969 $this->assertEquals($correct, true );
7070
71 - $this->click( LINK_START."Delete" );
72 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 71+ $this->click( SeleniumTestConstants::LINK_START."Delete" );
 72+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7373
7474 // Verify 'Delete' button available
7575 $this->assertTrue($this->isElementPresent( "wpConfirmB" ));
7676
7777 $this->click( "wpConfirmB" );
78 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 78+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7979
8080 // Verify 'Action complete' text displayed
8181 $source = $this->gettext( "firstHeading" );
Index: trunk/phase3/tests/selenium/suites/MyContributionsTestCase.php
@@ -41,22 +41,22 @@
4242
4343
4444 $this->click( "link=Contributions" );
45 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 45+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4646
4747 // Verify recent page adding available on My Contributions list
4848 $this->assertEquals( $newPage, $this->getText( "link=".$newPage ));
4949
50 - $this->type( INPUT_SEARCH_BOX, $newPage );
51 - $this->click( BUTTON_SEARCH );
52 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 50+ $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, $newPage );
 51+ $this->click( SeleniumTestConstants::BUTTON_SEARCH );
 52+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5353
54 - $this->click( LINK_EDIT );
55 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
56 - $this->type( TEXT_EDITOR, $newPage . " text changed" );
57 - $this->click( BUTTON_SAVE );
58 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 54+ $this->click( SeleniumTestConstants::LINK_EDIT );
 55+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 56+ $this->type( SeleniumTestConstants::TEXT_EDITOR, $newPage . " text changed" );
 57+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 58+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5959 $this->click( "link=Contributions" );
60 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 60+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6161
6262 // Verify recent page changes available on My Contributions
6363 $this->assertTrue( $this->isTextPresent( $newPage ) );
Index: trunk/phase3/tests/selenium/suites/MyWatchListTestCase.php
@@ -36,21 +36,21 @@
3737
3838 $pageName = $this->createNewTestPage( "MyWatchListTest", true );
3939 // Verify link 'My Watchlist' available
40 - $this->assertTrue( $this->isElementPresent( LINK_START."Watchlist" ) );
 40+ $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::LINK_START."Watchlist" ) );
4141
42 - $this->click( LINK_START."Watchlist" );
43 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 42+ $this->click( SeleniumTestConstants::LINK_START."Watchlist" );
 43+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4444
4545 // Verify newly added page to the watchlist is available
46 - $this->assertEquals( $pageName, $this->getText( LINK_START.$pageName ));
 46+ $this->assertEquals( $pageName, $this->getText( SeleniumTestConstants::LINK_START.$pageName ));
4747
48 - $this->click( LINK_START.$pageName );
49 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
50 - $this->click( LINK_EDIT );
51 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 48+ $this->click( SeleniumTestConstants::LINK_START.$pageName );
 49+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
 50+ $this->click( SeleniumTestConstants::LINK_EDIT );
 51+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5252 $this->click( "wpWatchthis" );
53 - $this->click( BUTTON_SAVE );
54 - $this->assertFalse( $this->isElementPresent( LINK_START.$pageName ) );
 53+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
 54+ $this->assertFalse( $this->isElementPresent( SeleniumTestConstants::LINK_START.$pageName ) );
5555 //todo watch using the dropdown menu
5656 }
5757 }
Index: trunk/phase3/tests/selenium/suites/EmailPasswordTestCase.php
@@ -34,38 +34,38 @@
3535
3636 public function testEmailPasswordButton() {
3737
38 - $this->click( LINK_START."Log out" );
39 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 38+ $this->click( SeleniumTestConstants::LINK_START."Log out" );
 39+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4040
4141 $this->open( $this->getUrl().'/index.php?title=Main_Page' );
4242
4343 // click Log in / create account link to open Log in / create account' page
44 - $this->click( LINK_START."Log in / create account" );
45 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 44+ $this->click( SeleniumTestConstants::LINK_START."Log in / create account" );
 45+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4646 $this->assertTrue($this->isElementPresent( "wpMailmypassword" ));
4747 }
4848
4949 // Verify Email password functionality
5050 public function testEmailPasswordMessages() {
5151
52 - $this->click( LINK_START."Log out" );
53 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 52+ $this->click( SeleniumTestConstants::LINK_START."Log out" );
 53+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5454
5555 $this->open( $this->getUrl().'/index.php?title=Main_Page' );
5656
5757 // click Log in / create account link to open Log in / create account' page
58 - $this->click( LINK_START."Log in / create account" );
59 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 58+ $this->click( SeleniumTestConstants::LINK_START."Log in / create account" );
 59+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6060
6161 $this->type( "wpName1", "" );
6262 $this->click( "wpMailmypassword" );
63 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 63+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6464 $this->assertEquals( "Login error\n You have not specified a valid user name.",
6565 $this->getText("//div[@id='bodyContent']/div[4]"));
6666
6767 $this->type( "wpName1", $this->userName );
6868 $this->click( "wpMailmypassword" );
69 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 69+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7070
7171 // Can not run on localhost
7272 $this->assertEquals( "A new password has been sent to the e-mail address registered for ".ucfirst($this->userName).". Please log in again after you receive it.",
@@ -73,7 +73,7 @@
7474
7575 $this->type( "wpName1", $this->userName );
7676 $this->click( "wpMailmypassword" );
77 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 77+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7878 $this->assertEquals( "Login error\n A password reminder has already been sent, within the last 24 hours. To prevent abuse, only one password reminder will be sent per 24 hours.",
7979 $this->getText( "//div[@id='bodyContent']/div[4]" ));
8080 }
Index: trunk/phase3/tests/selenium/suites/PreviewPageTestCase.php
@@ -36,7 +36,7 @@
3737 $this->open( $this->getUrl() .
3838 '/index.php?title=Main_Page&action=edit' );
3939 $this->getNewPage( $newPage );
40 - $this->type( TEXT_EDITOR, $wikiText."" );
 40+ $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText."" );
4141 $this->assertTrue($this->isElementPresent( "//*[@id='wpPreview']" ));
4242
4343 $this->click( "wpPreview" );
Index: trunk/phase3/tests/selenium/suites/CreateAccountTestCase.php
@@ -37,7 +37,7 @@
3838 public function testMainPageLink() {
3939
4040 $this->click( "link=Log out" );
41 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 41+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
4242
4343 $this->open( $this->getUrl().'/index.php?title=Main_Page' );
4444 $this->assertTrue($this->isElementPresent( "link=Log in / create account" ));
@@ -47,13 +47,13 @@
4848 public function testCreateAccountPageLink() {
4949
5050 $this->click( "link=Log out" );
51 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 51+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5252
5353 $this->open( $this->getUrl().'/index.php?title=Main_Page' );
5454
5555 // click Log in / create account link to open Log in / create account' page
5656 $this->click( "link=Log in / create account" );
57 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 57+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
5858 $this->assertTrue($this->isElementPresent( "link=Create an account" ));
5959 }
6060
@@ -61,27 +61,27 @@
6262 public function testCreateAccount() {
6363
6464 $this->click( "link=Log out" );
65 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 65+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
6666
6767 $this->open( $this->getUrl().'/index.php?title=Main_Page' );
6868
6969 $this->click( "link=Log in / create account" );
70 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 70+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7171
7272 $this->click( "link=Create an account" );
73 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 73+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7474
7575 // Verify for blank user name
7676 $this->type( "wpName2", "" );
7777 $this->click( "wpCreateaccount" );
78 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 78+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
7979 $this->assertEquals( "Login error\n You have not specified a valid user name.",
8080 $this->getText( "//div[@id='bodyContent']/div[4]" ));
8181
8282 // Verify for invalid user name
8383 $this->type( "wpName2", "@" );
8484 $this->click("wpCreateaccount" );
85 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 85+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
8686 $this->assertEquals( "Login error\n You have not specified a valid user name.",
8787 $this->getText( "//div[@id='bodyContent']/div[4]" ));
8888
@@ -89,14 +89,14 @@
9090 $this->type( "wpName2", $this->userName);
9191 $this->type( "wpPassword2", "" );
9292 $this->click( "wpCreateaccount" );
93 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 93+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
9494 $this->assertEquals( "Login error\n Passwords must be at least 1 character.",
9595 $this->getText("//div[@id='bodyContent']/div[4]" ));
9696
9797 $this->type( "wpName2", $this->userName );
9898 $this->type( "wpPassword2", $this->password );
9999 $this->click( "wpCreateaccount" );
100 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 100+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
101101 $this->assertEquals( "Login error\n The passwords you entered do not match.",
102102 $this->getText( "//div[@id='bodyContent']/div[4]" ));
103103
@@ -104,7 +104,7 @@
105105 $this->type( "wpPassword2", $this->password );
106106 $this->type( "wpRetype", $this->password );
107107 $this->click( "wpCreateaccount" );
108 - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME );
 108+ $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME );
109109
110110 // Verify successful account creation for valid combination of 'Username', 'Password', 'Retype password'
111111 $this->assertEquals( "Welcome, ".ucfirst( $this->userName )."!",
Index: trunk/phase3/tests/selenium/suites/SavePageTestCase.php
@@ -37,11 +37,11 @@
3838 $this->open( $this->getUrl() .
3939 '/index.php?title=Main_Page&action=edit' );
4040 $this->getNewPage($newPage);
41 - $this->type( TEXT_EDITOR, $wikiText );
 41+ $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText );
4242
4343 // verify 'Save' button available
44 - $this->assertTrue($this->isElementPresent( BUTTON_SAVE ));
45 - $this->click( BUTTON_SAVE );
 44+ $this->assertTrue($this->isElementPresent( SeleniumTestConstants::BUTTON_SAVE ));
 45+ $this->click( SeleniumTestConstants::BUTTON_SAVE );
4646
4747 // Verify saved page available
4848 $source = $this->gettext( "firstHeading" );

Sign-offs

UserFlagDate
Hasharinspected20:41, 17 March 2011

Follow-up revisions

RevisionCommit summaryAuthorDate
r79443Use an autoloader for the tests, following the ideas from r72858....platonides22:04, 1 January 2011

Status & tagging log