diff options
| author | xue <> | 2006-02-13 22:12:50 +0000 | 
|---|---|---|
| committer | xue <> | 2006-02-13 22:12:50 +0000 | 
| commit | 3e60cbad4b79301ae086ecacbdc63af333532a43 (patch) | |
| tree | aaa72887f9e5eaf94305c8a08a07f7a735c378ac | |
| parent | 98e796c1a4f0bda1abc4df7e08df9ddb4f6e50af (diff) | |
Added repeater functional tests.
15 files changed, 125 insertions, 21 deletions
diff --git a/.gitattributes b/.gitattributes index e03ffbd5..ea2ff882 100644 --- a/.gitattributes +++ b/.gitattributes @@ -795,6 +795,9 @@ tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php -text  tests/FunctionalTests/quickstart/Controls/PanelTestCase.php -text  tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php -text  tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php -text +tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php -text +tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php -text +tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php -text  tests/FunctionalTests/quickstart/Controls/TableTestCase.php -text  tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php -text  tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php -text diff --git a/framework/Web/UI/WebControls/TBulletedList.php b/framework/Web/UI/WebControls/TBulletedList.php index 8857ecb1..233ace4e 100644 --- a/framework/Web/UI/WebControls/TBulletedList.php +++ b/framework/Web/UI/WebControls/TBulletedList.php @@ -254,10 +254,7 @@ class TBulletedList extends TListControl implements IPostBackEventHandler  		foreach($this->getItems() as $index=>$item)
  		{
  			if($item->getHasAttributes())
 -			{
 -				foreach($item->getAttributes() as $name=>$value)
 -					$writer->addAttribute($name,$value);
 -			}
 +				$writer->addAttributes($item->getAttributes());
  			$writer->renderBeginTag('li');
  			$this->renderBulletText($writer,$item,$index);
  			$writer->renderEndTag();
 @@ -338,6 +335,7 @@ class TBulletedList extends TListControl implements IPostBackEventHandler  		$options['EventTarget'] = $this->getUniqueID();
  		$options['EventParameter'] = $this->_currentRenderItemIndex;
  		$options['ID'] = $this->getClientID().$this->_currentRenderItemIndex;
 +		$options['StopEvent'] = true;
  		return $options;
  	}
 diff --git a/tests/FunctionalTests/protected/pages/Validation/CheckBox.php b/tests/FunctionalTests/protected/pages/Validation/CheckBox.php index 8154210c..2c83ad16 100644 --- a/tests/FunctionalTests/protected/pages/Validation/CheckBox.php +++ b/tests/FunctionalTests/protected/pages/Validation/CheckBox.php @@ -23,12 +23,12 @@ class CheckBoxTestCase2 extends SeleniumTestCase  		//test checkbox 2 should fire the validator
  		$this->assertNotVisible("ctl0_Content_validator1");
  		$this->click("ctl0_Content_checkbox2");
 -		$this->pause(100);
 +//		$this->pause(100);
  		$this->assertVisible("ctl0_Content_validator1");
  		//write some text, and see what it
  		$this->type('ctl0_Content_TextBox', "hello");
 -		$this->pause(100);
 +//		$this->pause(100);
  		$this->assertNotVisible("ctl0_Content_validator1");
  		$this->clickAndWait("ctl0_Content_checkbox2"); //submit
  		$this->assertNotVisible("ctl0_Content_validator1");
 diff --git a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php index 032f5ff1..4a5e66e4 100644 --- a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php @@ -24,7 +24,7 @@ class ButtonTestCase extends SeleniumTestCase  		// a button causing validation
  		$this->verifyNotVisible('ctl0_body_ctl3');
  		$this->click("//input[@type='submit' and @value='submit']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl3');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("//input[@type='submit' and @value='submit']", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php index 783e2ccc..a845402d 100644 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php @@ -43,7 +43,7 @@ class CheckBoxListTestCase extends SeleniumTestCase  		// CheckBox list causing validation
  		$this->verifyNotVisible('ctl0_body_ctl8');
  		$this->click("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl8');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php index a24ce937..a248dd79 100644 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php @@ -24,10 +24,10 @@ class CheckBoxTestCase extends SeleniumTestCase  		// a checkbox causing validation on a textbox
  		$this->verifyNotVisible('ctl0_body_ctl3');
  		$this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl3');
  		$this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl3');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 @@ -36,7 +36,7 @@ class CheckBoxTestCase extends SeleniumTestCase  		// a checkbox validated by a required field validator
  		$this->verifyNotVisible('ctl0_body_ctl6');
  		$this->click("//input[@type='submit' and @value='Submit']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl6');
  		$this->click("//input[@name='ctl0\$body\$CheckBox' and @value='ctl0\$body\$CheckBox']", "");
  		$this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
 @@ -45,7 +45,7 @@ class CheckBoxTestCase extends SeleniumTestCase  		// a checkbox validated by a required field validator using AutoPostBack
  		$this->verifyNotVisible('ctl0_body_ctl7');
  		$this->click("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl7');
  		$this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", "");
  		$this->verifyNotVisible('ctl0_body_ctl7');
 diff --git a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php index cc0bda53..c01d2173 100644 --- a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php @@ -19,7 +19,7 @@ class ImageButtonTestCase extends SeleniumTestCase  		// a button causing validation
  		$this->verifyNotVisible('ctl0_body_ctl2');
  		$this->click("id=ctl0_body_ctl3", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl2');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("id=ctl0_body_ctl3", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php index 49c3c61a..806c151e 100644 --- a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php @@ -23,7 +23,7 @@ class LinkButtonTestCase extends SeleniumTestCase  		// a button causing validation
  		$this->verifyNotVisible('ctl0_body_ctl4');
  		$this->click("link=submit", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl4');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("link=submit", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php index 6f86719a..9862d1d1 100644 --- a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php @@ -73,7 +73,7 @@ class ListBoxTestCase extends SeleniumTestCase  		// List box causing validation
  		$this->verifyNotVisible('ctl0_body_ctl12');
  		$this->select("ctl0\$body\$VListBox2", "label=Agree");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl12');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->selectAndWait("ctl0\$body\$VListBox2", "label=Disagree");
 diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php index b6242d05..04ac376c 100644 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php @@ -43,7 +43,7 @@ class RadioButtonListTestCase extends SeleniumTestCase  		// RadioButton list causing validation
  		$this->verifyNotVisible('ctl0_body_ctl8');
  		$this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl8');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php index d6d5f2e3..57a7145c 100644 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php @@ -24,10 +24,10 @@ class RadioButtonTestCase extends SeleniumTestCase  		// a radiobutton causing validation on a textbox
  		$this->verifyNotVisible('ctl0_body_ctl3');
  		$this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl3');
  		$this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl3');
  		$this->type("ctl0\$body\$TextBox", "test");
  		$this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", "");
 @@ -36,7 +36,7 @@ class RadioButtonTestCase extends SeleniumTestCase  		// a radiobutton validated by a required field validator
  		$this->verifyNotVisible('ctl0_body_ctl6');
  		$this->click("//input[@type='submit' and @value='Submit']", "");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl6');
  		$this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", "");
  		$this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
 diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php new file mode 100644 index 00000000..e0b5a49c --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php @@ -0,0 +1,29 @@ +<?php
 +
 +class Repeater1TestCase extends SeleniumTestCase
 +{
 +	function test()
 +	{
 +		$this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&notheme=true", "");
 +
 +		// verify if all required texts are present
 +		$this->verifyTextPresent('ID','');
 +		$this->verifyTextPresent('Name','');
 +		$this->verifyTextPresent('Quantity','');
 +		$this->verifyTextPresent('Price','');
 +		$this->verifyTextPresent('Imported','');
 +		$this->verifyTextPresent('ITN001','');
 +		$this->verifyTextPresent('Motherboard','');
 +		$this->verifyTextPresent('Yes','');
 +		$this->verifyTextPresent('ITN019','');
 +		$this->verifyTextPresent('Speaker','');
 +		$this->verifyTextPresent('No','');
 +		$this->verifyTextPresent('Computer Parts Inventory','');
 +
 +		// verify specific table tags
 +		$this->verifyElementPresent("//td[@colspan='5']");
 +		$this->verifyElementPresent("//table[@cellpadding='2']");
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php new file mode 100644 index 00000000..08a8c3da --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php @@ -0,0 +1,37 @@ +<?php
 +
 +class Repeater2TestCase extends SeleniumTestCase
 +{
 +	function test()
 +	{
 +		$this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&notheme=true", "");
 +
 +		// verify if all required texts are present
 +		$this->verifyTextPresent('North','');
 +		$this->verifyTextPresent('John','');
 +		$this->verifyTextPresent('Developer','');
 +		$this->verifyTextPresent('South','');
 +		$this->verifyTextPresent('Carter','');
 +		$this->verifyTextPresent('Program Manager','');
 +
 +		// verify specific table tags
 +		$this->verifyElementPresent("//table[@cellspacing='1']");
 +		$this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell' and contains(text(),'North')]","");
 +		$this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl1_Cell']","");
 +		$this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl2_Cell']","");
 +		$this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl3_Cell']","");
 +		$this->verifyElementPresent("//td[@id='ctl0_body_Repeater_ctl4_Cell']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl1_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl2_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl1_Repeater2_ctl3_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl1_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl2_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl2_Repeater2_ctl3_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl1_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl3_Repeater2_ctl2_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl1_Row']","");
 +		$this->verifyElementPresent("//tr[@id='ctl0_body_Repeater_ctl4_Repeater2_ctl2_Row']","");
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php new file mode 100644 index 00000000..d34d6747 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Repeater3TestCase.php @@ -0,0 +1,37 @@ +<?php
 +
 +class Repeater3TestCase extends SeleniumTestCase
 +{
 +	function test()
 +	{
 +		$this->open("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample3&notheme=true", "");
 +
 +		// verify product name is required
 +		$this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0');
 +		$this->type("ctl0_body_Repeater_ctl0_ProductName", "");
 +		$this->click("//input[@type='submit' and @value='Save']", "");
 +		$this->verifyVisible('ctl0_body_Repeater_ctl0_ctl0');
 +
 +		// verify product price is of proper format
 +		$this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1');
 +		$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "abc");
 +		$this->click("//input[@type='submit' and @value='Save']", "");
 +		$this->verifyVisible('ctl0_body_Repeater_ctl0_ctl1');
 +
 +		// perform postback
 +		$this->click("ctl0_body_Repeater_ctl0_ProductImported",'');
 +		$this->type("ctl0_body_Repeater_ctl0_ProductName", "Mother Board");
 +		$this->type("ctl0_body_Repeater_ctl0_ProductPrice", "99.01");
 +		$this->select("ctl0_body_Repeater_ctl3_ProductCategory", "label=Accessories");
 +		$this->clickAndWait("//input[@type='submit' and @value='Save']", "");
 +		$this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl0');
 +		$this->verifyNotVisible('ctl0_body_Repeater_ctl0_ctl1');
 +
 +		// verify postback results
 +		$this->verifyElementPresent("//td[text()='Mother Board']",'');
 +		$this->verifyElementNotPresent("//td[text()='Input Devices']",'');
 +		$this->verifyElementPresent("//td[text()='99.01']",'');
 +	}
 +}
 +
 +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php index e1c76938..cf101502 100644 --- a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php @@ -36,7 +36,7 @@ class TextBoxTestCase extends SeleniumTestCase  		// auto postback textbox, CausesValidation=true
  		$this->verifyNotVisible('ctl0_body_ctl7');
  		$this->type("ctl0\$body\$TextBox3", "test");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl7');
  		$this->typeAndWait("ctl0\$body\$TextBox3", "non test");
  		$this->verifyNotVisible('ctl0_body_ctl7');
 @@ -83,7 +83,7 @@ End of message  		// textbox associated with a validator
  		$this->verifyNotVisible('ctl0_body_ctl15');
  		$this->type("ctl0\$body\$MultiTextBox3", "demo");
 -		$this->pause(1000);
 +//		$this->pause(1000);
  		$this->verifyVisible('ctl0_body_ctl15');
  		$this->typeAndWait("ctl0\$body\$MultiTextBox3", "non demo");
  		$this->verifyNotVisible('ctl0_body_ctl15');
  | 
