diff options
author | tof <> | 2007-09-26 12:57:46 +0000 |
---|---|---|
committer | tof <> | 2007-09-26 12:57:46 +0000 |
commit | 75293bddc7faea69021f5e29ac9e4df3f04c4f36 (patch) | |
tree | 1e7fdf2324844c45fb1fa96a99ed69142f4c1aa2 /tests/FunctionalTests/tickets | |
parent | f39661c02e0686848c01017fc51f1cd2ad714909 (diff) |
Add test for ticket #671
Diffstat (limited to 'tests/FunctionalTests/tickets')
3 files changed, 109 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket671.page b/tests/FunctionalTests/tickets/protected/pages/Ticket671.page new file mode 100644 index 00000000..22c899f5 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket671.page @@ -0,0 +1,34 @@ +<com:TContent ID="Content">
+
+<com:TActiveDropDownList id="addl" OnSelectedIndexChanged="SelectItem" ValidationGroup="Test1"> + <com:TListItem Value="1" Text="Test 1"/> + <com:TListItem Value="2" Text="Test 2"/> + <com:TListItem Value="3" Text="Test 3"/>
+</com:TActiveDropDownList> +<com:TActiveCustomValidator + ControlToValidate="addl" + ValidationGroup="Test1" + OnServerValidate="validateSelection" + Display="Dynamic" + ErrorMessage="Please Select Test 3"/> +<com:TActiveLinkButton + Text="Submit" + OnClick="submit" + ValidationGroup="Test1" /> +<com:TActiveLabel id="lblResult"/> +<br/><br/> +<com:TActiveTextBox ID="testTextBox" ValidationGroup="Test2" /> +<com:TActiveCustomValidator + ControlToValidate="testTextBox" + ValidationGroup="Test2" + OnServerValidate="validateTextBox" + ErrorMessage="Please enter 'Prado' !" + Display="Dynamic" + /> +<com:TActiveLinkButton + Text="Validate" + ValidationGroup="Test2" + OnClick="submit2" /> +<com:TActiveLabel id="lblResult2"/> +
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket671.php b/tests/FunctionalTests/tickets/protected/pages/Ticket671.php new file mode 100644 index 00000000..04bd1a7e --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket671.php @@ -0,0 +1,33 @@ +<?php + +prado::using ('System.Web.UI.ActiveControls.*'); + +class Ticket671 extends TPage +{ + public function validateSelection($sender, $param) + { + $param->setIsValid($param->getValue()==3); + } + + public function selectItem ($sender, $param) + { + $this->lblResult->text="You have selected '".$sender->getSelectedItem()->getText()."'."; + if (!$this->getIsValid()) $this->lblResult->text .= " But this is not valid !"; + } + + public function submit ($sender, $param) + { + $this->lblResult->text="You have successfully validated the form"; + } + + public function validateTextBox($sender,$param) { + $param->setIsValid(strtolower($param->getValue())=="prado"); + } + + public function submit2($sender,$param) { + $this->lblResult2->text="Thanks !"; + } + + +} +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php new file mode 100644 index 00000000..866fc330 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket671TestCase.php @@ -0,0 +1,42 @@ +<?php +class Ticket671TestCase extends SeleniumTestCase +{ + function test() + { + $base = 'ctl0_Content_'; + $this->open('tickets/index.php?page=Ticket671'); + $this->assertTitle("Verifying Ticket 671"); + + $this->verifyNotVisible($base.'ctl0'); + // Click submit + $this->click($base.'ctl1'); + $this->pause(800); + $this->verifyText($base.'ctl0', 'Please Select Test 3'); + $this->verifyVisible($base.'ctl0'); + $this->select($base.'addl', 'Test 2'); + $this->pause(800); + $this->verifyVisible($base.'ctl0'); + $this->verifyText($base."lblResult", "You have selected 'Test 2'. But this is not valid !"); + $this->select($base.'addl', 'Test 3'); + $this->pause(800); + $this->verifyNotVisible($base.'ctl0'); + $this->verifyText($base."lblResult", "You have selected 'Test 3'."); + $this->click($base.'ctl1'); + $this->pause(800); + $this->verifyText($base."lblResult", "You have successfully validated the form"); + + $this->type($base.'testTextBox', 'test'); + $this->pause(800); + $this->click($base.'ctl3'); + $this->pause(800); + $this->verifyVisible($base.'ctl2'); + $this->type($base.'testTextBox',"Prado"); + $this->pause(800); + $this->click($base.'ctl3'); + $this->pause(800); + $this->verifyNotVisible($base.'ctl2'); + $this->verifyText($base.'lblResult2', 'Thanks !'); + } + +} +?>
\ No newline at end of file |