Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_ExsistingPage.php |
— | — | @@ -1,6 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | require_once 'WikiDialogs_TC.php'; |
4 | | - |
5 | 4 | /** |
6 | 5 | * Description of WikiExsistingPageDialogs |
7 | 6 | * |
— | — | @@ -12,145 +11,100 @@ |
13 | 12 | parent::setUp(); |
14 | 13 | } |
15 | 14 | |
16 | | - // Add a internal link and verify |
17 | | - function testInternalLink(){ |
| 15 | + //Open a random page |
| 16 | + function openRandomPage(){ |
18 | 17 | parent::doOpenLink(); |
19 | 18 | parent::doLogin(); |
20 | | - $this->open("/deployment-en/Main_Page"); |
21 | | - $this->waitForPageToLoad("30000"); |
22 | 19 | parent::doAccessRandomPage(); |
| 20 | + parent::doEditPage(); |
| 21 | + } |
| 22 | + // Add a internal link and verify |
| 23 | + function testInternalLink(){ |
| 24 | + $this->openRandomPage(); |
23 | 25 | parent::verifyInternalLink(); |
24 | 26 | parent::doLogout(); |
25 | 27 | } |
26 | 28 | |
27 | 29 | // Add a internal link with different display text and verify |
28 | 30 | function testInternalLinkWithDisplayText(){ |
29 | | - parent::doOpenLink(); |
30 | | - parent::doLogin(); |
31 | | - $this->open("/deployment-en/Main_Page"); |
32 | | - $this->waitForPageToLoad("30000"); |
33 | | - parent::doAccessRandomPage(); |
| 31 | + $this->openRandomPage(); |
34 | 32 | parent::verifyInternalLinkWithDisplayText(); |
35 | 33 | parent::doLogout(); |
36 | 34 | } |
37 | 35 | |
38 | 36 | // Add a internal link with blank display text and verify |
39 | 37 | function testInternalLinkWithBlankDisplayText(){ |
40 | | - parent::doOpenLink(); |
41 | | - parent::doLogin(); |
42 | | - $this->open("/deployment-en/Main_Page"); |
43 | | - $this->waitForPageToLoad("30000"); |
44 | | - parent::doAccessRandomPage(); |
| 38 | + $this->openRandomPage(); |
45 | 39 | parent::verifyInternalLinkWithBlankDisplayText(); |
46 | 40 | parent::doLogout(); |
47 | 41 | } |
48 | 42 | |
49 | 43 | // Add external link and verify |
50 | 44 | function testExternalLink(){ |
51 | | - parent::doOpenLink(); |
52 | | - parent::doLogin(); |
53 | | - $this->open("/deployment-en/Main_Page"); |
54 | | - $this->waitForPageToLoad("30000"); |
55 | | - parent::doAccessRandomPage(); |
| 45 | + $this->openRandomPage(); |
56 | 46 | parent::verifyExternalLink(); |
57 | 47 | parent::doLogout(); |
58 | 48 | } |
59 | 49 | |
60 | 50 | // Add external link with different display text and verify |
61 | 51 | function testExternalLinkWithDisplayText(){ |
62 | | - parent::doOpenLink(); |
63 | | - parent::doLogin(); |
64 | | - $this->open("/deployment-en/Main_Page"); |
65 | | - $this->waitForPageToLoad("30000"); |
66 | | - parent::doAccessRandomPage(); |
| 52 | + $this->openRandomPage(); |
67 | 53 | parent::verifyExternalLinkWithDisplayText(); |
68 | 54 | parent::doLogout(); |
69 | 55 | } |
70 | 56 | |
71 | 57 | // Add external link with Blank display text and verify |
72 | 58 | function testExternalLinkWithBlankDisplayText(){ |
73 | | - parent::doOpenLink(); |
74 | | - parent::doLogin(); |
75 | | - $this->open("/deployment-en/Main_Page"); |
76 | | - $this->waitForPageToLoad("30000"); |
77 | | - parent::doAccessRandomPage(); |
| 59 | + $this->openRandomPage(); |
78 | 60 | parent::verifyExternalLinkWithBlankDisplayText(); |
79 | 61 | parent::doLogout(); |
80 | 62 | } |
81 | 63 | |
82 | 64 | // Add a table and verify |
83 | 65 | function testCreateTable(){ |
84 | | - parent::doOpenLink(); |
85 | | - parent::doLogin(); |
86 | | - $this->open("/deployment-en/Main_Page"); |
87 | | - $this->waitForPageToLoad("30000"); |
88 | | - parent::doAccessRandomPage(); |
| 66 | + $this->openRandomPage(); |
89 | 67 | parent::verifyCreateTable(); |
90 | 68 | parent::doLogout(); |
91 | 69 | } |
92 | 70 | |
93 | 71 | // Add a table and verify only with head row |
94 | 72 | function testCreateTableWithHeadRow(){ |
95 | | - parent::doOpenLink(); |
96 | | - parent::doLogin(); |
97 | | - $this->open("/deployment-en/Main_Page"); |
98 | | - $this->waitForPageToLoad("30000"); |
99 | | - parent::doAccessRandomPage(); |
| 73 | + $this->openRandomPage(); |
100 | 74 | parent::verifyCreateTableWithHeadRow(); |
101 | 75 | parent::doLogout(); |
102 | 76 | } |
103 | 77 | |
104 | 78 | // Add a table and verify only with borders |
105 | 79 | function testCreateTableWithBorders(){ |
106 | | - parent::doOpenLink(); |
107 | | - parent::doLogin(); |
108 | | - $this->open("/deployment-en/Main_Page"); |
109 | | - $this->waitForPageToLoad("30000"); |
110 | | - parent::doAccessRandomPage(); |
| 80 | + $this->openRandomPage(); |
111 | 81 | parent::verifyCreateTableWithBorders(); |
112 | 82 | parent::doLogout(); |
113 | 83 | } |
114 | 84 | |
115 | 85 | // Add a table and verify only with sort row |
116 | 86 | function testCreateTableWithSortRow(){ |
117 | | - parent::doOpenLink(); |
118 | | - parent::doLogin(); |
119 | | - $this->open("/deployment-en/Main_Page"); |
120 | | - $this->waitForPageToLoad("30000"); |
121 | | - parent::doAccessRandomPage(); |
| 87 | + $this->openRandomPage(); |
122 | 88 | parent::verifyCreateTableWithSortRow(); |
123 | 89 | parent::doLogout(); |
124 | 90 | } |
125 | 91 | |
126 | 92 | // Add a table without headers,borders and sort rows |
127 | 93 | function testCreateTableWithNoSpecialEffects(){ |
128 | | - parent::doOpenLink(); |
129 | | - parent::doLogin(); |
130 | | - $this->open("/deployment-en/Main_Page"); |
131 | | - $this->waitForPageToLoad("30000"); |
132 | | - parent::doAccessRandomPage(); |
| 94 | + $this->openRandomPage(); |
133 | 95 | parent::verifyCreateTableWithNoSpecialEffects(); |
134 | 96 | parent::doLogout(); |
135 | 97 | } |
136 | 98 | |
137 | 99 | // Verify the replace all function on Search and Replace |
138 | 100 | function testTextSearchReplaceAll(){ |
139 | | - parent::doOpenLink(); |
140 | | - parent::doLogin(); |
141 | | - $this->open("/deployment-en/Main_Page"); |
142 | | - $this->waitForPageToLoad("30000"); |
143 | | - parent::doAccessRandomPage(); |
| 101 | + $this->openRandomPage(); |
144 | 102 | parent::verifyTextSearchReplaceAll(); |
145 | 103 | parent::doLogout(); |
146 | 104 | } |
147 | 105 | |
148 | 106 | // Verify the replace next function on Search and Replace |
149 | 107 | function testTextSearchReplaceNext(){ |
150 | | - parent::doOpenLink(); |
151 | | - parent::doLogin(); |
152 | | - $this->open("/deployment-en/Main_Page"); |
153 | | - $this->waitForPageToLoad("30000"); |
154 | | - parent::doAccessRandomPage(); |
| 108 | + $this->openRandomPage(); |
155 | 109 | parent::verifyTextSearchReplaceNext(); |
156 | 110 | parent::doLogout(); |
157 | 111 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikSearch_TC.php |
— | — | @@ -1,11 +1,15 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
| 6 | + |
4 | 7 | /** |
5 | 8 | * This test case will be handling the search function. |
6 | 9 | * Date : Apr - 2010 |
7 | 10 | * @author : BhagyaG - Calcey |
8 | 11 | */ |
9 | 12 | class WikiSearch_TC extends WikiCommonFunction_TC { |
| 13 | + |
10 | 14 | // Set up the testing environment |
11 | 15 | function setup(){ |
12 | 16 | parent::setUp(); |
— | — | @@ -16,16 +20,16 @@ |
17 | 21 | parent::doOpenLink(); |
18 | 22 | parent::doLogin(); |
19 | 23 | $this->click("link=Main page"); |
20 | | - $this->type("//*[@id='searchInput']", "Hair (musical)"); |
| 24 | + $this->type("//*[@id='searchInput']", $_SESSION["WIKI_SEARCH_PAGE"]); |
21 | 25 | $this->click("//*[@id='searchButton']"); |
22 | | - $this->waitForPageToLoad("30000"); |
| 26 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
23 | 27 | try { |
24 | | - $this->assertEquals("Hair (musical)", $this->getText("//*[@id='firstHeading']")); |
| 28 | + $this->assertEquals($_SESSION["WIKI_SEARCH_PAGE"], $this->getText("//*[@id='firstHeading']")); |
25 | 29 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
26 | 30 | array_push($this->verificationErrors, $e->toString()); |
27 | 31 | } |
28 | 32 | $this->click("link=Main page"); |
29 | | - $this->waitForPageToLoad("30000"); |
| 33 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
30 | 34 | parent::doLogout(); |
31 | 35 | } |
32 | 36 | |
— | — | @@ -34,22 +38,21 @@ |
35 | 39 | parent::doOpenLink(); |
36 | 40 | parent::doLogin(); |
37 | 41 | $this->click("link=Main page"); |
38 | | - $this->waitForPageToLoad("30000"); |
39 | | - $this->type("//*[@id='searchInput']", "TV"); |
| 42 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 43 | + $this->type("//*[@id='searchInput']",$_SESSION["WIKI_SEARCH_TEXT"]); |
40 | 44 | $this->click("searchButton"); |
41 | | - $this->waitForPageToLoad("30000"); |
| 45 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
42 | 46 | try { |
43 | 47 | $this->assertEquals("Search results", $this->getText("firstHeading")); |
44 | 48 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
45 | 49 | array_push($this->verificationErrors, $e->toString()); |
46 | 50 | } |
47 | 51 | try { |
48 | | - $this->assertEquals("TV - Search results - Wikipedia, the free encyclopedia", $this->getTitle()); |
| 52 | + $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"] . " - Search results - Wikipedia, the free encyclopedia", $this->getTitle()); |
49 | 53 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
50 | 54 | array_push($this->verificationErrors, $e->toString()); |
51 | 55 | } |
52 | 56 | parent::doLogout(); |
53 | 57 | } |
54 | | - |
55 | 58 | } |
56 | 59 | ?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /** |
5 | 7 | * This test case will be handling the text formatting related functions via tool bar |
6 | 8 | * Date : Apr - 2010 |
— | — | @@ -13,7 +15,7 @@ |
14 | 16 | $this->click("link=Bold"); |
15 | 17 | $this->type("wpTextbox1", "'''Bold''' text"); |
16 | 18 | $this->click("wpPreview"); |
17 | | - $this->waitForPageToLoad("30000"); |
| 19 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
18 | 20 | try { |
19 | 21 | $this->assertEquals("Bold", $this->getText("//div[@id='wikiPreview']/p/b")); |
20 | 22 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -27,7 +29,7 @@ |
28 | 30 | $this->click("link=Italic"); |
29 | 31 | $this->type("wpTextbox1", "''Italian'' text"); |
30 | 32 | $this->click("wpPreview"); |
31 | | - $this->waitForPageToLoad("30000"); |
| 33 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
32 | 34 | $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i")); |
33 | 35 | } |
34 | 36 | |
— | — | @@ -38,7 +40,7 @@ |
39 | 41 | $this->click("link=Bold"); |
40 | 42 | $this->type("wpTextbox1", "Text '''''Italic & Bold'''''"); |
41 | 43 | $this->click("wpPreview"); |
42 | | - $this->waitForPageToLoad("30000"); |
| 44 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
43 | 45 | $this->assertEquals("Italic & Bold", $this->getText("//div[@id='wikiPreview']/p/i/b")); |
44 | 46 | } |
45 | 47 | |
— | — | @@ -52,7 +54,7 @@ |
53 | 55 | $this->click("link=Bulleted list"); |
54 | 56 | $this->type("wpTextbox1", "* Bulleted list item\n* Bulleted list item\n* Bulleted list item"); |
55 | 57 | $this->click("wpPreview"); |
56 | | - $this->waitForPageToLoad("30000"); |
| 58 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
57 | 59 | try { |
58 | 60 | $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[1]")); |
59 | 61 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -79,7 +81,7 @@ |
80 | 82 | $this->click("link=Numbered list"); |
81 | 83 | $this->type("wpTextbox1", "# Numbered list item\n# Numbered list item\n# Numbered list item"); |
82 | 84 | $this->click("wpPreview"); |
83 | | - $this->waitForPageToLoad("30000"); |
| 85 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
84 | 86 | try { |
85 | 87 | $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[1]")); |
86 | 88 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -103,7 +105,7 @@ |
104 | 106 | $this->type("wpTextbox1", ""); |
105 | 107 | $this->type("wpTextbox1", "<nowiki>==Heading text==</nowiki>"); |
106 | 108 | $this->click("wpPreview"); |
107 | | - $this->waitForPageToLoad("30000"); |
| 109 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
108 | 110 | try { |
109 | 111 | $this->assertEquals("==Heading text==", $this->getText("//div[@id='wikiPreview']/p")); |
110 | 112 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -117,7 +119,7 @@ |
118 | 120 | $this->type("wpTextbox1", ""); |
119 | 121 | $this->type("wpTextbox1", "this is a test text to check the line\n break."); |
120 | 122 | $this->click("wpPreview"); |
121 | | - $this->waitForPageToLoad("30000"); |
| 123 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
122 | 124 | try { |
123 | 125 | $this->assertEquals("this is a test text to check the line\n break.", $this->getText("//div[@id='wikiPreview']/p")); |
124 | 126 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -132,7 +134,7 @@ |
133 | 135 | $this->click("link=Big"); |
134 | 136 | $this->type("wpTextbox1", "<big>This</big> text"); |
135 | 137 | $this->click("wpPreview"); |
136 | | - $this->waitForPageToLoad("30000"); |
| 138 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
137 | 139 | try { |
138 | 140 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/big")); |
139 | 141 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -147,7 +149,7 @@ |
148 | 150 | $this->click("link=Small"); |
149 | 151 | $this->type("wpTextbox1", "<small>This</small> text\n"); |
150 | 152 | $this->click("wpPreview"); |
151 | | - $this->waitForPageToLoad("30000"); |
| 153 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
152 | 154 | try { |
153 | 155 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/small")); |
154 | 156 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -162,7 +164,7 @@ |
163 | 165 | $this->click("link=Superscript"); |
164 | 166 | $this->type("wpTextbox1", "<sup>This</sup> text\n"); |
165 | 167 | $this->click("wpPreview"); |
166 | | - $this->waitForPageToLoad("30000"); |
| 168 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
167 | 169 | try { |
168 | 170 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sup")); |
169 | 171 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -177,7 +179,7 @@ |
178 | 180 | $this->click("link=Subscript"); |
179 | 181 | $this->type("wpTextbox1", "<sub>This</sub> text\n"); |
180 | 182 | $this->click("wpPreview"); |
181 | | - $this->waitForPageToLoad("30000"); |
| 183 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
182 | 184 | try { |
183 | 185 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sub")); |
184 | 186 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonFunction_TC.php |
— | — | @@ -1,11 +1,13 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'PHPUnit/Extensions/SeleniumTestCase.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /** |
5 | 7 | * This test case will be handling the common functions on test. |
6 | 8 | * Date : Apr - 2010 |
7 | 9 | * @author : BhagyaG - Calcey |
8 | 10 | */ |
9 | | -class WikiCommonFunction_TC extends PHPUnit_Extensions_SeleniumTestCase { |
| 11 | +class WikiCommonFunction_TC extends PHPUnit_Extensions_SeleniumTestCase{ |
10 | 12 | /** Wiki server environment details.This array should be commented if the test |
11 | 13 | * run on local browsers. |
12 | 14 | |
— | — | @@ -24,43 +26,48 @@ |
25 | 27 | // Setting the local browser. this should be disabled if the test run in Wiki environment. |
26 | 28 | $this->setBrowser("*firefox"); |
27 | 29 | // Main link to be connected |
28 | | - $this->setBrowserUrl("http://prototype.wikimedia.org"); |
| 30 | + $this->setBrowserUrl($_SESSION["WIKI_WEB_URL"]); |
| 31 | + |
29 | 32 | } |
30 | 33 | |
31 | 34 | // Open the page. |
32 | 35 | function doOpenLink(){ |
33 | | - $this->open("/deployment-en/Main_Page"); |
34 | | - $this->waitForPageToLoad("30000"); |
| 36 | + $this->open($_SESSION["WIKI_OPEN_PAGE"]); |
| 37 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
35 | 38 | } |
36 | 39 | |
37 | 40 | // Login to the application |
38 | 41 | function doLogin() { |
39 | 42 | if (!$this->isTextPresent("Log out")) { |
40 | 43 | $this->click("link=Log in / create account"); |
41 | | - $this->waitForPageToLoad("30000"); |
42 | | - $this->type("wpName1", "bhagya_qa"); |
43 | | - $this->type("wpPassword1", "test"); |
| 44 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 45 | + $this->type("wpName1", $_SESSION["WIKI_USER_NAME"]); |
| 46 | + $this->type("wpPassword1", $_SESSION["WIKI_USER_PASSWORD"]); |
44 | 47 | $this->click("wpLoginAttempt"); |
45 | | - $this->waitForPageToLoad("30000"); |
| 48 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
46 | 49 | try { |
47 | | - $this->assertEquals("Bhagya qa", $this->getText("link=Bhagya qa")); |
| 50 | + $this->assertEquals($_SESSION["WIKI_USER_DISPLAY_NAME"], $this->getText("link=" . $_SESSION["WIKI_USER_DISPLAY_NAME"])); |
48 | 51 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
49 | 52 | array_push($this->verificationErrors, $e->toString()); |
50 | 53 | } |
| 54 | + $this->open($_SESSION["WIKI_OPEN_PAGE"]); |
| 55 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
51 | 56 | } |
52 | 57 | } |
53 | 58 | |
54 | 59 | // Log out from the application |
55 | 60 | function doLogout() { |
56 | | - $this->open("/deployment-en/Main_Page"); |
| 61 | + $this->open($_SESSION["WIKI_OPEN_PAGE"]); |
57 | 62 | if ($this->isTextPresent("Log out")) { |
58 | 63 | $this->click("link=Log out"); |
59 | | - $this->waitForPageToLoad("30000"); |
| 64 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
60 | 65 | try { |
61 | 66 | $this->assertEquals("Log in / create account", $this->getText("link=Log in / create account")); |
62 | 67 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
63 | 68 | array_push($this->verificationErrors, $e->toString()); |
64 | 69 | } |
| 70 | + $this->open($_SESSION["WIKI_OPEN_PAGE"]); |
| 71 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
65 | 72 | } |
66 | 73 | } |
67 | 74 | |
— | — | @@ -75,17 +82,21 @@ |
76 | 83 | function doCreateNewPageTemporary() { |
77 | 84 | $this->type("//*[@id='searchInput']", "TestWikiPaget"); |
78 | 85 | $this->click("//*[@id='searchButton']"); |
79 | | - $this->waitForPageToLoad("30000"); |
| 86 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
80 | 87 | $this->click("link=TestWikiPaget"); |
81 | | - $this->waitForPageToLoad("30000"); |
| 88 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
82 | 89 | } |
83 | 90 | |
84 | 91 | //Access a random page |
85 | 92 | function doAccessRandomPage() { |
86 | 93 | $this->click("link=Random article"); |
87 | | - $this->waitForPageToLoad("30000"); |
| 94 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 95 | + } |
| 96 | + |
| 97 | + //Access a random page |
| 98 | + function doEditPage() { |
88 | 99 | $this->click("//li[@id='ca-edit']/a/span"); |
89 | | - $this->waitForPageToLoad("30000"); |
| 100 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
90 | 101 | } |
91 | 102 | } |
92 | 103 | ?> |
\ No newline at end of file |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatch_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /** |
5 | 7 | * This test case will be handling the page watch functions. |
6 | 8 | * Date : Apr - 2010 |
— | — | @@ -13,7 +15,6 @@ |
14 | 16 | |
15 | 17 | // Mark a page as watch and verify the My Watch list |
16 | 18 | function testWatch(){ |
17 | | - |
18 | 19 | parent::doOpenLink(); |
19 | 20 | parent::doLogin(); |
20 | 21 | $this->click("link=Random article"); |
— | — | @@ -60,9 +61,35 @@ |
61 | 62 | |
62 | 63 | } |
63 | 64 | |
64 | | - /** function testEditWatch(){ |
| 65 | + // Mark a page as watch on page edit and verify the My Watch list |
| 66 | + function testPageWatchonEdit(){ |
| 67 | + parent::doOpenLink(); |
| 68 | + parent::doLogin(); |
| 69 | + parent::doAccessRandomPage(); |
| 70 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 71 | + $randompage = $this->getText("firstHeading"); |
| 72 | + parent::doEditPage(); |
| 73 | + try { |
| 74 | + $this->assertEquals("Watch", $this->getText("link=Watch")); |
| 75 | + } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 76 | + array_push($this->verificationErrors, $e->toString()); |
| 77 | + } |
| 78 | + $this->click("wpWatchthis"); |
| 79 | + $this->click("wpSave"); |
| 80 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 81 | + try { |
| 82 | + $this->assertEquals("Unwatch", $this->getText("link=Unwatch")); |
| 83 | + } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 84 | + array_push($this->verificationErrors, $e->toString()); |
| 85 | + } |
| 86 | + $this->click("link=My watchlist"); |
| 87 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 88 | + $this->click("link=View and edit watchlist"); |
| 89 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
| 90 | + $this->assertTrue($this->isTextPresent($randompage)); |
65 | 91 | |
66 | | - }**/ |
| 92 | + parent::doLogout(); |
| 93 | + } |
67 | 94 | |
68 | 95 | } |
69 | 96 | ?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_NewPage.php |
— | — | @@ -11,156 +11,107 @@ |
12 | 12 | parent::setUp(); |
13 | 13 | } |
14 | 14 | |
15 | | - // Add a internal link and verify |
16 | | - function testInternalLink(){ |
| 15 | + //Create a new page temporary |
| 16 | + function createNewPage(){ |
17 | 17 | parent::doOpenLink(); |
18 | 18 | parent::doLogin(); |
19 | | - $this->open("/deployment-en/Main_Page"); |
20 | | - $this->waitForPageToLoad("30000"); |
21 | 19 | parent::doCreateNewPageTemporary(); |
| 20 | + } |
| 21 | + |
| 22 | + // Add a internal link and verify |
| 23 | + function testInternalLink(){ |
| 24 | + $this->createNewPage(); |
22 | 25 | parent::verifyInternalLink(); |
23 | 26 | parent::doLogout(); |
24 | 27 | } |
25 | 28 | |
26 | 29 | // Add a internal link with different display text and verify |
27 | 30 | function testInternalLinkWithDisplayText(){ |
28 | | - parent::doOpenLink(); |
29 | | - parent::doLogin(); |
30 | | - $this->open("/deployment-en/Main_Page"); |
31 | | - $this->waitForPageToLoad("30000"); |
32 | | - parent::doCreateNewPageTemporary(); |
| 31 | + $this->createNewPage(); |
33 | 32 | parent::verifyInternalLinkWithDisplayText(); |
34 | 33 | parent::doLogout(); |
35 | 34 | } |
36 | 35 | |
37 | 36 | // Add a internal link with blank display text and verify |
38 | 37 | function testInternalLinkWithBlankDisplayText(){ |
39 | | - parent::doOpenLink(); |
40 | | - parent::doLogin(); |
41 | | - $this->open("/deployment-en/Main_Page"); |
42 | | - $this->waitForPageToLoad("30000"); |
43 | | - parent::doCreateNewPageTemporary(); |
| 38 | + $this->createNewPage(); |
44 | 39 | parent::verifyInternalLinkWithBlankDisplayText(); |
45 | 40 | parent::doLogout(); |
46 | 41 | } |
47 | 42 | |
48 | 43 | // Add external link and verify |
49 | 44 | function testExternalLink(){ |
50 | | - parent::doOpenLink(); |
51 | | - parent::doLogin(); |
52 | | - $this->open("/deployment-en/Main_Page"); |
53 | | - $this->waitForPageToLoad("30000"); |
54 | | - parent::doCreateNewPageTemporary(); |
| 45 | + $this->createNewPage(); |
55 | 46 | parent::verifyExternalLink(); |
56 | 47 | parent::doLogout(); |
57 | 48 | } |
58 | 49 | |
59 | 50 | // Add external link with different display text and verify |
60 | 51 | function testExternalLinkWithDisplayText(){ |
61 | | - parent::doOpenLink(); |
62 | | - parent::doLogin(); |
63 | | - $this->open("/deployment-en/Main_Page"); |
64 | | - $this->waitForPageToLoad("30000"); |
65 | | - parent::doCreateNewPageTemporary(); |
| 52 | + $this->createNewPage(); |
66 | 53 | parent::verifyExternalLinkWithDisplayText(); |
67 | 54 | parent::doLogout(); |
68 | 55 | } |
69 | 56 | |
70 | 57 | // Add external link with Blank display text and verify |
71 | 58 | function testExternalLinkWithBlankDisplayText(){ |
72 | | - parent::doOpenLink(); |
73 | | - parent::doLogin(); |
74 | | - $this->open("/deployment-en/Main_Page"); |
75 | | - $this->waitForPageToLoad("30000"); |
76 | | - parent::doCreateNewPageTemporary(); |
| 59 | + $this->createNewPage(); |
77 | 60 | parent::verifyExternalLinkWithBlankDisplayText(); |
78 | 61 | parent::doLogout(); |
79 | 62 | } |
80 | 63 | |
81 | 64 | // Add a table and verify |
82 | 65 | function testCreateTable(){ |
83 | | - parent::doOpenLink(); |
84 | | - parent::doLogin(); |
85 | | - $this->open("/deployment-en/Main_Page"); |
86 | | - $this->waitForPageToLoad("30000"); |
87 | | - parent::doCreateNewPageTemporary(); |
| 66 | + $this->createNewPage(); |
88 | 67 | parent::verifyCreateTable(); |
89 | 68 | parent::doLogout(); |
90 | 69 | } |
91 | 70 | |
92 | 71 | // Add a table and verify only with head row |
93 | 72 | function testCreateTableWithHeadRow(){ |
94 | | - parent::doOpenLink(); |
95 | | - parent::doLogin(); |
96 | | - $this->open("/deployment-en/Main_Page"); |
97 | | - $this->waitForPageToLoad("30000"); |
98 | | - parent::doCreateNewPageTemporary(); |
| 73 | + $this->createNewPage();; |
99 | 74 | parent::verifyCreateTableWithHeadRow(); |
100 | 75 | parent::doLogout(); |
101 | 76 | } |
102 | 77 | |
103 | 78 | // Add a table and verify only with borders |
104 | 79 | function testCreateTableWithBorders(){ |
105 | | - parent::doOpenLink(); |
106 | | - parent::doLogin(); |
107 | | - $this->open("/deployment-en/Main_Page"); |
108 | | - $this->waitForPageToLoad("30000"); |
109 | | - parent::doCreateNewPageTemporary(); |
| 80 | + $this->createNewPage(); |
110 | 81 | parent::verifyCreateTableWithBorders(); |
111 | 82 | parent::doLogout(); |
112 | 83 | } |
113 | 84 | |
114 | 85 | // Add a table and verify only with sort row |
115 | 86 | function testCreateTableWithSortRow(){ |
116 | | - parent::doOpenLink(); |
117 | | - parent::doLogin(); |
118 | | - $this->open("/deployment-en/Main_Page"); |
119 | | - $this->waitForPageToLoad("30000"); |
120 | | - parent::doCreateNewPageTemporary(); |
| 87 | + $this->createNewPage(); |
121 | 88 | parent::verifyCreateTableWithSortRow(); |
122 | 89 | parent::doLogout(); |
123 | 90 | } |
124 | 91 | |
125 | 92 | // Add a table without headers,borders and sort rows |
126 | 93 | function testCreateTableWithNoSpecialEffects(){ |
127 | | - parent::doOpenLink(); |
128 | | - parent::doLogin(); |
129 | | - $this->open("/deployment-en/Main_Page"); |
130 | | - $this->waitForPageToLoad("30000"); |
131 | | - parent::doCreateNewPageTemporary(); |
| 94 | + $this->createNewPage(); |
132 | 95 | parent::verifyCreateTableWithNoSpecialEffects(); |
133 | 96 | parent::doLogout(); |
134 | 97 | } |
135 | 98 | |
136 | 99 | // Verify the replace all function on Search and Replace |
137 | 100 | function testTextSearchReplaceAll(){ |
138 | | - parent::doOpenLink(); |
139 | | - parent::doLogin(); |
140 | | - $this->open("/deployment-en/Main_Page"); |
141 | | - $this->waitForPageToLoad("30000"); |
142 | | - parent::doCreateNewPageTemporary(); |
| 101 | + $this->createNewPage(); |
143 | 102 | parent::verifyTextSearchReplaceAll(); |
144 | 103 | parent::doLogout(); |
145 | 104 | } |
146 | 105 | |
147 | 106 | // Verify the replace next function on Search and Replace |
148 | 107 | function testTextSearchReplaceNext(){ |
149 | | - parent::doOpenLink(); |
150 | | - parent::doLogin(); |
151 | | - $this->open("/deployment-en/Main_Page"); |
152 | | - $this->waitForPageToLoad("30000"); |
153 | | - parent::doCreateNewPageTemporary(); |
| 108 | + $this->createNewPage(); |
154 | 109 | parent::verifyTextSearchReplaceNext(); |
155 | 110 | parent::doLogout(); |
156 | 111 | } |
157 | 112 | |
158 | 113 | // When user click on find, text highlight on back which is not captured in Selenium directly. */ |
159 | 114 | function testTextSearchFindNext(){ |
160 | | - parent::doOpenLink(); |
161 | | - parent::doLogin(); |
162 | | - $this->open("/deployment-en/Main_Page"); |
163 | | - $this->waitForPageToLoad("30000"); |
164 | | - parent::doCreateNewPageTemporary(); |
| 115 | + $this->createNewPage(); |
165 | 116 | parent::verifyTextSearchFindNext(); |
166 | 117 | parent::doLogout(); |
167 | 118 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /* |
5 | 7 | * This test case will be handling the NTOC related functions. |
6 | 8 | * Adding different header levels via tool bar and verify the output |
— | — | @@ -17,7 +19,7 @@ |
18 | 20 | $this->click("link=Level 2"); |
19 | 21 | $this->type("wpTextbox1", "==Heading text=="); |
20 | 22 | $this->click("wpPreview"); |
21 | | - $this->waitForPageToLoad("30000"); |
| 23 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
22 | 24 | try { |
23 | 25 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
24 | 26 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -34,7 +36,7 @@ |
35 | 37 | $this->click("link=Level 3"); |
36 | 38 | $this->type("wpTextbox1", "===Heading text==="); |
37 | 39 | $this->click("wpPreview"); |
38 | | - $this->waitForPageToLoad("30000"); |
| 40 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
39 | 41 | try { |
40 | 42 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
41 | 43 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -50,7 +52,7 @@ |
51 | 53 | $this->click("link=Level 4"); |
52 | 54 | $this->type("wpTextbox1", "====Heading text===="); |
53 | 55 | $this->click("wpPreview"); |
54 | | - $this->waitForPageToLoad("30000"); |
| 56 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
55 | 57 | try { |
56 | 58 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
57 | 59 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -66,7 +68,7 @@ |
67 | 69 | $this->click("link=Level 5"); |
68 | 70 | $this->type("wpTextbox1", "=====Heading text====="); |
69 | 71 | $this->click("wpPreview"); |
70 | | - $this->waitForPageToLoad("30000"); |
| 72 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
71 | 73 | try { |
72 | 74 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5")); |
73 | 75 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -83,7 +85,7 @@ |
84 | 86 | $this->click("link=Level 3"); |
85 | 87 | $this->type("wpTextbox1", "==Heading text==\n===Heading text==="); |
86 | 88 | $this->click("wpPreview"); |
87 | | - $this->waitForPageToLoad("30000"); |
| 89 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
88 | 90 | try { |
89 | 91 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
90 | 92 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -107,7 +109,7 @@ |
108 | 110 | $this->click("link=Level 4"); |
109 | 111 | $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text===="); |
110 | 112 | $this->click("wpPreview"); |
111 | | - $this->waitForPageToLoad("30000"); |
| 113 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
112 | 114 | try { |
113 | 115 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
114 | 116 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -138,7 +140,7 @@ |
139 | 141 | $this->click("link=Level 5"); |
140 | 142 | $this->type("wpTextbox1", "==Heading text==\n===Heading text===\n====Heading text====\n=====Heading text====="); |
141 | 143 | $this->click("wpPreview"); |
142 | | - $this->waitForPageToLoad("30000"); |
| 144 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
143 | 145 | try { |
144 | 146 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
145 | 147 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /** |
5 | 7 | * This test case will be handling the general tool bar functions |
6 | 8 | * Date : Apr - 2010 |
— | — | @@ -12,7 +14,7 @@ |
13 | 15 | $this->type("wpTextbox1", "\" \""); |
14 | 16 | $this->type("wpTextbox1", "[[File:Example.jpg]]"); |
15 | 17 | $this->click("wpPreview"); |
16 | | - $this->waitForPageToLoad("30000"); |
| 18 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
17 | 19 | try { |
18 | 20 | $this->assertEquals("", $this->getText("//img[@alt='Example.jpg']")); |
19 | 21 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -48,7 +50,7 @@ |
49 | 51 | $this->type("wpTextbox1", ""); |
50 | 52 | $this->click("link=Picture gallery"); |
51 | 53 | $this->click("wpPreview"); |
52 | | - $this->waitForPageToLoad("30000"); |
| 54 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
53 | 55 | try { |
54 | 56 | $this->assertEquals("", $this->getText("//div[@id='wikiPreview']/table/tbody/tr/td[1]/div/div[1]/div")); |
55 | 57 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_NewPage.php |
— | — | @@ -12,123 +12,86 @@ |
13 | 13 | parent::setUp(); |
14 | 14 | } |
15 | 15 | |
16 | | - // Mark text Bold and verify output |
17 | | - function testTextBold(){ |
| 16 | + //Create a new page temporary |
| 17 | + function createNewPage(){ |
18 | 18 | parent::doOpenLink(); |
19 | 19 | parent::doLogin(); |
20 | | - $this->open("/deployment-en/Main_Page"); |
21 | | - $this->waitForPageToLoad("30000"); |
22 | 20 | parent::doCreateNewPageTemporary(); |
| 21 | + } |
| 22 | + |
| 23 | + // Mark text Bold and verify output |
| 24 | + function testTextBold(){ |
| 25 | + $this->createNewPage(); |
23 | 26 | parent::verifyTextBold(); |
24 | 27 | parent::doLogout(); |
25 | 28 | } |
26 | 29 | |
27 | 30 | // Mark text Italic and verify output |
28 | 31 | function testTextItalic(){ |
29 | | - parent::doOpenLink(); |
30 | | - parent::doLogin(); |
31 | | - $this->open("/deployment-en/Main_Page"); |
32 | | - $this->waitForPageToLoad("30000"); |
33 | | - parent::doCreateNewPageTemporary(); |
| 32 | + $this->createNewPage(); |
34 | 33 | parent::verifyTextItalic(); |
35 | 34 | parent::doLogout(); |
36 | 35 | } |
37 | 36 | |
38 | 37 | // Mark text Italic & Bold and verify output |
39 | 38 | function testTextItalicandBold(){ |
40 | | - parent::doOpenLink(); |
41 | | - parent::doLogin(); |
42 | | - $this->open("/deployment-en/Main_Page"); |
43 | | - $this->waitForPageToLoad("30000"); |
44 | | - parent::doCreateNewPageTemporary(); |
| 39 | + $this->createNewPage(); |
45 | 40 | parent::verifyTextItalicandBold(); |
46 | 41 | parent::doLogout(); |
47 | 42 | } |
48 | 43 | |
49 | 44 | // Use Bullet Item function and verify output |
50 | 45 | function testBulletItem(){ |
51 | | - parent::doOpenLink(); |
52 | | - parent::doLogin(); |
53 | | - $this->open("/deployment-en/Main_Page"); |
54 | | - $this->waitForPageToLoad("30000"); |
55 | | - parent::doCreateNewPageTemporary(); |
| 46 | + $this->createNewPage(); |
56 | 47 | parent::verifyBulletItem(); |
57 | 48 | parent::doLogout(); |
58 | 49 | } |
59 | 50 | |
60 | 51 | // Use Numbered Item function and verify output |
61 | 52 | function testNumberedItem(){ |
62 | | - parent::doOpenLink(); |
63 | | - parent::doLogin(); |
64 | | - $this->open("/deployment-en/Main_Page"); |
65 | | - $this->waitForPageToLoad("30000"); |
66 | | - parent::doCreateNewPageTemporary(); |
| 53 | + $this->createNewPage(); |
67 | 54 | parent::verifyNumberedItem(); |
68 | 55 | parent::doLogout(); |
69 | 56 | } |
70 | 57 | |
71 | 58 | // Mark text as Nowiki and verify output |
72 | 59 | function testNoWiki(){ |
73 | | - parent::doOpenLink(); |
74 | | - parent::doLogin(); |
75 | | - $this->open("/deployment-en/Main_Page"); |
76 | | - $this->waitForPageToLoad("30000"); |
77 | | - parent::doCreateNewPageTemporary(); |
| 60 | + $this->createNewPage(); |
78 | 61 | parent::verifyNoWiki(); |
79 | 62 | parent::doLogout(); |
80 | 63 | } |
81 | 64 | |
82 | 65 | // Create a line break and verify output |
83 | 66 | function testLineBreak(){ |
84 | | - parent::doOpenLink(); |
85 | | - parent::doLogin(); |
86 | | - $this->open("/deployment-en/Main_Page"); |
87 | | - $this->waitForPageToLoad("30000"); |
88 | | - parent::doCreateNewPageTemporary(); |
| 67 | + $this->createNewPage(); |
89 | 68 | parent::verifyLineBreak(); |
90 | 69 | parent::doLogout(); |
91 | 70 | } |
92 | 71 | |
93 | 72 | // Mark text as Big and verify output |
94 | 73 | function testTextBig(){ |
95 | | - parent::doOpenLink(); |
96 | | - parent::doLogin(); |
97 | | - $this->open("/deployment-en/Main_Page"); |
98 | | - $this->waitForPageToLoad("30000"); |
99 | | - parent::doCreateNewPageTemporary(); |
| 74 | + $this->createNewPage(); |
100 | 75 | parent::verifyTextBig(); |
101 | 76 | parent::doLogout(); |
102 | 77 | } |
103 | 78 | |
104 | 79 | // Mark text as Small and verify output |
105 | 80 | function testTextSmall(){ |
106 | | - parent::doOpenLink(); |
107 | | - parent::doLogin(); |
108 | | - $this->open("/deployment-en/Main_Page"); |
109 | | - $this->waitForPageToLoad("30000"); |
110 | | - parent::doCreateNewPageTemporary(); |
| 81 | + $this->createNewPage(); |
111 | 82 | parent::verifyTextSmall(); |
112 | 83 | parent::doLogout(); |
113 | 84 | } |
114 | 85 | |
115 | 86 | // Mark text as Super Script and verify output |
116 | 87 | function testTextSuperscript(){ |
117 | | - parent::doOpenLink(); |
118 | | - parent::doLogin(); |
119 | | - $this->open("/deployment-en/Main_Page"); |
120 | | - $this->waitForPageToLoad("30000"); |
121 | | - parent::doCreateNewPageTemporary(); |
| 88 | + $this->createNewPage(); |
122 | 89 | parent::verifyTextSuperscript(); |
123 | 90 | parent::doLogout(); |
124 | 91 | } |
125 | 92 | |
126 | 93 | // Mark text as Sub Script and verify output |
127 | 94 | function testTextSubscript(){ |
128 | | - parent::doOpenLink(); |
129 | | - parent::doLogin(); |
130 | | - $this->open("/deployment-en/Main_Page"); |
131 | | - $this->waitForPageToLoad("30000"); |
132 | | - parent::doCreateNewPageTemporary(); |
| 95 | + $this->createNewPage(); |
133 | 96 | parent::verifyTextSubscript(); |
134 | 97 | parent::doLogout(); |
135 | 98 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_ExistingPage.php |
— | — | @@ -13,35 +13,31 @@ |
14 | 14 | parent::setUp(); |
15 | 15 | } |
16 | 16 | |
17 | | - // Mark text Bold and verify output |
18 | | - function testTextBold(){ |
| 17 | + //Open a random page |
| 18 | + function openRandomPage(){ |
19 | 19 | parent::doOpenLink(); |
20 | 20 | parent::doLogin(); |
21 | | - $this->open("/deployment-en/Main_Page"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | 21 | parent::doAccessRandomPage(); |
| 22 | + parent::doEditPage(); |
| 23 | + } |
| 24 | + |
| 25 | + // Mark text Bold and verify output |
| 26 | + function testTextBold(){ |
| 27 | + $this->openRandomPage(); |
24 | 28 | parent::verifyTextBold(); |
25 | 29 | parent::doLogout(); |
26 | 30 | } |
27 | 31 | |
28 | 32 | // Mark text Italic and verify output |
29 | 33 | function testTextItalic(){ |
30 | | - parent::doOpenLink(); |
31 | | - parent::doLogin(); |
32 | | - $this->open("/deployment-en/Main_Page"); |
33 | | - $this->waitForPageToLoad("30000"); |
34 | | - parent::doAccessRandomPage(); |
| 34 | + $this->openRandomPage(); |
35 | 35 | parent::verifyTextItalic(); |
36 | 36 | parent::doLogout(); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // Mark text Italic & Bold and verify output |
40 | 40 | function testTextItalicandBold(){ |
41 | | - parent::doOpenLink(); |
42 | | - parent::doLogin(); |
43 | | - $this->open("/deployment-en/Main_Page"); |
44 | | - $this->waitForPageToLoad("30000"); |
45 | | - parent::doAccessRandomPage(); |
| 41 | + $this->openRandomPage(); |
46 | 42 | parent::verifyTextItalicandBold(); |
47 | 43 | parent::doLogout(); |
48 | 44 | } |
— | — | @@ -49,88 +45,56 @@ |
50 | 46 | |
51 | 47 | // Use Bullet Item function and verify output |
52 | 48 | function testBulletItem(){ |
53 | | - parent::doOpenLink(); |
54 | | - parent::doLogin(); |
55 | | - $this->open("/deployment-en/Main_Page"); |
56 | | - $this->waitForPageToLoad("30000"); |
57 | | - parent::doAccessRandomPage(); |
| 49 | + $this->openRandomPage(); |
58 | 50 | parent::verifyBulletItem(); |
59 | 51 | parent::doLogout(); |
60 | 52 | } |
61 | 53 | |
62 | 54 | // Use Numbered Item function and verify output |
63 | 55 | function testNumberedItem(){ |
64 | | - parent::doOpenLink(); |
65 | | - parent::doLogin(); |
66 | | - $this->open("/deployment-en/Main_Page"); |
67 | | - $this->waitForPageToLoad("30000"); |
68 | | - parent::doAccessRandomPage(); |
| 56 | + $this->openRandomPage(); |
69 | 57 | parent::verifyNumberedItem(); |
70 | 58 | parent::doLogout(); |
71 | 59 | } |
72 | 60 | |
73 | 61 | // Mark text as Nowiki and verify output |
74 | 62 | function testNoWiki(){ |
75 | | - parent::doOpenLink(); |
76 | | - parent::doLogin(); |
77 | | - $this->open("/deployment-en/Main_Page"); |
78 | | - $this->waitForPageToLoad("30000"); |
79 | | - parent::doAccessRandomPage(); |
| 63 | + $this->openRandomPage(); |
80 | 64 | parent::verifyNoWiki(); |
81 | 65 | parent::doLogout(); |
82 | 66 | } |
83 | 67 | |
84 | 68 | // Create a line break and verify output |
85 | 69 | function testLineBreak(){ |
86 | | - parent::doOpenLink(); |
87 | | - parent::doLogin(); |
88 | | - $this->open("/deployment-en/Main_Page"); |
89 | | - $this->waitForPageToLoad("30000"); |
90 | | - parent::doAccessRandomPage(); |
| 70 | + $this->openRandomPage(); |
91 | 71 | parent::verifyLineBreak(); |
92 | 72 | parent::doLogout(); |
93 | 73 | } |
94 | 74 | |
95 | 75 | // Mark text as Big and verify output |
96 | 76 | function testTextBig(){ |
97 | | - parent::doOpenLink(); |
98 | | - parent::doLogin(); |
99 | | - $this->open("/deployment-en/Main_Page"); |
100 | | - $this->waitForPageToLoad("30000"); |
101 | | - parent::doAccessRandomPage(); |
| 77 | + $this->openRandomPage(); |
102 | 78 | parent::verifyTextBig(); |
103 | 79 | parent::doLogout(); |
104 | 80 | } |
105 | 81 | |
106 | 82 | // Mark text as Small and verify output |
107 | 83 | function testTextSmall(){ |
108 | | - parent::doOpenLink(); |
109 | | - parent::doLogin(); |
110 | | - $this->open("/deployment-en/Main_Page"); |
111 | | - $this->waitForPageToLoad("30000"); |
112 | | - parent::doAccessRandomPage(); |
| 84 | + $this->openRandomPage(); |
113 | 85 | parent::verifyTextSmall(); |
114 | 86 | parent::doLogout(); |
115 | 87 | } |
116 | 88 | |
117 | 89 | // Mark text as Super Script and verify output |
118 | 90 | function testTextSuperscript(){ |
119 | | - parent::doOpenLink(); |
120 | | - parent::doLogin(); |
121 | | - $this->open("/deployment-en/Main_Page"); |
122 | | - $this->waitForPageToLoad("30000"); |
123 | | - parent::doAccessRandomPage(); |
| 91 | + $this->openRandomPage(); |
124 | 92 | parent::verifyTextSuperscript(); |
125 | 93 | parent::doLogout(); |
126 | 94 | } |
127 | 95 | |
128 | 96 | // Mark text as Sub Script and verify output |
129 | 97 | function testTextSubscript(){ |
130 | | - parent::doOpenLink(); |
131 | | - parent::doLogin(); |
132 | | - $this->open("/deployment-en/Main_Page"); |
133 | | - $this->waitForPageToLoad("30000"); |
134 | | - parent::doAccessRandomPage(); |
| 98 | + $this->openRandomPage(); |
135 | 99 | parent::verifyTextSubscript(); |
136 | 100 | parent::doLogout(); |
137 | 101 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
| 3 | +session_start(); |
3 | 4 | require_once 'WikiCommonFunction_TC.php'; |
| 5 | +require_once 'Config.php'; |
4 | 6 | /** |
5 | 7 | * This test case will be handling the Wiki Tool bar Dialog functions |
6 | 8 | * Date : Apr - 2010 |
— | — | @@ -11,21 +13,21 @@ |
12 | 14 | function verifyInternalLink(){ |
13 | 15 | $this->type("wpTextbox1", ""); |
14 | 16 | $this->click("link=Link"); |
15 | | - $this->type("wikieditor-toolbar-link-int-target", "Daimler-Chrysler"); |
| 17 | + $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]); |
16 | 18 | $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
17 | 19 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
18 | 20 | $this->click("//div[13]/div[11]/button[1]"); |
19 | 21 | $this->click("wpPreview"); |
20 | | - $this->waitForPageToLoad("30000"); |
| 22 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
21 | 23 | try { |
22 | | - $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler")); |
| 24 | + $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=" . $_SESSION["WIKI_INTERNAL_LINK"])); |
23 | 25 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
24 | 26 | array_push($this->verificationErrors, $e->toString()); |
25 | 27 | } |
26 | 28 | $this->click("link=Daimler-Chrysler"); |
27 | | - $this->waitForPageToLoad("30000"); |
| 29 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
28 | 30 | try { |
29 | | - $this->assertTrue($this->isTextPresent("Daimler-Chrysler"), $this->getText("firstHeading")); |
| 31 | + $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading")); |
30 | 32 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
31 | 33 | array_push($this->verificationErrors, $e->toString()); |
32 | 34 | } |
— | — | @@ -36,22 +38,22 @@ |
37 | 39 | $this->type("wpTextbox1", ""); |
38 | 40 | $this->click("link=Link"); |
39 | 41 | $this->type("wpTextbox1", ""); |
40 | | - $this->type("wikieditor-toolbar-link-int-target", "Fashion Island"); |
41 | | - $this->type("wikieditor-toolbar-link-int-text", "Fashion Island Test"); |
| 42 | + $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]); |
| 43 | + $this->type("wikieditor-toolbar-link-int-text", $_SESSION["WIKI_INTERNAL_LINK"] . " Test"); |
42 | 44 | $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
43 | 45 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
44 | 46 | $this->click("//div[13]/div[11]/button[1]"); |
45 | 47 | $this->click("wpPreview"); |
46 | | - $this->waitForPageToLoad("30000"); |
| 48 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
47 | 49 | try { |
48 | | - $this->assertEquals("Fashion Island Test", $this->getText("link=Fashion Island Test")); |
| 50 | + $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"]." Test", $this->getText("link=" .$_SESSION["WIKI_INTERNAL_LINK"] ." Test")); |
49 | 51 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
50 | 52 | array_push($this->verificationErrors, $e->toString()); |
51 | 53 | } |
52 | | - $this->click("link=Fashion Island Test"); |
53 | | - $this->waitForPageToLoad("30000"); |
| 54 | + $this->click("link=" .$_SESSION["WIKI_INTERNAL_LINK"]." Test"); |
| 55 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
54 | 56 | try { |
55 | | - $this->assertTrue($this->isTextPresent("Fashion Island"), $this->getText("firstHeading")); |
| 57 | + $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading")); |
56 | 58 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
57 | 59 | array_push($this->verificationErrors, $e->toString()); |
58 | 60 | } |
— | — | @@ -60,22 +62,22 @@ |
61 | 63 | // Add a internal link with blank display text and verify |
62 | 64 | function verifyInternalLinkWithBlankDisplayText(){ |
63 | 65 | $this->click("link=Link"); |
64 | | - $this->type("wikieditor-toolbar-link-int-target", "Magical Mystery Tour (film)"); |
| 66 | + $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_INTERNAL_LINK"]); |
65 | 67 | $this->type("wikieditor-toolbar-link-int-text", ""); |
66 | 68 | $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists")); |
67 | 69 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int")); |
68 | 70 | $this->click("//div[13]/div[11]/button[1]"); |
69 | 71 | $this->click("wpPreview"); |
70 | | - $this->waitForPageToLoad("30000"); |
| 72 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
71 | 73 | try { |
72 | | - $this->assertEquals("Magical Mystery Tour (film)", $this->getText("link=Magical Mystery Tour (film)")); |
| 74 | + $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_INTERNAL_LINK"])); |
73 | 75 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
74 | 76 | array_push($this->verificationErrors, $e->toString()); |
75 | 77 | } |
76 | | - $this->click("link=Magical Mystery Tour (film)"); |
77 | | - $this->waitForPageToLoad("30000"); |
| 78 | + $this->click("link=".$_SESSION["WIKI_INTERNAL_LINK"]); |
| 79 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
78 | 80 | try { |
79 | | - $this->assertEquals("Magical Mystery Tour (film)", $this->getText("firstHeading")); |
| 81 | + $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("firstHeading")); |
80 | 82 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
81 | 83 | array_push($this->verificationErrors, $e->toString()); |
82 | 84 | } |
— | — | @@ -94,16 +96,16 @@ |
95 | 97 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
96 | 98 | $this->click("//div[13]/div[11]/button[1]"); |
97 | 99 | $this->click("wpPreview"); |
98 | | - $this->waitForPageToLoad("30000"); |
| 100 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
99 | 101 | try { |
100 | | - $this->assertEquals("www.google.com", $this->getText("link=www.google.com")); |
| 102 | + $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK"])); |
101 | 103 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
102 | 104 | array_push($this->verificationErrors, $e->toString()); |
103 | 105 | } |
104 | | - $this->click("link=www.google.com"); |
105 | | - $this->waitForPageToLoad("30000"); |
| 106 | + $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK"]); |
| 107 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
106 | 108 | try { |
107 | | - $this->assertEquals("Google", $this->getTitle()); |
| 109 | + $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
108 | 110 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
109 | 111 | array_push($this->verificationErrors, $e->toString()); |
110 | 112 | } |
— | — | @@ -113,8 +115,8 @@ |
114 | 116 | function verifyExternalLinkWithDisplayText(){ |
115 | 117 | $this->type("wpTextbox1", ""); |
116 | 118 | $this->click("link=Link"); |
117 | | - $this->type("wikieditor-toolbar-link-int-target", "www.google.com"); |
118 | | - $this->type("wikieditor-toolbar-link-int-text", "Google"); |
| 119 | + $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_EXTERNAL_LINK"]); |
| 120 | + $this->type("wikieditor-toolbar-link-int-text", $_SESSION["WIKI_EXTERNAL_LINK_TITLE"]); |
119 | 121 | try { |
120 | 122 | $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
121 | 123 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -123,16 +125,16 @@ |
124 | 126 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
125 | 127 | $this->click("//div[13]/div[11]/button[1]"); |
126 | 128 | $this->click("wpPreview"); |
127 | | - $this->waitForPageToLoad("30000"); |
| 129 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
128 | 130 | try { |
129 | | - $this->assertEquals("Google", $this->getText("link=Google")); |
| 131 | + $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"])); |
130 | 132 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
131 | 133 | array_push($this->verificationErrors, $e->toString()); |
132 | 134 | } |
133 | | - $this->click("link=Google"); |
134 | | - $this->waitForPageToLoad("30000"); |
| 135 | + $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"]); |
| 136 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
135 | 137 | try { |
136 | | - $this->assertEquals("Google", $this->getTitle()); |
| 138 | + $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
137 | 139 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
138 | 140 | array_push($this->verificationErrors, $e->toString()); |
139 | 141 | } |
— | — | @@ -143,7 +145,7 @@ |
144 | 146 | function verifyExternalLinkWithBlankDisplayText(){ |
145 | 147 | $this->type("wpTextbox1", ""); |
146 | 148 | $this->click("link=Link"); |
147 | | - $this->type("wikieditor-toolbar-link-int-target", "www.google.com"); |
| 149 | + $this->type("wikieditor-toolbar-link-int-target", $_SESSION["WIKI_EXTERNAL_LINK"]); |
148 | 150 | $this->type("wikieditor-toolbar-link-int-text", ""); |
149 | 151 | try { |
150 | 152 | $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
— | — | @@ -153,16 +155,16 @@ |
154 | 156 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
155 | 157 | $this->click("//div[13]/div[11]/button[1]"); |
156 | 158 | $this->click("wpPreview"); |
157 | | - $this->waitForPageToLoad("30000"); |
| 159 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
158 | 160 | try { |
159 | 161 | $this->assertEquals("[1]", $this->getText("link=[1]")); |
160 | 162 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
161 | 163 | array_push($this->verificationErrors, $e->toString()); |
162 | 164 | } |
163 | 165 | $this->click("link=[1]"); |
164 | | - $this->waitForPageToLoad("30000"); |
| 166 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
165 | 167 | try { |
166 | | - $this->assertEquals("Google", $this->getTitle()); |
| 168 | + $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
167 | 169 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
168 | 170 | array_push($this->verificationErrors, $e->toString()); |
169 | 171 | } |
— | — | @@ -178,7 +180,7 @@ |
179 | 181 | $this->click("//div[3]/button[1]"); |
180 | 182 | $this->click("wikieditor-toolbar-table-sortable"); |
181 | 183 | $this->click("wpPreview"); |
182 | | - $this->waitForPageToLoad("30000"); |
| 184 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
183 | 185 | try { |
184 | 186 | $this->assertEquals("Header text", $this->getText("//table[@id='sortable_table_id_0']/tbody/tr[1]/th[3]")); |
185 | 187 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -197,7 +199,7 @@ |
198 | 200 | $this->click("//div[3]/button[1]"); |
199 | 201 | $this->click("wikieditor-toolbar-table-wikitable"); |
200 | 202 | $this->click("wpPreview"); |
201 | | - $this->waitForPageToLoad("30000"); |
| 203 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
202 | 204 | try { |
203 | 205 | $this->assertEquals("Header text", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
204 | 206 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -214,7 +216,7 @@ |
215 | 217 | $this->click("//div[3]/button[1]"); |
216 | 218 | $this->click("wikieditor-toolbar-table-dimensions-header"); |
217 | 219 | $this->click("wpPreview"); |
218 | | - $this->waitForPageToLoad("30000"); |
| 220 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
219 | 221 | try { |
220 | 222 | $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.1.3")); |
221 | 223 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -236,7 +238,7 @@ |
237 | 239 | $this->click("wikieditor-toolbar-table-wikitable"); |
238 | 240 | $this->click("wikieditor-toolbar-table-sortable"); |
239 | 241 | $this->click("wpPreview"); |
240 | | - $this->waitForPageToLoad("30000"); |
| 242 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
241 | 243 | try { |
242 | 244 | $this->assertEquals("Example", $this->getTable("sortable_table_id_0.0.0")); |
243 | 245 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -257,7 +259,7 @@ |
258 | 260 | $this->click("wikieditor-toolbar-table-dimensions-header"); |
259 | 261 | $this->click("wikieditor-toolbar-table-wikitable"); |
260 | 262 | $this->click("wpPreview"); |
261 | | - $this->waitForPageToLoad("30000"); |
| 263 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
262 | 264 | try { |
263 | 265 | $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
264 | 266 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
— | — | @@ -270,26 +272,25 @@ |
271 | 273 | parent::doExpandAdvanceSection(); |
272 | 274 | $this->type("wpTextbox1", ""); |
273 | 275 | $this->click("link=Search and replace"); |
274 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
275 | | - $this->type("wikieditor-toolbar-replace-search", "calcey"); |
276 | | - $this->type("wikieditor-toolbar-replace-search", "calcey qa"); |
277 | | - $this->type("wikieditor-toolbar-replace-replace", "test team"); |
| 276 | + $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]); |
| 277 | + $this->type("wikieditor-toolbar-replace-search", $_SESSION["WIKI_SEARCH_TEXT"]); |
| 278 | + $this->type("wikieditor-toolbar-replace-replace", $_SESSION["WIKI_REPLACE_TEXT"]); |
278 | 279 | $this->click("//button[3]"); |
279 | 280 | $this->click("//button[4]"); |
280 | 281 | $this->click("wpPreview"); |
281 | | - $this->waitForPageToLoad("30000"); |
| 282 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
282 | 283 | try { |
283 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]")); |
| 284 | + $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]")); |
284 | 285 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
285 | 286 | array_push($this->verificationErrors, $e->toString()); |
286 | 287 | } |
287 | 288 | try { |
288 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]")); |
| 289 | + $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]")); |
289 | 290 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
290 | 291 | array_push($this->verificationErrors, $e->toString()); |
291 | 292 | } |
292 | 293 | try { |
293 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[3]")); |
| 294 | + $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]")); |
294 | 295 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
295 | 296 | array_push($this->verificationErrors, $e->toString()); |
296 | 297 | } |
— | — | @@ -300,28 +301,28 @@ |
301 | 302 | parent::doExpandAdvanceSection(); |
302 | 303 | $this->type("wpTextbox1", ""); |
303 | 304 | $this->click("link=Search and replace"); |
304 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
| 305 | + $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]); |
305 | 306 | $this->click("link=Search and replace"); |
306 | | - $this->type("wpTextbox1", "calcey qa\n\ncalcey qa\n\ncalcey qa"); |
307 | | - $this->type("wikieditor-toolbar-replace-search", "calcey qa"); |
308 | | - $this->type("wikieditor-toolbar-replace-replace", "test team"); |
| 307 | + $this->type("wpTextbox1", $_SESSION["WIKI_SAMPLE_TEXT"]); |
| 308 | + $this->type("wikieditor-toolbar-replace-search", $_SESSION["WIKI_SEARCH_TEXT"]); |
| 309 | + $this->type("wikieditor-toolbar-replace-replace", $_SESSION["WIKI_REPLACE_TEXT"]); |
309 | 310 | $this->click("//div[13]/div[11]/button[2]"); |
310 | 311 | $this->click("//div[13]/div[11]/button[2]"); |
311 | 312 | $this->click("//button[4]"); |
312 | 313 | $this->click("wpPreview"); |
313 | | - $this->waitForPageToLoad("30000"); |
| 314 | + $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
314 | 315 | try { |
315 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[1]")); |
| 316 | + $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]")); |
316 | 317 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
317 | 318 | array_push($this->verificationErrors, $e->toString()); |
318 | 319 | } |
319 | 320 | try { |
320 | | - $this->assertEquals("test team", $this->getText("//div[@id='wikiPreview']/p[2]")); |
| 321 | + $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]")); |
321 | 322 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
322 | 323 | array_push($this->verificationErrors, $e->toString()); |
323 | 324 | } |
324 | 325 | try { |
325 | | - $this->assertEquals("calcey qa", $this->getText("//div[@id='wikiPreview']/p[3]")); |
| 326 | + $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]")); |
326 | 327 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
327 | 328 | array_push($this->verificationErrors, $e->toString()); |
328 | 329 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_NewPage.php |
— | — | @@ -12,80 +12,59 @@ |
13 | 13 | function setup(){ |
14 | 14 | parent::setUp(); |
15 | 15 | } |
16 | | - |
17 | | - // Add header level 2 and verify Header output |
18 | | - function testHeaderLevel2(){ |
| 16 | + |
| 17 | + //Create a new page temporary |
| 18 | + function createNewPage(){ |
19 | 19 | parent::doOpenLink(); |
20 | 20 | parent::doLogin(); |
21 | | - $this->open("/deployment-en/Main_Page"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | 21 | parent::doCreateNewPageTemporary(); |
| 22 | + } |
| 23 | + |
| 24 | + // Add header level 2 and verify Header output |
| 25 | + function testHeaderLevel2(){ |
| 26 | + $this->createNewPage(); |
24 | 27 | parent::verifyHeaderLevel2(); |
25 | 28 | parent::doLogout(); |
26 | 29 | } |
27 | 30 | |
28 | 31 | // Add header level 3 and verify Header output |
29 | 32 | function testHeaderLevel3(){ |
30 | | - parent::doOpenLink(); |
31 | | - parent::doLogin(); |
32 | | - $this->open("/deployment-en/Main_Page"); |
33 | | - $this->waitForPageToLoad("30000"); |
34 | | - parent::doCreateNewPageTemporary(); |
| 33 | + $this->createNewPage(); |
35 | 34 | parent::verifyHeaderLevel3(); |
36 | 35 | parent::doLogout(); |
37 | 36 | } |
38 | 37 | |
39 | 38 | // Add header level 4 and verify Header output |
40 | 39 | function testHeaderLevel4(){ |
41 | | - parent::doOpenLink(); |
42 | | - parent::doLogin(); |
43 | | - $this->open("/deployment-en/Main_Page"); |
44 | | - $this->waitForPageToLoad("30000"); |
45 | | - parent::doCreateNewPageTemporary(); |
| 40 | + $this->createNewPage(); |
46 | 41 | parent::verifyHeaderLevel4(); |
47 | 42 | parent::doLogout(); |
48 | 43 | } |
49 | 44 | |
50 | 45 | // Add header level 5 and verify Header output |
51 | 46 | function testHeaderLevel5(){ |
52 | | - parent::doOpenLink(); |
53 | | - parent::doLogin(); |
54 | | - $this->open("/deployment-en/Main_Page"); |
55 | | - $this->waitForPageToLoad("30000"); |
56 | | - parent::doCreateNewPageTemporary(); |
| 47 | + $this->createNewPage(); |
57 | 48 | parent::verifyHeaderLevel5(); |
58 | 49 | parent::doLogout(); |
59 | 50 | } |
60 | 51 | |
61 | 52 | // Add header level 2 & 3 and verify Header output |
62 | 53 | function testHeaderLevel2and3(){ |
63 | | - parent::doOpenLink(); |
64 | | - parent::doLogin(); |
65 | | - $this->open("/deployment-en/Main_Page"); |
66 | | - $this->waitForPageToLoad("30000"); |
67 | | - parent::doCreateNewPageTemporary(); |
| 54 | + $this->createNewPage(); |
68 | 55 | parent::verifyHeaderLevel2and3(); |
69 | 56 | parent::doLogout(); |
70 | 57 | } |
71 | 58 | |
72 | 59 | // Add header level 2 , 3 & 4 and verify Header output |
73 | 60 | function testHeaderLevel23and4(){ |
74 | | - parent::doOpenLink(); |
75 | | - parent::doLogin(); |
76 | | - $this->open("/deployment-en/Main_Page"); |
77 | | - $this->waitForPageToLoad("30000"); |
78 | | - parent::doCreateNewPageTemporary(); |
| 61 | + $this->createNewPage(); |
79 | 62 | parent::verifyHeaderLevel23and4(); |
80 | 63 | parent::doLogout(); |
81 | 64 | } |
82 | 65 | |
83 | 66 | // Add header level 2 , 3 , 4 & 5 and verify Header output |
84 | 67 | function testHeaderLevel234and5(){ |
85 | | - parent::doOpenLink(); |
86 | | - parent::doLogin(); |
87 | | - $this->open("/deployment-en/Main_Page"); |
88 | | - $this->waitForPageToLoad("30000"); |
89 | | - parent::doCreateNewPageTemporary(); |
| 68 | + $this->createNewPage(); |
90 | 69 | parent::verifyHeaderLevel234and5(); |
91 | 70 | parent::doLogout(); |
92 | 71 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_ ExistingPage.php |
— | — | @@ -13,79 +13,59 @@ |
14 | 14 | parent::setUp(); |
15 | 15 | } |
16 | 16 | |
17 | | - // Add header level 2 and verify Header output |
18 | | - function testHeaderLevel2(){ |
| 17 | + //Open a random page |
| 18 | + function openRandomPage(){ |
19 | 19 | parent::doOpenLink(); |
20 | 20 | parent::doLogin(); |
21 | | - $this->open("/deployment-en/Main_Page"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | 21 | parent::doAccessRandomPage(); |
| 22 | + parent::doEditPage(); |
| 23 | + } |
| 24 | + |
| 25 | + // Add header level 2 and verify Header output |
| 26 | + function testHeaderLevel2(){ |
| 27 | + $this->openRandomPage(); |
24 | 28 | parent::verifyHeaderLevel2(); |
25 | 29 | parent::doLogout(); |
26 | 30 | } |
27 | 31 | |
28 | 32 | // Add header level 3 and verify Header output |
29 | 33 | function testHeaderLevel3(){ |
30 | | - parent::doOpenLink(); |
31 | | - parent::doLogin(); |
32 | | - $this->open("/deployment-en/Main_Page"); |
33 | | - $this->waitForPageToLoad("30000"); |
34 | | - parent::doAccessRandomPage(); |
| 34 | + $this->openRandomPage();; |
35 | 35 | parent::verifyHeaderLevel3(); |
36 | 36 | parent::doLogout(); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // Add header level 4 and verify Header output |
40 | 40 | function testHeaderLevel4(){ |
41 | | - parent::doOpenLink(); |
42 | | - parent::doLogin(); |
43 | | - $this->open("/deployment-en/Main_Page"); |
44 | | - $this->waitForPageToLoad("30000"); |
45 | | - parent::doAccessRandomPage(); |
| 41 | + $this->openRandomPage(); |
46 | 42 | parent::verifyHeaderLevel4(); |
47 | 43 | parent::doLogout(); |
48 | 44 | } |
49 | 45 | |
50 | 46 | // Add header level 5 and verify Header output |
51 | 47 | function testHeaderLevel5(){ |
52 | | - parent::doOpenLink(); |
53 | | - parent::doLogin(); |
54 | | - $this->open("/deployment-en/Main_Page"); |
55 | | - $this->waitForPageToLoad("30000"); |
56 | | - parent::doAccessRandomPage(); |
| 48 | + $this->openRandomPage(); |
57 | 49 | parent::verifyHeaderLevel5(); |
58 | 50 | parent::doLogout(); |
59 | 51 | } |
60 | 52 | |
61 | 53 | // Add header level 2 & 3 and verify Header output |
62 | 54 | function testHeaderLevel2and3(){ |
63 | | - parent::doOpenLink(); |
64 | | - parent::doLogin(); |
65 | | - $this->open("/deployment-en/Main_Page"); |
66 | | - $this->waitForPageToLoad("30000"); |
67 | | - parent::doAccessRandomPage(); |
| 55 | + $this->openRandomPage(); |
68 | 56 | parent::verifyHeaderLevel2and3(); |
69 | 57 | parent::doLogout(); |
70 | 58 | } |
71 | 59 | |
72 | 60 | // Add header level 2 , 3 & 4 and verify Header output |
73 | 61 | function testHeaderLevel23and4(){ |
74 | | - parent::doOpenLink(); |
75 | | - parent::doLogin(); |
76 | | - $this->open("/deployment-en/Main_Page"); |
77 | | - $this->waitForPageToLoad("30000"); |
78 | | - parent::doAccessRandomPage(); |
| 62 | + $this->openRandomPage();; |
79 | 63 | parent::verifyHeaderLevel23and4(); |
80 | 64 | parent::doLogout(); |
81 | 65 | } |
82 | 66 | |
83 | 67 | // Add header level 2 , 3 , 4 & 5 and verify Header output |
84 | 68 | function testHeaderLevel234and5(){ |
85 | | - parent::doOpenLink(); |
86 | | - parent::doLogin(); |
87 | | - $this->open("/deployment-en/Main_Page"); |
88 | | - $this->waitForPageToLoad("30000"); |
89 | | - parent::doAccessRandomPage(); |
| 69 | + $this->openRandomPage(); |
90 | 70 | parent::verifyHeaderLevel234and5(); |
91 | 71 | parent::doLogout(); |
92 | 72 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_NewPage.php |
— | — | @@ -1,6 +1,5 @@ |
2 | 2 | <?php |
3 | 3 | require_once 'WikiToolBarOther_TC.php'; |
4 | | - |
5 | 4 | /** |
6 | 5 | * Description of WikiNewPageOther |
7 | 6 | * |
— | — | @@ -13,24 +12,24 @@ |
14 | 13 | parent::setUp(); |
15 | 14 | } |
16 | 15 | |
17 | | - // Click on Embedded file function and verify the output |
18 | | - function testEmbeddedFile(){ |
| 16 | + |
| 17 | + //Create a new page temporary |
| 18 | + function createNewPage(){ |
19 | 19 | parent::doOpenLink(); |
20 | 20 | parent::doLogin(); |
21 | | - $this->open("/deployment-en/Main_Page"); |
22 | | - $this->waitForPageToLoad("30000"); |
23 | 21 | parent::doCreateNewPageTemporary(); |
| 22 | + } |
| 23 | + |
| 24 | + // Click on Embedded file function and verify the output |
| 25 | + function testEmbeddedFile(){ |
| 26 | + $this->createNewPage(); |
24 | 27 | parent::verifyEmbeddedFile(); |
25 | 28 | parent::doLogout(); |
26 | 29 | } |
27 | 30 | |
28 | 31 | // Click on Picture Gallery function and verify the output |
29 | 32 | function testPictureGallery(){ |
30 | | - parent::doOpenLink(); |
31 | | - parent::doLogin(); |
32 | | - $this->open("/deployment-en/Main_Page"); |
33 | | - $this->waitForPageToLoad("30000"); |
34 | | - parent::doCreateNewPageTemporary(); |
| 33 | + $this->createNewPage(); |
35 | 34 | parent::verifyPictureGallery(); |
36 | 35 | parent::doLogout(); |
37 | 36 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_ExistingPage.php |
— | — | @@ -1,5 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | require_once 'WikiToolBarOther_TC.php'; |
| 4 | + |
4 | 5 | /** |
5 | 6 | * Description of WikiExistingPageOther |
6 | 7 | * |
— | — | @@ -12,24 +13,24 @@ |
13 | 14 | parent::setUp(); |
14 | 15 | } |
15 | 16 | |
16 | | - // Click on Embedded file function and verify the output |
17 | | - function testEmbeddedFile(){ |
| 17 | + //Open a random page |
| 18 | + function openRandomPage(){ |
18 | 19 | parent::doOpenLink(); |
19 | 20 | parent::doLogin(); |
20 | | - $this->open("/deployment-en/Main_Page"); |
21 | | - $this->waitForPageToLoad("30000"); |
22 | 21 | parent::doAccessRandomPage(); |
| 22 | + parent::doEditPage(); |
| 23 | + } |
| 24 | + |
| 25 | + // Click on Embedded file function and verify the output |
| 26 | + function testEmbeddedFile(){ |
| 27 | + $this->openRandomPage(); |
23 | 28 | parent::verifyEmbeddedFile(); |
24 | 29 | parent::doLogout(); |
25 | 30 | } |
26 | 31 | |
27 | 32 | // Click on Picture Gallery function and verify the output |
28 | 33 | function testPictureGallery(){ |
29 | | - parent::doOpenLink(); |
30 | | - parent::doLogin(); |
31 | | - $this->open("/deployment-en/Main_Page"); |
32 | | - $this->waitForPageToLoad("30000"); |
33 | | - parent::doAccessRandomPage(); |
| 34 | + $this->openRandomPage(); |
34 | 35 | parent::verifyPictureGallery(); |
35 | 36 | parent::doLogout(); |
36 | 37 | } |