diff options
Diffstat (limited to 'tests/FunctionalTests')
6 files changed, 79 insertions, 5 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page index 64f37867..88117744 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.page @@ -1,10 +1,10 @@ <html> <com:THead/> <body> -<com:TForm>
+<com:TForm> <h1>TActiveDatePicker test</h1> -<p>
-<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/>
+<p> +<com:TActiveDatePicker ID="datepicker" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker"/> <com:TActiveLabel ID="status" /><br/> <com:TActiveButton ID="decreaseButton" OnClick="decrease" Text="-1" OnCallback="testDatePicker"/> <com:TActiveButton ID="todayButton" OnClick="today" Text="Today" OnCallback="testDatePicker"/> @@ -18,8 +18,11 @@ ShowCalendar=false <com:TActiveDatePicker ID="datepicker2" DateFormat="MM-dd-yyyy" OnCallback="testDatePicker2" InputMode="DropDownList" ShowCalendar="false"/> <com:TActiveLabel ID="status2" /><br/> </p> +<p>Partial Calendar</p> +<p> +<com:TActiveDatePicker ID="datepicker3" DateFormat="MMMM/yyyy" OnCallback="testDatePicker3" InputMode="DropDownList" ShowCalendar="true"/> +<com:TActiveLabel ID="status3" /><br/> -
</com:TForm> </body> </html>
\ No newline at end of file diff --git a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php index 4897a146..300574aa 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php +++ b/tests/FunctionalTests/active-controls/protected/pages/ActiveDatePicker.php @@ -17,7 +17,11 @@ class ActiveDatePicker extends TPage { public function testDatePicker2($sender, $param){ $this->status2->Text = $this->datepicker2->getText(); } - + + public function testDatePicker3($sender, $param){ + $this->status3->Text = $this->datepicker3->getText(); + } + public function today ($sender, $param) { $this->datepicker->setTimestamp(time()); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php index 5faee611..c3b47934 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php @@ -104,6 +104,16 @@ class ActiveDatePickerTestCase extends SeleniumTestCase $this->pause(800); $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), 2005); $this->verifyText("status2", date('m-d-Y', $dateToCheck)); + + + $this->verifyText("status3", ""); + $dateToCheck=time(); + $this->verifySelected("datepicker3_month", date('F', $dateToCheck)); + $this->verifySelected("datepicker3_year", date('Y', $dateToCheck)); + $this->select("datepicker3_year", 2005); + $this->pause(800); + $dateToCheck=mktime(0,0,0,(int)date('m'),(int)date('d'), 2005); + $this->verifyText("status3", date('m/Y', $dateToCheck)); } } diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue216.page b/tests/FunctionalTests/tickets/protected/pages/Issue216.page new file mode 100644 index 00000000..2efff728 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Issue216.page @@ -0,0 +1,15 @@ +<com:TContent ID="Content">
+ <h1>TTabPanel doesn't preserve active tab on callback request</h1>
+
+ <com:TTabPanel id="tabpanel">
+ <com:TTabView id="tab1" Caption="Tab 1">
+ <p>This is Tab 1</p>
+ </com:TTabView>
+ <com:TTabView id="tab2" Caption="Tab 2">
+ <p>This is Tab 2</p>
+ </com:TTabView>
+ </com:TTabPanel>
+
+ <com:TActiveButton id="btn1" OnCallback="buttonClickCallback" Text ="Click me"/>
+ <com:TActiveLabel id="result"/>
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Issue216.php b/tests/FunctionalTests/tickets/protected/pages/Issue216.php new file mode 100644 index 00000000..15491e2e --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Issue216.php @@ -0,0 +1,14 @@ +<?php
+Prado::using('System.Web.UI.ActiveControls.*');
+
+class Issue216 extends TPage
+{
+ public function buttonClickCallback($sender, $param)
+ {
+
+ $this->result->setText('Tab ActiveIndex is : '.$this->tabpanel->ActiveViewIndex);
+
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php new file mode 100644 index 00000000..1cfdf0cd --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php @@ -0,0 +1,28 @@ +<?php
+
+class Issue216TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open('tickets/index.php?page=Issue216');
+ $this->assertTextPresent('TTabPanel doesn\'t preserve active tab on callback request');
+
+ $this->assertVisible('ctl0_Content_tab1');
+
+ $this->click("ctl0_Content_btn1");
+ $this->pause(800);
+
+ $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 0");
+
+ $this->click("ctl0_Content_tab2_0");
+ $this->pause(800);
+
+ $this->assertVisible('ctl0_Content_tab2');
+
+ $this->click("ctl0_Content_btn1");
+ $this->pause(800);
+ $this->assertText("ctl0_Content_result", "Tab ActiveIndex is : 1");
+ }
+}
+
+?>
\ No newline at end of file |