From d7fd9d7c3dfe6cb81e60e397b8ab3b1f91bf0ea4 Mon Sep 17 00:00:00 2001 From: tof <> Date: Thu, 11 Oct 2007 08:54:19 +0000 Subject: Add test for Ticket #719 --- .gitattributes | 1 + .../tickets/protected/pages/Ticket719.page | 53 ++++++++++++++++++++++ .../tickets/protected/pages/Ticket719.php | 41 +++++++++++++++++ .../tickets/tests/Ticket719TestCase.php | 40 ++++++++++++++++ 4 files changed, 135 insertions(+) create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket719.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket719.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket719TestCase.php diff --git a/.gitattributes b/.gitattributes index 733d68d7..71cab846 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2978,6 +2978,7 @@ tests/FunctionalTests/tickets/protected/pages/Ticket703/Ticket703.php -text tests/FunctionalTests/tickets/protected/pages/Ticket703/config.xml -text tests/FunctionalTests/tickets/protected/pages/Ticket708.page -text tests/FunctionalTests/tickets/protected/pages/Ticket708.php -text +tests/FunctionalTests/tickets/protected/pages/Ticket719.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.page -text tests/FunctionalTests/tickets/protected/pages/Ticket72.php -text tests/FunctionalTests/tickets/protected/pages/Ticket93.page -text diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page new file mode 100644 index 00000000..a64c5c55 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page @@ -0,0 +1,53 @@ + + + +

+ + +

+

+ + + +

+

+
+ +

+
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket719.php b/tests/FunctionalTests/tickets/protected/pages/Ticket719.php new file mode 100644 index 00000000..a08aac36 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket719.php @@ -0,0 +1,41 @@ +getCountries() as $country) + { + if(strpos(strtolower($country), $token) === 0) + { + $list[] = $country; + $count++; + if($count > 10) break; + } + } + return $list; + } + + function suggestion_selected($sender, $param) + { + var_dump($param->selectedIndex); + } + public function suggestCountries($sender, $param) + { + $sender->setDataSource($this->matchCountries($param->Token)); + $sender->dataBind(); + } + + + public function validForm ($sender, $param) + { + $this->Result->Text = "TextBox Content : ".$this->textbox->getText()." -- Autocomplete Content :".$this->autocomplete->getText(); + } +} +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php new file mode 100644 index 00000000..51b321ad --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php @@ -0,0 +1,40 @@ +open("tickets/index.php?page=Ticket719"); + $this->verifyTextPresent("Verifying Ticket 719"); + + $base="ctl0_Content_"; + + $this->click("${base}ctl2"); + $this->pause(800); + $this->assertVisible("${base}ctl0", 'Required'); + $this->assertVisible("${base}ctl1", 'Required'); + + $this->keyPress("${base}autocomplete", 'f'); + $this->pause(1000); + $this->verifyTextPresent('Finland'); + $this->keyPress("${base}autocomplete", 'r'); + $this->pause(1000); + $this->verifyTextPresent('French'); + $this->keyPress("${base}autocomplete", 'a'); + $this->pause(1000); + $this->verifyTextPresent('France'); + + $this->click("css=#${base}autocomplete_result ul li"); + $this->pause(800); + $this->assertNotVisible("${base}ctl1"); + + $this->type("${base}textbox", "Prado"); + $this->assertNotVisible("${base}ctl0"); + + $this->click("${base}ctl2"); + $this->pause(800); + $this->assertText("${base}Result", "TextBox Content : Prado -- Autocomplete Content :France"); + } +} + +?> \ No newline at end of file -- cgit v1.2.3