r65269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65268‎ | r65269 | r65270 >
Date:11:41, 19 April 2010
Author:bhagya
Status:deferred
Tags:
Comment:
Detailed scenarios of dialogs
Modified paths:
  • /trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php (modified) (history)

Diff [purge]

Index: trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarDialogsTC.php
@@ -11,6 +11,7 @@
1212 parent::setUp();
1313 }
1414
 15+
1516 // Add a internal link and verify
1617 function testInternalLink(){
1718
@@ -28,12 +29,92 @@
2930 $this->click("//div[13]/div[11]/button[1]");
3031 $this->click("wpPreview");
3132 $this->waitForPageToLoad("30000");
32 - $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler"));
 33+ try {
 34+ $this->assertEquals("Daimler-Chrysler", $this->getText("link=Daimler-Chrysler"));
 35+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 36+ array_push($this->verificationErrors, $e->toString());
 37+ }
 38+ $this->click("link=Daimler-Chrysler");
 39+ $this->waitForPageToLoad("30000");
 40+ try {
 41+ $this->assertTrue($this->isTextPresent("Daimler-Chrysler"), $this->getText("firstHeading"));
 42+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 43+ array_push($this->verificationErrors, $e->toString());
 44+ }
 45+ parent::doLogout();
3346
 47+ }
 48+
 49+ // Add a internal link with different display text and verify
 50+ function testInternalLinkWithDisplayText(){
 51+
 52+ parent::doOpenLink();
 53+ parent::doLogin();
 54+ $this->click("link=Random article");
 55+ $this->waitForPageToLoad("30000");
 56+ $this->click("//li[@id='ca-edit']/a/span");
 57+ $this->waitForPageToLoad("30000");
 58+ $this->type("wpTextbox1", "");
 59+ $this->click("link=Link");
 60+ $this->type("wpTextbox1", "");
 61+ $this->type("wikieditor-toolbar-link-int-target", "Fashion Island");
 62+ $this->type("wikieditor-toolbar-link-int-text", "Fashion Island Test");
 63+ $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
 64+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
 65+ $this->click("//div[13]/div[11]/button[1]");
 66+ $this->click("wpPreview");
 67+ $this->waitForPageToLoad("30000");
 68+ try {
 69+ $this->assertEquals("Fashion Island Test", $this->getText("link=Fashion Island Test"));
 70+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 71+ array_push($this->verificationErrors, $e->toString());
 72+ }
 73+ $this->click("link=Fashion Island Test");
 74+ $this->waitForPageToLoad("30000");
 75+ try {
 76+ $this->assertTrue($this->isTextPresent("Fashion Island"), $this->getText("firstHeading"));
 77+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 78+ array_push($this->verificationErrors, $e->toString());
 79+ }
 80+
3481 parent::doLogout();
3582
3683 }
3784
 85+ // Add a internal link with blank display text and verify
 86+ function testInternalLinkWithBlankDisplayText(){
 87+
 88+ parent::doOpenLink();
 89+ parent::doLogin();
 90+ $this->click("link=Random article");
 91+ $this->waitForPageToLoad("30000");
 92+ $this->click("//li[@id='ca-edit']/a/span");
 93+ $this->waitForPageToLoad("30000");
 94+ $this->click("link=Link");
 95+ $this->type("wikieditor-toolbar-link-int-target", "Magical Mystery Tour (film)");
 96+ $this->type("wikieditor-toolbar-link-int-text", "");
 97+ $this->assertTrue($this->isElementPresent("wikieditor-toolbar-link-int-target-status-exists"));
 98+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-int"));
 99+ $this->click("//div[13]/div[11]/button[1]");
 100+ $this->click("wpPreview");
 101+ $this->waitForPageToLoad("30000");
 102+ try {
 103+ $this->assertEquals("Magical Mystery Tour (film)", $this->getText("link=Magical Mystery Tour (film)"));
 104+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 105+ array_push($this->verificationErrors, $e->toString());
 106+ }
 107+ $this->click("link=Magical Mystery Tour (film)");
 108+ $this->waitForPageToLoad("30000");
 109+ try {
 110+ $this->assertEquals("Magical Mystery Tour (film)", $this->getText("firstHeading"));
 111+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 112+ array_push($this->verificationErrors, $e->toString());
 113+ }
 114+
 115+ parent::doLogout();
 116+
 117+ }
 118+
38119 // Add external link and verify
39120 function testExternalLink(){
40121
@@ -55,15 +136,101 @@
56137 $this->click("//div[13]/div[11]/button[1]");
57138 $this->click("wpPreview");
58139 $this->waitForPageToLoad("30000");
59 - $this->assertEquals("www.google.com", $this->getText("link=www.google.com"));
 140+ try {
 141+ $this->assertEquals("www.google.com", $this->getText("link=www.google.com"));
 142+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 143+ array_push($this->verificationErrors, $e->toString());
 144+ }
 145+ $this->click("link=www.google.com");
 146+ $this->waitForPageToLoad("30000");
 147+ try {
 148+ $this->assertEquals("Google", $this->getTitle());
 149+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 150+ array_push($this->verificationErrors, $e->toString());
 151+ }
 152+ parent::doLogout();
 153+ }
