diff options
Diffstat (limited to 'tests/FunctionalTests/tickets')
3 files changed, 65 insertions, 0 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.page b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page new file mode 100644 index 00000000..6acd9f24 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.page @@ -0,0 +1,6 @@ +<com:TContent ID="Content">
+<span id="label">Click to edit ==></span> +<com:TInPlaceTextBox id="InPlaceTextBox" Text="Editable Text" ReadOnly="false" onTextChanged="onTextChanged"/> +<com:TActiveButton Text="Change to Read Only" OnClick="ChangeState"/> +
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket722.php b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php new file mode 100644 index 00000000..91759fb0 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket722.php @@ -0,0 +1,30 @@ +<?php + +prado::using ('System.Web.UI.ActiveControls.*'); + +class Ticket722 extends TPage +{ + public function changeState ($sender, $param) + { + $state=$this->InPlaceTextBox->getReadOnly(); + $this->InPlaceTextBox->setReadOnly(!$state); + $sender->setText($state?"Change to Read Only":"Change to Editable"); + $this->InPlaceTextBox->setText($state?$this->getText():$this->getText().' [Read Only]'); + } + + public function onTextChanged ($sender, $param) + { + $this->setText($sender->getText()); + } + + public function setText ($value) + { + $this->setViewState('text', $value, "Editable Text"); + } + + public function getText () + { + return $this->getViewState('text', "Editable Text"); + } +} +?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php new file mode 100644 index 00000000..68a0282c --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket722TestCase.php @@ -0,0 +1,29 @@ +<?php +class Ticket722TestCase extends SeleniumTestCase +{ + function test() + { + $base = 'ctl0_Content_'; + $this->open('tickets/index.php?page=Ticket722'); + $this->assertTitle("Verifying Ticket 722"); + + $this->assertText($base.'InPlaceTextBox__label', 'Editable Text'); + $this->click($base.'InPlaceTextBox__label'); + $this->pause(800); + $this->assertVisible($base.'InPlaceTextBox'); + $this->type($base.'InPlaceTextBox',"Prado"); + $this->fireEvent($base.'InPlaceTextBox', 'blur'); // Release textbox + $this->pause(800); + $this->assertNotVisible($base.'InPlaceTextBox'); + $this->assertText($base.'InPlaceTextBox__label', 'Prado'); + $this->click($base.'ctl0'); + $this->pause(800); + $this->assertText($base.'InPlaceTextBox__label', 'Prado [Read Only]'); + $this->click($base.'InPlaceTextBox__label'); + $this->pause(800); + $this->assertNotVisible($base.'InPlaceTextBox'); + + } + +} +?>
\ No newline at end of file |