Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiDialogs_TC.php |
— | — | @@ -22,6 +22,7 @@ |
23 | 23 | try { |
24 | 24 | $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=" . $_SESSION["WIKI_INTERNAL_LINK"])); |
25 | 25 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 26 | + parent::doCreateScreenShot(__FUNCTION__); |
26 | 27 | array_push($this->verificationErrors, $e->toString()); |
27 | 28 | } |
28 | 29 | $this->click("link=Daimler-Chrysler"); |
— | — | @@ -29,6 +30,7 @@ |
30 | 31 | try { |
31 | 32 | $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading")); |
32 | 33 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 34 | + parent::doCreateScreenShot(__FUNCTION__); |
33 | 35 | array_push($this->verificationErrors, $e->toString()); |
34 | 36 | } |
35 | 37 | } |
— | — | @@ -48,6 +50,7 @@ |
49 | 51 | try { |
50 | 52 | $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"]." Test", $this->getText("link=" .$_SESSION["WIKI_INTERNAL_LINK"] ." Test")); |
51 | 53 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 54 | + parent::doCreateScreenShot(__FUNCTION__); |
52 | 55 | array_push($this->verificationErrors, $e->toString()); |
53 | 56 | } |
54 | 57 | $this->click("link=" .$_SESSION["WIKI_INTERNAL_LINK"]." Test"); |
— | — | @@ -55,6 +58,7 @@ |
56 | 59 | try { |
57 | 60 | $this->assertTrue($this->isTextPresent($_SESSION["WIKI_INTERNAL_LINK"]), $this->getText("firstHeading")); |
58 | 61 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 62 | + parent::doCreateScreenShot(__FUNCTION__); |
59 | 63 | array_push($this->verificationErrors, $e->toString()); |
60 | 64 | } |
61 | 65 | } |
— | — | @@ -72,6 +76,7 @@ |
73 | 77 | try { |
74 | 78 | $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_INTERNAL_LINK"])); |
75 | 79 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 80 | + parent::doCreateScreenShot(__FUNCTION__); |
76 | 81 | array_push($this->verificationErrors, $e->toString()); |
77 | 82 | } |
78 | 83 | $this->click("link=".$_SESSION["WIKI_INTERNAL_LINK"]); |
— | — | @@ -79,6 +84,7 @@ |
80 | 85 | try { |
81 | 86 | $this->assertEquals($_SESSION["WIKI_INTERNAL_LINK"], $this->getText("firstHeading")); |
82 | 87 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 88 | + parent::doCreateScreenShot(__FUNCTION__); |
83 | 89 | array_push($this->verificationErrors, $e->toString()); |
84 | 90 | } |
85 | 91 | } |
— | — | @@ -91,6 +97,7 @@ |
92 | 98 | try { |
93 | 99 | $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
94 | 100 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 101 | + parent::doCreateScreenShot(__FUNCTION__); |
95 | 102 | array_push($this->verificationErrors, $e->toString()); |
96 | 103 | } |
97 | 104 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
— | — | @@ -100,6 +107,7 @@ |
101 | 108 | try { |
102 | 109 | $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK"])); |
103 | 110 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 111 | + parent::doCreateScreenShot(__FUNCTION__); |
104 | 112 | array_push($this->verificationErrors, $e->toString()); |
105 | 113 | } |
106 | 114 | $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK"]); |
— | — | @@ -107,6 +115,7 @@ |
108 | 116 | try { |
109 | 117 | $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
110 | 118 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 119 | + parent::doCreateScreenShot(__FUNCTION__); |
111 | 120 | array_push($this->verificationErrors, $e->toString()); |
112 | 121 | } |
113 | 122 | } |
— | — | @@ -120,6 +129,7 @@ |
121 | 130 | try { |
122 | 131 | $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
123 | 132 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 133 | + parent::doCreateScreenShot(__FUNCTION__); |
124 | 134 | array_push($this->verificationErrors, $e->toString()); |
125 | 135 | } |
126 | 136 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
— | — | @@ -129,6 +139,7 @@ |
130 | 140 | try { |
131 | 141 | $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getText("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"])); |
132 | 142 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 143 | + parent::doCreateScreenShot(__FUNCTION__); |
133 | 144 | array_push($this->verificationErrors, $e->toString()); |
134 | 145 | } |
135 | 146 | $this->click("link=".$_SESSION["WIKI_EXTERNAL_LINK_TITLE"]); |
— | — | @@ -136,6 +147,7 @@ |
137 | 148 | try { |
138 | 149 | $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
139 | 150 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 151 | + parent::doCreateScreenShot(__FUNCTION__); |
140 | 152 | array_push($this->verificationErrors, $e->toString()); |
141 | 153 | } |
142 | 154 | |
— | — | @@ -150,6 +162,7 @@ |
151 | 163 | try { |
152 | 164 | $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external")); |
153 | 165 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 166 | + parent::doCreateScreenShot(__FUNCTION__); |
154 | 167 | array_push($this->verificationErrors, $e->toString()); |
155 | 168 | } |
156 | 169 | $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext")); |
— | — | @@ -159,6 +172,7 @@ |
160 | 173 | try { |
161 | 174 | $this->assertEquals("[1]", $this->getText("link=[1]")); |
162 | 175 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 176 | + parent::doCreateScreenShot(__FUNCTION__); |
163 | 177 | array_push($this->verificationErrors, $e->toString()); |
164 | 178 | } |
165 | 179 | $this->click("link=[1]"); |
— | — | @@ -166,6 +180,7 @@ |
167 | 181 | try { |
168 | 182 | $this->assertEquals($_SESSION["WIKI_EXTERNAL_LINK_TITLE"], $this->getTitle()); |
169 | 183 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 184 | + parent::doCreateScreenShot(__FUNCTION__); |
170 | 185 | array_push($this->verificationErrors, $e->toString()); |
171 | 186 | } |
172 | 187 | } |
— | — | @@ -184,6 +199,7 @@ |
185 | 200 | try { |
186 | 201 | $this->assertEquals("Header text", $this->getText("//table[@id='sortable_table_id_0']/tbody/tr[1]/th[3]")); |
187 | 202 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 203 | + parent::doCreateScreenShot(__FUNCTION__); |
188 | 204 | array_push($this->verificationErrors, $e->toString()); |
189 | 205 | } |
190 | 206 | } |
— | — | @@ -203,6 +219,7 @@ |
204 | 220 | try { |
205 | 221 | $this->assertEquals("Header text", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
206 | 222 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 223 | + parent::doCreateScreenShot(__FUNCTION__); |
207 | 224 | array_push($this->verificationErrors, $e->toString()); |
208 | 225 | } |
209 | 226 | } |
— | — | @@ -220,6 +237,7 @@ |
221 | 238 | try { |
222 | 239 | $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.1.3")); |
223 | 240 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 241 | + parent::doCreateScreenShot(__FUNCTION__); |
224 | 242 | array_push($this->verificationErrors, $e->toString()); |
225 | 243 | } |
226 | 244 | } |
— | — | @@ -242,6 +260,7 @@ |
243 | 261 | try { |
244 | 262 | $this->assertEquals("Example", $this->getTable("sortable_table_id_0.0.0")); |
245 | 263 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 264 | + parent::doCreateScreenShot(__FUNCTION__); |
246 | 265 | array_push($this->verificationErrors, $e->toString()); |
247 | 266 | } |
248 | 267 | } |
— | — | @@ -263,6 +282,7 @@ |
264 | 283 | try { |
265 | 284 | $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.0.0")); |
266 | 285 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 286 | + parent::doCreateScreenShot(__FUNCTION__); |
267 | 287 | array_push($this->verificationErrors, $e->toString()); |
268 | 288 | } |
269 | 289 | } |
— | — | @@ -282,16 +302,19 @@ |
283 | 303 | try { |
284 | 304 | $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]")); |
285 | 305 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 306 | + parent::doCreateScreenShot(__FUNCTION__); |
286 | 307 | array_push($this->verificationErrors, $e->toString()); |
287 | 308 | } |
288 | 309 | try { |
289 | 310 | $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]")); |
290 | 311 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 312 | + parent::doCreateScreenShot(__FUNCTION__); |
291 | 313 | array_push($this->verificationErrors, $e->toString()); |
292 | 314 | } |
293 | 315 | try { |
294 | 316 | $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]")); |
295 | 317 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 318 | + parent::doCreateScreenShot(__FUNCTION__); |
296 | 319 | array_push($this->verificationErrors, $e->toString()); |
297 | 320 | } |
298 | 321 | } |
— | — | @@ -314,16 +337,19 @@ |
315 | 338 | try { |
316 | 339 | $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[1]")); |
317 | 340 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 341 | + parent::doCreateScreenShot(__FUNCTION__); |
318 | 342 | array_push($this->verificationErrors, $e->toString()); |
319 | 343 | } |
320 | 344 | try { |
321 | 345 | $this->assertEquals($_SESSION["WIKI_REPLACE_TEXT"], $this->getText("//div[@id='wikiPreview']/p[2]")); |
322 | 346 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 347 | + parent::doCreateScreenShot(__FUNCTION__); |
323 | 348 | array_push($this->verificationErrors, $e->toString()); |
324 | 349 | } |
325 | 350 | try { |
326 | 351 | $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"], $this->getText("//div[@id='wikiPreview']/p[3]")); |
327 | 352 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 353 | + parent::doCreateScreenShot(__FUNCTION__); |
328 | 354 | array_push($this->verificationErrors, $e->toString()); |
329 | 355 | } |
330 | 356 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/Config.php |
— | — | @@ -18,4 +18,8 @@ |
19 | 19 | $_SESSION["WIKI_SAMPLE_TEXT"] = "calcey qa\n\ncalcey qa\n\ncalcey qa"; // String to type in the editor to use for search and replace |
20 | 20 | $_SESSION["WIKI_SEARCH_TEXT"] = "calcey qa"; // Text use for search |
21 | 21 | $_SESSION["WIKI_REPLACE_TEXT"] = "test team" ; // Text use for replace search text |
| 22 | +$_SESSION["WIKI_CODE_PATH"] = getcwd(); |
| 23 | +$_SESSION["WIKI_SCREENSHOTS_PATH"] = "screenshots"; |
| 24 | +$_SESSION["WIKI_SCREENSHOTS_TYPE"] = "png"; |
| 25 | + |
22 | 26 | ?> |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikSearch_TC.php |
— | — | @@ -1,5 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | session_start(); |
| 4 | +require_once('log4php/Logger.php'); |
| 5 | +Logger::configure('log4php.properties'); |
4 | 6 | require_once 'WikiCommonFunction_TC.php'; |
5 | 7 | require_once 'Config.php'; |
6 | 8 | |
— | — | @@ -9,14 +11,18 @@ |
10 | 12 | * @author : BhagyaG - Calcey |
11 | 13 | */ |
12 | 14 | class WikiSearch_TC extends WikiCommonFunction_TC { |
13 | | - |
| 15 | + private $logger; |
| 16 | + |
14 | 17 | // Set up the testing environment |
15 | 18 | function setup(){ |
16 | 19 | parent::setUp(); |
| 20 | + $this->logger = Logger::getLogger(__CLASS__); |
17 | 21 | } |
18 | 22 | |
| 23 | + |
19 | 24 | // Search for a Wiki Page. Search result should be directed to the page itself |
20 | 25 | function testSearchPage(){ |
| 26 | + $this->logger->info('Test Search Page - Start'); |
21 | 27 | parent::doOpenLink(); |
22 | 28 | parent::doLogin(); |
23 | 29 | $this->click("link=Main page"); |
— | — | @@ -26,13 +32,16 @@ |
27 | 33 | try { |
28 | 34 | $this->assertEquals($_SESSION["WIKI_SEARCH_PAGE"], $this->getText("//*[@id='firstHeading']")); |
29 | 35 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 36 | + parent::doCreateScreenShot(__FUNCTION__); |
30 | 37 | array_push($this->verificationErrors, $e->toString()); |
31 | 38 | } |
32 | 39 | $this->click("link=Main page"); |
33 | 40 | $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
34 | 41 | parent::doLogout(); |
35 | | - } |
| 42 | + $this->logger->info('Test Search Page - End'); |
| 43 | + } |
36 | 44 | |
| 45 | + |
37 | 46 | // Search for a text. Search result should display links which contain the search text |
38 | 47 | function testSearchText(){ |
39 | 48 | parent::doOpenLink(); |
— | — | @@ -45,11 +54,13 @@ |
46 | 55 | try { |
47 | 56 | $this->assertEquals("Search results", $this->getText("firstHeading")); |
48 | 57 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 58 | + parent::doCreateScreenShot(__FUNCTION__); |
49 | 59 | array_push($this->verificationErrors, $e->toString()); |
50 | 60 | } |
51 | 61 | try { |
52 | 62 | $this->assertEquals($_SESSION["WIKI_SEARCH_TEXT"] . " - Search results - Wikipedia, the free encyclopedia", $this->getTitle()); |
53 | 63 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 64 | + parent::doCreateScreenShot(__FUNCTION__); |
54 | 65 | array_push($this->verificationErrors, $e->toString()); |
55 | 66 | } |
56 | 67 | parent::doLogout(); |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiTextFormat_TC.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | try { |
21 | 21 | $this->assertEquals("Bold", $this->getText("//div[@id='wikiPreview']/p/b")); |
22 | 22 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 23 | + parent::doCreateScreenShot(__FUNCTION__); |
23 | 24 | array_push($this->verificationErrors, $e->toString()); |
24 | 25 | } |
25 | 26 | } |
— | — | @@ -30,7 +31,12 @@ |
31 | 32 | $this->type("wpTextbox1", "''Italian'' text"); |
32 | 33 | $this->click("wpPreview"); |
33 | 34 | $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
34 | | - $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i")); |
| 35 | + try { |
| 36 | + $this->assertEquals("Italian", $this->getText("//div[@id='wikiPreview']/p/i")); |
| 37 | + } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 38 | + parent::doCreateScreenShot(__FUNCTION__); |
| 39 | + array_push($this->verificationErrors, $e->toString()); |
| 40 | + } |
35 | 41 | } |
36 | 42 | |
37 | 43 | // Mark text Bold and Italic and verify output |
— | — | @@ -41,7 +47,12 @@ |
42 | 48 | $this->type("wpTextbox1", "Text '''''Italic & Bold'''''"); |
43 | 49 | $this->click("wpPreview"); |
44 | 50 | $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
45 | | - $this->assertEquals("Italic & Bold", $this->getText("//div[@id='wikiPreview']/p/i/b")); |
| 51 | + try { |
| 52 | + $this->assertEquals("Italic & Bold", $this->getText("//div[@id='wikiPreview']/p/i/b")); |
| 53 | + } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 54 | + parent::doCreateScreenShot(__FUNCTION__); |
| 55 | + array_push($this->verificationErrors, $e->toString()); |
| 56 | + } |
46 | 57 | } |
47 | 58 | |
48 | 59 | |
— | — | @@ -58,16 +69,19 @@ |
59 | 70 | try { |
60 | 71 | $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[1]")); |
61 | 72 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 73 | + parent::doCreateScreenShot(__FUNCTION__); |
62 | 74 | array_push($this->verificationErrors, $e->toString()); |
63 | 75 | } |
64 | 76 | try { |
65 | 77 | $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[2]")); |
66 | 78 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 79 | + parent::doCreateScreenShot(__FUNCTION__); |
67 | 80 | array_push($this->verificationErrors, $e->toString()); |
68 | 81 | } |
69 | 82 | try { |
70 | 83 | $this->assertEquals("Bulleted list item", $this->getText("//div[@id='wikiPreview']/ul/li[3]")); |
71 | 84 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 85 | + parent::doCreateScreenShot(__FUNCTION__); |
72 | 86 | array_push($this->verificationErrors, $e->toString()); |
73 | 87 | } |
74 | 88 | } |
— | — | @@ -85,16 +99,19 @@ |
86 | 100 | try { |
87 | 101 | $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[1]")); |
88 | 102 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 103 | + parent::doCreateScreenShot(__FUNCTION__); |
89 | 104 | array_push($this->verificationErrors, $e->toString()); |
90 | 105 | } |
91 | 106 | try { |
92 | 107 | $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[2]")); |
93 | 108 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 109 | + parent::doCreateScreenShot(__FUNCTION__); |
94 | 110 | array_push($this->verificationErrors, $e->toString()); |
95 | 111 | } |
96 | 112 | try { |
97 | 113 | $this->assertEquals("Numbered list item", $this->getText("//div[@id='wikiPreview']/ol/li[3]")); |
98 | 114 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 115 | + parent::doCreateScreenShot(__FUNCTION__); |
99 | 116 | array_push($this->verificationErrors, $e->toString()); |
100 | 117 | } |
101 | 118 | } |
— | — | @@ -109,6 +126,7 @@ |
110 | 127 | try { |
111 | 128 | $this->assertEquals("==Heading text==", $this->getText("//div[@id='wikiPreview']/p")); |
112 | 129 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 130 | + parent::doCreateScreenShot(__FUNCTION__); |
113 | 131 | array_push($this->verificationErrors, $e->toString()); |
114 | 132 | } |
115 | 133 | } |
— | — | @@ -123,6 +141,7 @@ |
124 | 142 | try { |
125 | 143 | $this->assertEquals("this is a test text to check the line\n break.", $this->getText("//div[@id='wikiPreview']/p")); |
126 | 144 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 145 | + parent::doCreateScreenShot(__FUNCTION__); |
127 | 146 | array_push($this->verificationErrors, $e->toString()); |
128 | 147 | } |
129 | 148 | } |
— | — | @@ -138,6 +157,7 @@ |
139 | 158 | try { |
140 | 159 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/big")); |
141 | 160 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 161 | + parent::doCreateScreenShot(__FUNCTION__); |
142 | 162 | array_push($this->verificationErrors, $e->toString()); |
143 | 163 | } |
144 | 164 | } |
— | — | @@ -153,6 +173,7 @@ |
154 | 174 | try { |
155 | 175 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/small")); |
156 | 176 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 177 | + parent::doCreateScreenShot(__FUNCTION__); |
157 | 178 | array_push($this->verificationErrors, $e->toString()); |
158 | 179 | } |
159 | 180 | } |
— | — | @@ -168,6 +189,7 @@ |
169 | 190 | try { |
170 | 191 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sup")); |
171 | 192 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 193 | + parent::doCreateScreenShot(__FUNCTION__); |
172 | 194 | array_push($this->verificationErrors, $e->toString()); |
173 | 195 | } |
174 | 196 | } |
— | — | @@ -183,6 +205,7 @@ |
184 | 206 | try { |
185 | 207 | $this->assertEquals("This", $this->getText("//div[@id='wikiPreview']/p/sub")); |
186 | 208 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 209 | + parent::doCreateScreenShot(__FUNCTION__); |
187 | 210 | array_push($this->verificationErrors, $e->toString()); |
188 | 211 | } |
189 | 212 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiCommonFunction_TC.php |
— | — | @@ -98,5 +98,11 @@ |
99 | 99 | $this->click("//li[@id='ca-edit']/a/span"); |
100 | 100 | $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
101 | 101 | } |
| 102 | + |
| 103 | + //Screenshot create on error |
| 104 | + function doCreateScreenShot($file_name){ |
| 105 | + $this->captureEntirePageScreenshot($_SESSION["WIKI_CODE_PATH"] . "\/". $_SESSION["WIKI_SCREENSHOTS_PATH"] ."\/". $file_name . "_error" . date("Y_m_d") . "." . $_SESSION["WIKI_SCREENSHOTS_TYPE"] , ""); |
| 106 | + } |
| 107 | + |
102 | 108 | } |
103 | 109 | ?> |
\ No newline at end of file |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiWatchUnWatch_TC.php |
— | — | @@ -25,8 +25,13 @@ |
26 | 26 | $this->waitForPageToLoad("30000"); |
27 | 27 | $this->click("link=View and edit watchlist"); |
28 | 28 | $this->waitForPageToLoad("30000"); |
29 | | - |
30 | | - $this->assertTrue($this->isTextPresent($randompage)); |
| 29 | + try { |
| 30 | + $this->assertTrue($this->isTextPresent($randompage)); |
| 31 | + } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 32 | + parent::doCreateScreenShot(__FUNCTION__); |
| 33 | + array_push($this->verificationErrors, $e->toString()); |
| 34 | + } |
| 35 | + |
31 | 36 | parent::doLogout(); |
32 | 37 | } |
33 | 38 | |
— | — | @@ -55,6 +60,7 @@ |
56 | 61 | try { |
57 | 62 | $this->assertFalse($this->isTextPresent($randompage)); |
58 | 63 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 64 | + parent::doCreateScreenShot(__FUNCTION__); |
59 | 65 | array_push($this->verificationErrors, $e->toString()); |
60 | 66 | } |
61 | 67 | parent::doLogout(); |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiNTOC_TC.php |
— | — | @@ -23,6 +23,7 @@ |
24 | 24 | try { |
25 | 25 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
26 | 26 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 27 | + parent::doCreateScreenShot(__FUNCTION__); |
27 | 28 | array_push($this->verificationErrors, $e->toString()); |
28 | 29 | } |
29 | 30 | } |
— | — | @@ -40,6 +41,7 @@ |
41 | 42 | try { |
42 | 43 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
43 | 44 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 45 | + parent::doCreateScreenShot(__FUNCTION__); |
44 | 46 | array_push($this->verificationErrors, $e->toString()); |
45 | 47 | } |
46 | 48 | } |
— | — | @@ -56,6 +58,7 @@ |
57 | 59 | try { |
58 | 60 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
59 | 61 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 62 | + parent::doCreateScreenShot(__FUNCTION__); |
60 | 63 | array_push($this->verificationErrors, $e->toString()); |
61 | 64 | } |
62 | 65 | } |
— | — | @@ -72,6 +75,7 @@ |
73 | 76 | try { |
74 | 77 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5")); |
75 | 78 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 79 | + parent::doCreateScreenShot(__FUNCTION__); |
76 | 80 | array_push($this->verificationErrors, $e->toString()); |
77 | 81 | } |
78 | 82 | } |
— | — | @@ -94,6 +98,7 @@ |
95 | 99 | try { |
96 | 100 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
97 | 101 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 102 | + parent::doCreateScreenShot(__FUNCTION__); |
98 | 103 | array_push($this->verificationErrors, $e->toString()); |
99 | 104 | } |
100 | 105 | } |
— | — | @@ -113,16 +118,19 @@ |
114 | 119 | try { |
115 | 120 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
116 | 121 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 122 | + parent::doCreateScreenShot(__FUNCTION__); |
117 | 123 | array_push($this->verificationErrors, $e->toString()); |
118 | 124 | } |
119 | 125 | try { |
120 | 126 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
121 | 127 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 128 | + parent::doCreateScreenShot(__FUNCTION__); |
122 | 129 | array_push($this->verificationErrors, $e->toString()); |
123 | 130 | } |
124 | 131 | try { |
125 | 132 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
126 | 133 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 134 | + parent::doCreateScreenShot(__FUNCTION__); |
127 | 135 | array_push($this->verificationErrors, $e->toString()); |
128 | 136 | } |
129 | 137 | } |
— | — | @@ -144,21 +152,25 @@ |
145 | 153 | try { |
146 | 154 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h2")); |
147 | 155 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 156 | + parent::doCreateScreenShot(__FUNCTION__); |
148 | 157 | array_push($this->verificationErrors, $e->toString()); |
149 | 158 | } |
150 | 159 | try { |
151 | 160 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h3")); |
152 | 161 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 162 | + parent::doCreateScreenShot(__FUNCTION__); |
153 | 163 | array_push($this->verificationErrors, $e->toString()); |
154 | 164 | } |
155 | 165 | try { |
156 | 166 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h4")); |
157 | 167 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 168 | + parent::doCreateScreenShot(__FUNCTION__); |
158 | 169 | array_push($this->verificationErrors, $e->toString()); |
159 | 170 | } |
160 | 171 | try { |
161 | 172 | $this->assertEquals("Heading text", $this->getText("//*[@id='wikiPreview']/h5")); |
162 | 173 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 174 | + parent::doCreateScreenShot(__FUNCTION__); |
163 | 175 | array_push($this->verificationErrors, $e->toString()); |
164 | 176 | } |
165 | 177 | } |
Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarOther_TC.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | try { |
20 | 20 | $this->assertEquals("", $this->getText("//img[@alt='Example.jpg']")); |
21 | 21 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
| 22 | + parent::doCreateScreenShot(__FUNCTION__); |
22 | 23 | array_push($this->verificationErrors, $e->toString()); |
23 | 24 | } |
24 | 25 | } |
— | — | @@ -52,6 +53,7 @@ |
53 | 54 | $this->click("wpPreview"); |
54 | 55 | $this->waitForPageToLoad($_SESSION["WIKI_TEST_WAIT_TIME"]); |
55 | 56 | try { |
| 57 | + parent::doCreateScreenShot(__FUNCTION__); |
56 | 58 | $this->assertEquals("", $this->getText("//div[@id='wikiPreview']/table/tbody/tr/td[1]/div/div[1]/div")); |
57 | 59 | } catch (PHPUnit_Framework_AssertionFailedError $e) { |
58 | 60 | array_push($this->verificationErrors, $e->toString()); |