60154
 155+ // Add external link with different display text and verify
 156+ function testExternalLinkWithDisplayText(){
 157+
 158+ parent::doOpenLink();
 159+ parent::doLogin();
 160+ $this->click("link=Random article");
 161+ $this->waitForPageToLoad("30000");
 162+ $this->click("//li[@id='ca-edit']/a/span");
 163+ $this->waitForPageToLoad("30000");
 164+ $this->type("wpTextbox1", "");
 165+ $this->click("link=Link");
 166+ $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
 167+ $this->type("wikieditor-toolbar-link-int-text", "Google");
 168+ try {
 169+ $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 170+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 171+ array_push($this->verificationErrors, $e->toString());
 172+ }
 173+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
 174+ $this->click("//div[13]/div[11]/button[1]");
 175+ $this->click("wpPreview");
 176+ $this->waitForPageToLoad("30000");
 177+ try {
 178+ $this->assertEquals("Google", $this->getText("link=Google"));
 179+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 180+ array_push($this->verificationErrors, $e->toString());
 181+ }
 182+ $this->click("link=Google");
 183+ $this->waitForPageToLoad("30000");
 184+ try {
 185+ $this->assertEquals("Google", $this->getTitle());
 186+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 187+ array_push($this->verificationErrors, $e->toString());
 188+ }
 189+
61190 parent::doLogout();
62191
63192 }
64193
 194+ // Add external link with Blank display text and verify
 195+ function testExternalLinkWithBlankDisplayText(){
 196+
 197+ parent::doOpenLink();
 198+ parent::doLogin();
 199+ $this->click("link=Random article");
 200+ $this->waitForPageToLoad("30000");
 201+ $this->click("//li[@id='ca-edit']/a/span");
 202+ $this->waitForPageToLoad("30000");
 203+ $this->type("wpTextbox1", "");
 204+ $this->click("link=Link");
 205+ $this->type("wikieditor-toolbar-link-int-target", "www.google.com");
 206+ $this->type("wikieditor-toolbar-link-int-text", "");
 207+ try {
 208+ $this->assertEquals("External link", $this->getText("wikieditor-toolbar-link-int-target-status-external"));
 209+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 210+ array_push($this->verificationErrors, $e->toString());
 211+ }
 212+ $this->assertEquals("on", $this->getValue("wikieditor-toolbar-link-type-ext"));
 213+ $this->click("//div[13]/div[11]/button[1]");
 214+ $this->click("wpPreview");
 215+ $this->waitForPageToLoad("30000");
 216+ try {
 217+ $this->assertEquals("[1]", $this->getText("link=[1]"));
 218+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 219+ array_push($this->verificationErrors, $e->toString());
 220+ }
 221+ $this->click("link=[1]");
 222+ $this->waitForPageToLoad("30000");
 223+ try {
 224+ $this->assertEquals("Google", $this->getTitle());
 225+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 226+ array_push($this->verificationErrors, $e->toString());
 227+ }
 228+
 229+ parent::doLogout();
 230+
 231+ }
 232+
65233 // Add a table and verify
66234 function testCreateTable(){
67 -
68235 parent::doOpenLink();
69236 parent::doLogin();
70237 $this->open("/deployment-en/Main_Page");
@@ -85,11 +252,124 @@
86253 } catch (PHPUnit_Framework_AssertionFailedError $e) {
87254 array_push($this->verificationErrors, $e->toString());
88255 }
 256+ parent::doLogout();
 257+ }
89258
 259+ // Add a table and verify only with head row
 260+ function testCreateTableWithHeadRow(){
 261+ parent::doOpenLink();
 262+ parent::doLogin();
 263+ $this->open("/deployment-en/Main_Page");
 264+ $this->click("link=Random article");
 265+ $this->waitForPageToLoad("30000");
 266+ $this->click("//li[@id='ca-edit']/a/span");
 267+ $this->waitForPageToLoad("30000");
 268+ parent::doExpandAdvanceSection();
 269+ $this->type("wpTextbox1", "");
 270+ $this->click("link=Table");
 271+ $this->click("wikieditor-toolbar-table-wikitable");
 272+ $this->type("wikieditor-toolbar-table-dimensions-rows", "4");
 273+ $this->type("wikieditor-toolbar-table-dimensions-columns", "4");
 274+ $this->click("//div[3]/button[1]");
 275+ $this->click("wikieditor-toolbar-table-wikitable");
 276+ $this->click("wpPreview");
 277+ $this->waitForPageToLoad("30000");
 278+ try {
 279+ $this->assertEquals("Header text", $this->getTable("//div[@id='wikiPreview']/table.0.0"));
 280+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 281+ array_push($this->verificationErrors, $e->toString());
 282+ }
 283+
90284 parent::doLogout();
 285+ }
