http://www.mediawiki.org/wiki/Special:Code/MediaWiki/65270
Revision: 65270
Author: bhagya
Date: 2010-04-19 11:41:59 +0000 (Mon, 19 Apr 2010)
Log Message:
-----------
Rename the file name and adding detailed scenarios
Added Paths:
-----------
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOC.php
Added:
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOC.php
===================================================================
---
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOC.php
(rev 0)
+++
trunk/testing/selenium/UsabilityInitiative/WikiAutomationTC/testCases/WikiToolBarNTOC.php
2010-04-19 11:41:59 UTC (rev 65270)
@@ -0,0 +1,245 @@
+<?php
+require_once 'WikiCommonTC.php';
+/**
+ * This test case will be handling the NTOC related functions.
+ * Adding different header levels via tool bar and verify the output
+ * Date : Apr - 2010
+ * @author : BhagyaG - Calcey
+ */
+class WikiToolBarNTOC extends WikiCommonTC {
+
+ // Set up the testing environment
+ function setup(){
+ parent::setUp();
+ }
+
+
+ // Add header level 2 and verify Header output
+ function testHeaderLevel2(){
+
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Heading");
+ $this->click("link=Level 2");
+ $this->type("wpTextbox1", "==Heading text==");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h2"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+
+ }
+
+ // Add header level 3 and verify Header output
+ function testHeaderLevel3(){
+
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Heading");
+ $this->click("link=Level 3");
+ $this->type("wpTextbox1", "===Heading text===");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h3"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+
+ }
+
+ // Add header level 4 and verify Header output
+ function testHeaderLevel4(){
+
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Heading");
+ $this->click("link=Level 4");
+ $this->type("wpTextbox1", "====Heading text====");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h4"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+
+ }
+
+ // Add header level 5 and verify Header output
+ function testHeaderLevel5(){
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Heading");
+ $this->click("link=Level 5");
+ $this->type("wpTextbox1", "=====Heading text=====");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h5"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+
+ }
+
+ // Add header level 2 & 3 and verify Header output
+ function testHeaderLevel2and3(){
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Level 2");
+ $this->click("link=Heading");
+ $this->click("link=Level 3");
+ $this->type("wpTextbox1", "==Heading text==\n===Heading text===");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h2"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h3"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+ }
+
+ // Add header level 2 , 3 & 4 and verify Header output
+ function testHeaderLevel23and4(){
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Level 2");
+ $this->click("link=Heading");
+ $this->click("link=Level 3");
+ $this->click("link=Heading");
+ $this->click("link=Level 4");
+ $this->type("wpTextbox1", "==Heading text==\n===Heading
text===\n====Heading text====");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h2"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h3"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h4"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+ }
+
+ // Add header level 2 , 3 , 4 & 5 and verify Header output
+ function testHeaderLevel234and5(){
+ parent::doOpenLink();
+ parent::doLogin();
+ $this->open("/deployment-en/Main_Page");
+ $this->waitForPageToLoad("30000");
+ $this->click("link=Random article");
+ $this->waitForPageToLoad("30000");
+ $this->click("//l...@id='ca-edit']/a/span");
+ $this->waitForPageToLoad("30000");
+ parent::doExpandAdvanceSection();
+ $this->click("link=Heading");
+ $this->click("link=Level 2");
+ $this->click("link=Heading");
+ $this->click("link=Level 3");
+ $this->click("link=Heading");
+ $this->click("link=Level 4");
+ $this->click("link=Heading");
+ $this->click("link=Level 5");
+ $this->type("wpTextbox1", "==Heading text==\n===Heading
text===\n====Heading text====\n=====Heading text=====");
+ $this->click("wpPreview");
+ $this->waitForPageToLoad("30000");
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h2"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h3"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h4"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+ try {
+ $this->assertEquals("Heading text",
$this->getText("//*...@id='wikiPreview']/h5"));
+ } catch (PHPUnit_Framework_AssertionFailedError $e) {
+ array_push($this->verificationErrors, $e->toString());
+ }
+
+ parent::doLogout();
+ }
+}
+?>
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs