Index: trunk/phase3/tests/selenium/SeleniumTestCase.php |
— | — | @@ -31,24 +31,24 @@ |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * 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 |
36 | 36 | */ |
37 | 37 | function createTestPageIfMissing( $pageName = null ) { |
38 | 38 | if ( $pageName == null ) { |
39 | | - $pageName = WIKI_INTERNAL_LINK; |
| 39 | + $pageName = SeleniumTestConstants::WIKI_INTERNAL_LINK; |
40 | 40 | } |
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 ); |
46 | 46 | $location = $this->getLocation() . "\n"; |
47 | 47 | 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 ); |
51 | 51 | $this->assertTrue( $this->isTextPresent( $pageName ), |
52 | | - $this->getText( TEXT_PAGE_HEADING ) ); |
| 52 | + $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); |
53 | 53 | } |
54 | 54 | } |
55 | 55 | |
— | — | @@ -59,21 +59,21 @@ |
60 | 60 | */ |
61 | 61 | function createNewTestPage( $pagePrefix, $watchThis = false ) { |
62 | 62 | $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 ); |
68 | 68 | $location = $this->getLocation() . "\n"; |
69 | 69 | $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" ); |
71 | 71 | if ( $watchThis ) { |
72 | 72 | $this->click( "wpWatchthis" ); |
73 | 73 | } |
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 ); |
76 | 76 | $this->assertTrue( $this->isTextPresent( $pageName ), |
77 | | - $this->getText( TEXT_PAGE_HEADING ) ); |
| 77 | + $this->getText( SeleniumTestConstants::TEXT_PAGE_HEADING ) ); |
78 | 78 | return $pageName; |
79 | 79 | } |
80 | 80 | |
Index: trunk/phase3/tests/selenium/SeleniumTestConstants.php |
— | — | @@ -1,20 +1,24 @@ |
2 | 2 | <?php |
3 | | -define ('WIKI_TEST_WAIT_TIME', "3000"); // Waiting time |
4 | 3 | |
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 |
9 | 6 | |
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'; |
14 | 11 | |
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'; |
18 | 16 | |
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 @@ |
41 | 41 | $this->clearWikiEditor(); |
42 | 42 | $this->click( "//*[@id='mw-editbutton-bold']" ); |
43 | 43 | $this->clickShowPreviewBtn(); |
44 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 44 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
45 | 45 | |
46 | 46 | // Verify bold text displayed on mediawiki preview |
47 | 47 | $this->assertTrue($this->isElementPresent( "//div[@id='wikiPreview']/p/b" )); |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | $this->clearWikiEditor(); |
58 | 58 | $this->click( "//*[@id='mw-editbutton-italic']" ); |
59 | 59 | $this->clickShowPreviewBtn(); |
60 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 60 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
61 | 61 | |
62 | 62 | // Verify italic text displayed on mediawiki preview |
63 | 63 | $this->assertTrue($this->isElementPresent("//div[@id='wikiPreview']/p/i")); |
— | — | @@ -71,15 +71,15 @@ |
72 | 72 | $this->clearWikiEditor(); |
73 | 73 | $this->click( "//*[@id='mw-editbutton-link']" ); |
74 | 74 | $this->clickShowPreviewBtn(); |
75 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 75 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
76 | 76 | |
77 | 77 | // Verify internal link displayed on mediawiki preview |
78 | 78 | $source = $this->getText( "//*[@id='wikiPreview']/p/a" ); |
79 | 79 | $correct = strstr( $source, "Link title" ); |
80 | 80 | $this->assertEquals( $correct, true ); |
81 | 81 | |
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 ); |
84 | 84 | |
85 | 85 | // Verify internal link open as a new page - editing mode |
86 | 86 | $source = $this->getText( "firstHeading" ); |
— | — | @@ -94,17 +94,17 @@ |
95 | 95 | $this->loadWikiEditor(); |
96 | 96 | $this->clearWikiEditor(); |
97 | 97 | $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]" ); |
99 | 99 | $this->clickShowPreviewBtn(); |
100 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 100 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
101 | 101 | |
102 | 102 | // Verify external links displayed on mediawiki preview |
103 | 103 | $source = $this->getText( "//*[@id='wikiPreview']/p/a" ); |
104 | 104 | $correct = strstr( $source, "Google" ); |
105 | 105 | $this->assertEquals( $correct, true ); |
106 | 106 | |
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 ); |
109 | 109 | |
110 | 110 | // Verify external link opens |
111 | 111 | $source = $this->getTitle(); |
— | — | @@ -122,7 +122,7 @@ |
123 | 123 | $this->clearWikiEditor(); |
124 | 124 | $this->click( "mw-editbutton-headline" ); |
125 | 125 | $this->clickShowPreviewBtn(); |
126 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 126 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
127 | 127 | $this->assertTrue($this->isElementPresent( "//div[@id='wikiPreview']/h2" )); |
128 | 128 | |
129 | 129 | // Verify level 2 headline displayed on mediawiki preview |
— | — | @@ -139,7 +139,7 @@ |
140 | 140 | $this->clearWikiEditor(); |
141 | 141 | $this->click( "//*[@id='mw-editbutton-nowiki']" ); |
142 | 142 | $this->clickShowPreviewBtn(); |
143 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 143 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
144 | 144 | |
145 | 145 | // Verify ignore wiki format text displayed on mediawiki preview |
146 | 146 | $source = $this->getText( "//div[@id='wikiPreview']/p" ); |
— | — | @@ -155,7 +155,7 @@ |
156 | 156 | $this->clearWikiEditor(); |
157 | 157 | $this->click( "mw-editbutton-signature" ); |
158 | 158 | $this->clickShowPreviewBtn(); |
159 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 159 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
160 | 160 | |
161 | 161 | // Verify signature displayed on mediawiki preview |
162 | 162 | $source = $this->getText( "//*[@id='wikiPreview']/p/a" ); |
— | — | @@ -173,7 +173,7 @@ |
174 | 174 | $this->click( "mw-editbutton-hr" ); |
175 | 175 | |
176 | 176 | $this->clickShowPreviewBtn(); |
177 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 177 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
178 | 178 | |
179 | 179 | // Verify horizontal line displayed on mediawiki preview |
180 | 180 | $this->assertTrue( $this->isElementPresent( "//div[@id='wikiPreview']/hr" )); |
Index: trunk/phase3/tests/selenium/suites/AddNewPageTestCase.php |
— | — | @@ -38,7 +38,7 @@ |
39 | 39 | '/index.php?title=Main_Page&action=edit' ); |
40 | 40 | $this->type( "searchInput", $newPage ); |
41 | 41 | $this->click( "searchGoButton" ); |
42 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 42 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
43 | 43 | |
44 | 44 | // Verify 'Search results' text available |
45 | 45 | $source = $this->gettext( "firstHeading" ); |
— | — | @@ -50,12 +50,12 @@ |
51 | 51 | $correct = strstr ( $source, "Create the page \"New\" on this wiki!" ); |
52 | 52 | $this->assertEquals( $correct, true ); |
53 | 53 | |
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 ); |
56 | 56 | |
57 | | - $this->assertTrue($this->isElementPresent( LINK_START."Create" )); |
| 57 | + $this->assertTrue($this->isElementPresent( SeleniumTestConstants::LINK_START."Create" )); |
58 | 58 | $this->type( "wpTextbox1", "add new test page" ); |
59 | | - $this->click( BUTTON_SAVE ); |
| 59 | + $this->click( SeleniumTestConstants::BUTTON_SAVE ); |
60 | 60 | |
61 | 61 | // Verify new page added |
62 | 62 | $source = $this->gettext( "firstHeading" ); |
Index: trunk/phase3/tests/selenium/suites/UserPreferencesTestCase.php |
— | — | @@ -34,8 +34,8 @@ |
35 | 35 | |
36 | 36 | $this->open( $this->getUrl() . |
37 | 37 | '/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 ); |
40 | 40 | |
41 | 41 | // Verify correct username displayed in User Preferences |
42 | 42 | $this->assertEquals( $this->getText( "//li[@id='pt-userpage']/a" ), |
— | — | @@ -51,38 +51,38 @@ |
52 | 52 | |
53 | 53 | $this->open( $this->getUrl() . |
54 | 54 | '/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 ); |
57 | 57 | |
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 ); |
60 | 60 | |
61 | 61 | $this->type( "wpPassword", "12345" ); |
62 | 62 | $this->type( "wpNewPassword", "54321" ); |
63 | 63 | $this->type( "wpRetype", "54321" ); |
64 | 64 | $this->click( "//input[@value='Change password']" ); |
65 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 65 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
66 | 66 | |
67 | 67 | $this->assertEquals( "Preferences", $this->getText( "firstHeading" )); |
68 | 68 | |
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 ); |
71 | 71 | |
72 | 72 | $this->type( "wpPassword", "54321" ); |
73 | 73 | $this->type( "wpNewPassword", "12345" ); |
74 | 74 | $this->type( "wpRetype", "12345" ); |
75 | 75 | $this->click( "//input[@value='Change password']" ); |
76 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 76 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
77 | 77 | $this->assertEquals( "Preferences", $this->getText( "firstHeading" )); |
78 | 78 | |
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 ); |
81 | 81 | |
82 | 82 | $this->type( "wpPassword", "54321" ); |
83 | 83 | $this->type( "wpNewPassword", "12345" ); |
84 | 84 | $this->type( "wpRetype", "12345" ); |
85 | 85 | $this->click( "//input[@value='Change password']" ); |
86 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 86 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
87 | 87 | } |
88 | 88 | |
89 | 89 | // Verify successful preferences save |
— | — | @@ -90,19 +90,19 @@ |
91 | 91 | |
92 | 92 | $this->open( $this->getUrl() . |
93 | 93 | '/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 ); |
96 | 96 | |
97 | 97 | $this->type( "mw-input-realname", "Test User" ); |
98 | 98 | $this->click( "prefcontrol" ); |
99 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 99 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
100 | 100 | |
101 | 101 | // Verify "Your preferences have been saved." message |
102 | 102 | $this->assertEquals( "Your preferences have been saved.", |
103 | 103 | $this->getText( "//div[@id='bodyContent']/div[4]/strong/p" )); |
104 | 104 | $this->type( "mw-input-realname", "" ); |
105 | 105 | $this->click( "prefcontrol" ); |
106 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 106 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
107 | 107 | |
108 | 108 | } |
109 | 109 | |
— | — | @@ -111,18 +111,18 @@ |
112 | 112 | |
113 | 113 | $this->open( $this->getUrl() . |
114 | 114 | '/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 ); |
117 | 117 | |
118 | 118 | $this->type( "mw-input-nickname", "TestSignature" ); |
119 | 119 | $this->click( "prefcontrol" ); |
120 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 120 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
121 | 121 | |
122 | 122 | // Verify change user signature |
123 | | - $this->assertEquals( "TestSignature", $this->getText( LINK_START."TestSignature" )); |
| 123 | + $this->assertEquals( "TestSignature", $this->getText( SeleniumTestConstants::LINK_START."TestSignature" )); |
124 | 124 | $this->type( "mw-input-nickname", "Test" ); |
125 | 125 | $this->click( "prefcontrol" ); |
126 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 126 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
127 | 127 | } |
128 | 128 | |
129 | 129 | // Verify change date format |
— | — | @@ -131,15 +131,15 @@ |
132 | 132 | $this->open( $this->getUrl() . |
133 | 133 | '/index.php?title=Main_Page&action=edit' ); |
134 | 134 | |
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 ); |
139 | 139 | |
140 | 140 | $this->click( "mw-input-date-dmy" ); |
141 | 141 | $this->select( "mw-input-timecorrection", "label=Asia/Colombo" ); |
142 | 142 | $this->click( "prefcontrol" ); |
143 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 143 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
144 | 144 | |
145 | 145 | // Verify Date format and time zome saved |
146 | 146 | $this->assertEquals( "Your preferences have been saved.", |
— | — | @@ -151,15 +151,15 @@ |
152 | 152 | |
153 | 153 | $this->open( $this->getUrl() . |
154 | 154 | '/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 ); |
157 | 157 | |
158 | 158 | // Verify restoring all default settings |
159 | 159 | $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" )); |
161 | 161 | |
162 | 162 | $this->click("//*[@id='preferences']/div/a"); |
163 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 163 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
164 | 164 | |
165 | 165 | // Verify 'This can not be undone' warning message displayed |
166 | 166 | $this->assertTrue($this->isElementPresent("//input[@value='Restore all default settings']")); |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | $this->getText("//div[@id='bodyContent']/p")); |
171 | 171 | |
172 | 172 | $this->click("//input[@value='Restore all default settings']"); |
173 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 173 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
174 | 174 | |
175 | 175 | // Verify preferences saved successfully |
176 | 176 | $this->assertEquals("Your preferences have been saved.", |
Index: trunk/phase3/tests/selenium/suites/PageSearchTestCase.php |
— | — | @@ -34,9 +34,9 @@ |
35 | 35 | |
36 | 36 | $this->open( $this->getUrl() . |
37 | 37 | '/index.php?title=Main_Page&action=edit' ); |
38 | | - $this->type( INPUT_SEARCH_BOX, "calcey qa" ); |
| 38 | + $this->type( SeleniumTestConstants::INPUT_SEARCH_BOX, "calcey qa" ); |
39 | 39 | $this->click( "searchGoButton" ); |
40 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 40 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
41 | 41 | |
42 | 42 | // Verify no page matched with the entered search text |
43 | 43 | $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p/b" ); |
— | — | @@ -44,11 +44,11 @@ |
45 | 45 | $this->assertEquals( $correct, true ); |
46 | 46 | |
47 | 47 | $this->click( "link=Calcey qa" ); |
48 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 48 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
49 | 49 | |
50 | | - $this->type( TEXT_EDITOR , "Calcey QA team" ); |
| 50 | + $this->type( SeleniumTestConstants::TEXT_EDITOR , "Calcey QA team" ); |
51 | 51 | $this->click( "wpSave" ); |
52 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 52 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
53 | 53 | |
54 | 54 | } |
55 | 55 | |
— | — | @@ -57,9 +57,9 @@ |
58 | 58 | |
59 | 59 | $this->open( $this->getUrl() . |
60 | 60 | '/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 ); |
64 | 64 | |
65 | 65 | // Verify no page is available as the search text |
66 | 66 | $source = $this->gettext( "//div[@id='bodyContent']/div[4]/p[2]/b" ); |
— | — | @@ -67,16 +67,16 @@ |
68 | 68 | $this->assertEquals( $correct, true ); |
69 | 69 | |
70 | 70 | $this->click( "link=Calcey web" ); |
71 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 71 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
72 | 72 | |
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 ); |
76 | 76 | |
77 | 77 | // 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 ); |
81 | 81 | |
82 | 82 | // Verify exact page matched with the entered search text using 'Search' button |
83 | 83 | $source = $this->getText( "//*[@id='bodyContent']/div[4]/p/b" ); |
— | — | @@ -84,9 +84,9 @@ |
85 | 85 | $this->assertEquals( $correct, true ); |
86 | 86 | |
87 | 87 | // 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 ); |
91 | 91 | |
92 | 92 | // Verify text avaialble in the search result under the page titles |
93 | 93 | if($this->isElementPresent( "Page_title_matches" )) { |
Index: trunk/phase3/tests/selenium/suites/MovePageTestCase.php |
— | — | @@ -39,18 +39,18 @@ |
40 | 40 | '/index.php?title=Main_Page&action=edit' ); |
41 | 41 | $this->type( "searchInput", $newPage ); |
42 | 42 | $this->click( "searchGoButton" ); |
43 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 43 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
44 | 44 | $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 ); |
49 | 49 | |
50 | 50 | // Verify link 'Move' available |
51 | 51 | $this->assertTrue($this->isElementPresent( "link=Move" )); |
52 | 52 | |
53 | 53 | $this->click( "link=Move" ); |
54 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 54 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
55 | 55 | |
56 | 56 | // Verify correct page name displayed under 'Move Page' field |
57 | 57 | $this->assertEquals($displayName, |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | |
66 | 66 | $this->type( "wpNewTitle", $displayName ); |
67 | 67 | $this->click( "wpMove" ); |
68 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 68 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
69 | 69 | |
70 | 70 | // Verify warning message for the same source and destination titles |
71 | 71 | $this->assertEquals( "Source and destination titles are the same; cannot move a page over itself.", |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | // Verify warning message for the blank title |
75 | 75 | $this->type( "wpNewTitle", "" ); |
76 | 76 | $this->click( "wpMove" ); |
77 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 77 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
78 | 78 | |
79 | 79 | // Verify warning message for the blank title |
80 | 80 | $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 @@ |
83 | 83 | // Verify warning messages for the invalid titles |
84 | 84 | $this->type( "wpNewTitle", "# < > [ ] | { }" ); |
85 | 85 | $this->click( "wpMove" ); |
86 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 86 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
87 | 87 | $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.", |
88 | 88 | $this->getText( "//div[@id='bodyContent']/p[4]/strong" )); |
89 | 89 | |
90 | 90 | $this->type( "wpNewTitle", $displayName."move" ); |
91 | 91 | $this->click( "wpMove" ); |
92 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 92 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
93 | 93 | |
94 | 94 | // Verify move success message displayed correctly |
95 | 95 | $this->assertEquals( "\"".$displayName."\" has been moved to \"".$displayName."move"."\"", |
— | — | @@ -96,14 +96,14 @@ |
97 | 97 | |
98 | 98 | $this->type( "searchInput", $newPage."move" ); |
99 | 99 | $this->click( "searchGoButton" ); |
100 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 100 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
101 | 101 | |
102 | 102 | // Verify search using new page name |
103 | 103 | $this->assertEquals( $displayName."move", $this->getText( "firstHeading" )); |
104 | 104 | |
105 | 105 | $this->type( "searchInput", $newPage ); |
106 | 106 | $this->click( "searchGoButton" ); |
107 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 107 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
108 | 108 | |
109 | 109 | // Verify search using old page name |
110 | 110 | $redirectPageName = $this->getText( "//*[@id='contentSub']" ); |
Index: trunk/phase3/tests/selenium/suites/DeletePageAdminTestCase.php |
— | — | @@ -41,40 +41,40 @@ |
42 | 42 | |
43 | 43 | $this->type( "searchInput", $newPage ); |
44 | 44 | $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 ); |
50 | 50 | |
51 | 51 | $this->open( $this->getUrl() . |
52 | 52 | '/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 ); |
57 | 57 | |
58 | 58 | $this->type( "wpName1", $this->selenium->getUser() ); |
59 | 59 | $this->type( "wpPassword1", $this->selenium->getPass() ); |
60 | 60 | $this->click( "wpLoginAttempt" ); |
61 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 61 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
62 | 62 | $this->type( "searchInput", "new" ); |
63 | 63 | $this->click( "searchGoButton"); |
64 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 64 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
65 | 65 | |
66 | 66 | // Verify 'Delete' link displayed |
67 | | - $source = $this->gettext( LINK_START."Delete" ); |
| 67 | + $source = $this->gettext( SeleniumTestConstants::LINK_START."Delete" ); |
68 | 68 | $correct = strstr ( $source, "Delete" ); |
69 | 69 | $this->assertEquals($correct, true ); |
70 | 70 | |
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 ); |
73 | 73 | |
74 | 74 | // Verify 'Delete' button available |
75 | 75 | $this->assertTrue($this->isElementPresent( "wpConfirmB" )); |
76 | 76 | |
77 | 77 | $this->click( "wpConfirmB" ); |
78 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 78 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
79 | 79 | |
80 | 80 | // Verify 'Action complete' text displayed |
81 | 81 | $source = $this->gettext( "firstHeading" ); |
Index: trunk/phase3/tests/selenium/suites/MyContributionsTestCase.php |
— | — | @@ -41,22 +41,22 @@ |
42 | 42 | |
43 | 43 | |
44 | 44 | $this->click( "link=Contributions" ); |
45 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 45 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
46 | 46 | |
47 | 47 | // Verify recent page adding available on My Contributions list |
48 | 48 | $this->assertEquals( $newPage, $this->getText( "link=".$newPage )); |
49 | 49 | |
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 ); |
53 | 53 | |
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 ); |
59 | 59 | $this->click( "link=Contributions" ); |
60 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 60 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
61 | 61 | |
62 | 62 | // Verify recent page changes available on My Contributions |
63 | 63 | $this->assertTrue( $this->isTextPresent( $newPage ) ); |
Index: trunk/phase3/tests/selenium/suites/MyWatchListTestCase.php |
— | — | @@ -36,21 +36,21 @@ |
37 | 37 | |
38 | 38 | $pageName = $this->createNewTestPage( "MyWatchListTest", true ); |
39 | 39 | // Verify link 'My Watchlist' available |
40 | | - $this->assertTrue( $this->isElementPresent( LINK_START."Watchlist" ) ); |
| 40 | + $this->assertTrue( $this->isElementPresent( SeleniumTestConstants::LINK_START."Watchlist" ) ); |
41 | 41 | |
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 ); |
44 | 44 | |
45 | 45 | // 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 )); |
47 | 47 | |
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 ); |
52 | 52 | $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 ) ); |
55 | 55 | //todo watch using the dropdown menu |
56 | 56 | } |
57 | 57 | } |
Index: trunk/phase3/tests/selenium/suites/EmailPasswordTestCase.php |
— | — | @@ -34,38 +34,38 @@ |
35 | 35 | |
36 | 36 | public function testEmailPasswordButton() { |
37 | 37 | |
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 ); |
40 | 40 | |
41 | 41 | $this->open( $this->getUrl().'/index.php?title=Main_Page' ); |
42 | 42 | |
43 | 43 | // 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 ); |
46 | 46 | $this->assertTrue($this->isElementPresent( "wpMailmypassword" )); |
47 | 47 | } |
48 | 48 | |
49 | 49 | // Verify Email password functionality |
50 | 50 | public function testEmailPasswordMessages() { |
51 | 51 | |
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 ); |
54 | 54 | |
55 | 55 | $this->open( $this->getUrl().'/index.php?title=Main_Page' ); |
56 | 56 | |
57 | 57 | // 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 ); |
60 | 60 | |
61 | 61 | $this->type( "wpName1", "" ); |
62 | 62 | $this->click( "wpMailmypassword" ); |
63 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 63 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
64 | 64 | $this->assertEquals( "Login error\n You have not specified a valid user name.", |
65 | 65 | $this->getText("//div[@id='bodyContent']/div[4]")); |
66 | 66 | |
67 | 67 | $this->type( "wpName1", $this->userName ); |
68 | 68 | $this->click( "wpMailmypassword" ); |
69 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 69 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
70 | 70 | |
71 | 71 | // Can not run on localhost |
72 | 72 | $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 @@ |
74 | 74 | |
75 | 75 | $this->type( "wpName1", $this->userName ); |
76 | 76 | $this->click( "wpMailmypassword" ); |
77 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 77 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
78 | 78 | $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.", |
79 | 79 | $this->getText( "//div[@id='bodyContent']/div[4]" )); |
80 | 80 | } |
Index: trunk/phase3/tests/selenium/suites/PreviewPageTestCase.php |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | $this->open( $this->getUrl() . |
38 | 38 | '/index.php?title=Main_Page&action=edit' ); |
39 | 39 | $this->getNewPage( $newPage ); |
40 | | - $this->type( TEXT_EDITOR, $wikiText."" ); |
| 40 | + $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText."" ); |
41 | 41 | $this->assertTrue($this->isElementPresent( "//*[@id='wpPreview']" )); |
42 | 42 | |
43 | 43 | $this->click( "wpPreview" ); |
Index: trunk/phase3/tests/selenium/suites/CreateAccountTestCase.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | public function testMainPageLink() { |
39 | 39 | |
40 | 40 | $this->click( "link=Log out" ); |
41 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 41 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
42 | 42 | |
43 | 43 | $this->open( $this->getUrl().'/index.php?title=Main_Page' ); |
44 | 44 | $this->assertTrue($this->isElementPresent( "link=Log in / create account" )); |
— | — | @@ -47,13 +47,13 @@ |
48 | 48 | public function testCreateAccountPageLink() { |
49 | 49 | |
50 | 50 | $this->click( "link=Log out" ); |
51 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 51 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
52 | 52 | |
53 | 53 | $this->open( $this->getUrl().'/index.php?title=Main_Page' ); |
54 | 54 | |
55 | 55 | // click Log in / create account link to open Log in / create account' page |
56 | 56 | $this->click( "link=Log in / create account" ); |
57 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 57 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
58 | 58 | $this->assertTrue($this->isElementPresent( "link=Create an account" )); |
59 | 59 | } |
60 | 60 | |
— | — | @@ -61,27 +61,27 @@ |
62 | 62 | public function testCreateAccount() { |
63 | 63 | |
64 | 64 | $this->click( "link=Log out" ); |
65 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 65 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
66 | 66 | |
67 | 67 | $this->open( $this->getUrl().'/index.php?title=Main_Page' ); |
68 | 68 | |
69 | 69 | $this->click( "link=Log in / create account" ); |
70 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 70 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
71 | 71 | |
72 | 72 | $this->click( "link=Create an account" ); |
73 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 73 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
74 | 74 | |
75 | 75 | // Verify for blank user name |
76 | 76 | $this->type( "wpName2", "" ); |
77 | 77 | $this->click( "wpCreateaccount" ); |
78 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 78 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
79 | 79 | $this->assertEquals( "Login error\n You have not specified a valid user name.", |
80 | 80 | $this->getText( "//div[@id='bodyContent']/div[4]" )); |
81 | 81 | |
82 | 82 | // Verify for invalid user name |
83 | 83 | $this->type( "wpName2", "@" ); |
84 | 84 | $this->click("wpCreateaccount" ); |
85 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 85 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
86 | 86 | $this->assertEquals( "Login error\n You have not specified a valid user name.", |
87 | 87 | $this->getText( "//div[@id='bodyContent']/div[4]" )); |
88 | 88 | |
— | — | @@ -89,14 +89,14 @@ |
90 | 90 | $this->type( "wpName2", $this->userName); |
91 | 91 | $this->type( "wpPassword2", "" ); |
92 | 92 | $this->click( "wpCreateaccount" ); |
93 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 93 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
94 | 94 | $this->assertEquals( "Login error\n Passwords must be at least 1 character.", |
95 | 95 | $this->getText("//div[@id='bodyContent']/div[4]" )); |
96 | 96 | |
97 | 97 | $this->type( "wpName2", $this->userName ); |
98 | 98 | $this->type( "wpPassword2", $this->password ); |
99 | 99 | $this->click( "wpCreateaccount" ); |
100 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 100 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
101 | 101 | $this->assertEquals( "Login error\n The passwords you entered do not match.", |
102 | 102 | $this->getText( "//div[@id='bodyContent']/div[4]" )); |
103 | 103 | |
— | — | @@ -104,7 +104,7 @@ |
105 | 105 | $this->type( "wpPassword2", $this->password ); |
106 | 106 | $this->type( "wpRetype", $this->password ); |
107 | 107 | $this->click( "wpCreateaccount" ); |
108 | | - $this->waitForPageToLoad( WIKI_TEST_WAIT_TIME ); |
| 108 | + $this->waitForPageToLoad( SeleniumTestConstants::WIKI_TEST_WAIT_TIME ); |
109 | 109 | |
110 | 110 | // Verify successful account creation for valid combination of 'Username', 'Password', 'Retype password' |
111 | 111 | $this->assertEquals( "Welcome, ".ucfirst( $this->userName )."!", |
Index: trunk/phase3/tests/selenium/suites/SavePageTestCase.php |
— | — | @@ -37,11 +37,11 @@ |
38 | 38 | $this->open( $this->getUrl() . |
39 | 39 | '/index.php?title=Main_Page&action=edit' ); |
40 | 40 | $this->getNewPage($newPage); |
41 | | - $this->type( TEXT_EDITOR, $wikiText ); |
| 41 | + $this->type( SeleniumTestConstants::TEXT_EDITOR, $wikiText ); |
42 | 42 | |
43 | 43 | // 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 ); |
46 | 46 | |
47 | 47 | // Verify saved page available |
48 | 48 | $source = $this->gettext( "firstHeading" ); |