91286
 287+ // Add a table and verify only with borders
 288+ function testCreateTableWithBorders(){
 289+ parent::doOpenLink();
 290+ parent::doLogin();
 291+ $this->open("/deployment-en/Main_Page");
 292+ $this->click("link=Random article");
 293+ $this->waitForPageToLoad("30000");
 294+ $this->click("//li[@id='ca-edit']/a/span");
 295+ $this->waitForPageToLoad("30000");
 296+ parent::doExpandAdvanceSection();
 297+ $this->type("wpTextbox1", "");
 298+ $this->click("link=Table");
 299+ $this->click("wikieditor-toolbar-table-dimensions-header");
 300+ $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
 301+ $this->click("//div[3]/button[1]");
 302+ $this->click("wikieditor-toolbar-table-dimensions-header");
 303+ $this->click("wpPreview");
 304+ $this->waitForPageToLoad("30000");
 305+ try {
 306+ $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.1.3"));
 307+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 308+ array_push($this->verificationErrors, $e->toString());
 309+ }
 310+
 311+ parent::doLogout();
92312 }
93313
 314+ // Add a table and verify only with sort row
 315+ function testCreateTableWithSortRow(){
 316+ parent::doOpenLink();
 317+ parent::doLogin();
 318+ $this->open("/deployment-en/Main_Page");
 319+ $this->click("link=Random article");
 320+ $this->waitForPageToLoad("30000");
 321+ $this->click("//li[@id='ca-edit']/a/span");
 322+ $this->waitForPageToLoad("30000");
 323+ parent::doExpandAdvanceSection();
 324+ $this->type("wpTextbox1", "");
 325+ $this->click("link=Table");
 326+ $this->click("wikieditor-toolbar-table-dimensions-header");
 327+ $this->click("wikieditor-toolbar-table-wikitable");
 328+ $this->click("wikieditor-toolbar-table-sortable");
 329+ $this->type("wikieditor-toolbar-table-dimensions-rows", "2");
 330+ $this->type("wikieditor-toolbar-table-dimensions-columns", "5");
 331+ $this->click("//div[3]/button[1]");
 332+ $this->click("wikieditor-toolbar-table-dimensions-header");
 333+ $this->click("wikieditor-toolbar-table-wikitable");
 334+ $this->click("wikieditor-toolbar-table-sortable");
 335+ $this->click("wpPreview");
 336+ $this->waitForPageToLoad("30000");
 337+ try {
 338+ $this->assertEquals("Example", $this->getTable("sortable_table_id_0.0.0"));
 339+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 340+ array_push($this->verificationErrors, $e->toString());
 341+ }
 342+ parent::doLogout();
 343+ }
 344+
 345+ // Add a table without headers,borders and sort rows
 346+ function testCreateTableWithNoSpecialEffects(){
 347+ parent::doOpenLink();
 348+ parent::doLogin();
 349+ $this->open("/deployment-en/Main_Page");
 350+ $this->click("link=Random article");
 351+ $this->waitForPageToLoad("30000");
 352+ $this->click("//li[@id='ca-edit']/a/span");
 353+ $this->waitForPageToLoad("30000");
 354+ parent::doExpandAdvanceSection();
 355+ $this->type("wpTextbox1", "");
 356+ $this->click("link=Table");
 357+ $this->click("wikieditor-toolbar-table-wikitable");
 358+ $this->click("wikieditor-toolbar-table-dimensions-header");
 359+ $this->type("wikieditor-toolbar-table-dimensions-rows", "6");
 360+ $this->type("wikieditor-toolbar-table-dimensions-columns", "2");
 361+ $this->click("//div[3]/button[1]");
 362+ $this->click("wikieditor-toolbar-table-dimensions-header");
 363+ $this->click("wikieditor-toolbar-table-wikitable");
 364+ $this->click("wpPreview");
 365+ $this->waitForPageToLoad("30000");
 366+ try {
 367+ $this->assertEquals("Example", $this->getTable("//div[@id='wikiPreview']/table.0.0"));
 368+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
 369+ array_push($this->verificationErrors, $e->toString());
 370+ }
 371+ parent::doLogout();
 372+ }
 373+
94374 // Verify the replace all function on Search and Replace
95375 function testTextSearchReplaceAll(){
96376
@@ -188,6 +468,6 @@
189469
190470
191471 parent::doLogout();
192 - }**/
 472+ }*/
193473 }
194474 ?>

Status & tagging log