From 75293bddc7faea69021f5e29ac9e4df3f04c4f36 Mon Sep 17 00:00:00 2001 From: tof <> Date: Wed, 26 Sep 2007 12:57:46 +0000 Subject: Add test for ticket #671 --- .gitattributes | 1 + .../tickets/protected/pages/Ticket671.page | 34 ++++++++++++++++++ .../tickets/protected/pages/Ticket671.php | 33 +++++++++++++++++ .../tickets/tests/Ticket671TestCase.php | 42 ++++++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket671.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket671.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket671TestCase.php diff --git a/.gitattributes b/.gitattributes index 377fa0ec..6d17321d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2943,6 +2943,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket653/ticket653.page -text tests/FunctionalTests/tickets/protected/pages/Ticket656.page -text tests/FunctionalTests/tickets/protected/pages/Ticket659.page -text tests/FunctionalTests/tickets/protected/pages/Ticket670.page -text +tests/FunctionalTests/tickets/protected/pages/Ticket671.page -text tests/FunctionalTests/tickets/protected/pages/Ticket679.page -text tests/FunctionalTests/tickets/protected/pages/Ticket679.php -text tests/FunctionalTests/tickets/protected/pages/Ticket68.page -text 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 @@ + + + + + + + + + + +

+ + + + + +
\ 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 @@ +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 @@ +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 -- cgit v1.2.3