summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php4
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php2
-rw-r--r--tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php38
-rw-r--r--tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php58
4 files changed, 99 insertions, 3 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
index 21f61abe..997e9bdd 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/AutoCompleteTest.php
@@ -7,10 +7,10 @@ class AutoCompleteTest extends TPage
{
public function suggestCountries($sender, $param)
{
- $sender->setDataSource($this->matchCountries($param->getParameter()));
+ $sender->setDataSource($this->matchCountries($param->getCallbackParameter()));
$sender->dataBind();
$sender->render($param->getNewWriter());
- $this->label1->Text = "suggestion for ".$param->getParameter();
+ $this->label1->Text = "suggestion for ".$param->getCallbackParameter();
}
public function callback_requested($sender, $param)
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
index c3c44252..a8f83187 100644
--- a/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
+++ b/tests/FunctionalTests/active-controls/protected/pages/ValueTriggerCallbackTest.php
@@ -4,7 +4,7 @@ class ValueTriggerCallbackTest extends TPage
{
function text1_changed($sender, $param)
{
- $values = $param->getParameter();
+ $values = $param->getCallbackParameter();
$this->label1->Text = "Old = ".$values->OldValue." : New Value = ".$values->NewValue;
}
}
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
new file mode 100644
index 00000000..8859d729
--- /dev/null
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
@@ -0,0 +1,38 @@
+<?php
+//$Id$
+class ActiveButtonTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&amp;notheme=true");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ $this->assertTextPresent('TActiveButton Samples (AJAX)');
+
+ // a click button
+ $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->pause(800);
+ $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+
+ // a command button
+ $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+ $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->pause(800);
+ $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+
+ // a button causing validation
+ $this->verifyNotVisible('ctl0_body_ctl2');
+ $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->pause(800);
+ $this->verifyVisible('ctl0_body_ctl2');
+ $this->type("ctl0\$body\$TextBox", "test");
+ $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->pause(800);
+ $this->verifyNotVisible('ctl0_body_ctl2');
+ $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", "");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
new file mode 100644
index 00000000..ce171e2b
--- /dev/null
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
@@ -0,0 +1,58 @@
+<?php
+
+//$Id$
+class ActiveCheckBoxTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&amp;notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ $this->assertTextPresent('TActiveCheckBox Samples (AJAX)');
+
+
+ // an auto postback checkbox
+ $this->verifyTextNotPresent("ctl0_body_ctl0 clicked using callback");
+ $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->pause(800);
+ $this->assertChecked("//input[@name='ctl0\$body\$ctl0']");
+ $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
+ $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->pause(800);
+ $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
+ $this->assertNotChecked("//input[@name='ctl0\$body\$ctl0']");
+
+ // a checkbox causing validation on a textbox
+ $this->verifyNotVisible('ctl0_body_ctl1');
+ $this->click("//input[@name='ctl0\$body\$ctl2']");
+ $this->verifyVisible('ctl0_body_ctl1');
+ $this->click("//input[@name='ctl0\$body\$ctl2']", "");
+ $this->verifyVisible('ctl0_body_ctl3');
+ $this->type("ctl0\$body\$TextBox", "test");
+ $this->click("//input[@name='ctl0\$body\$ctl2']", "");
+ $this->pause(800);
+ $this->verifyNotVisible('ctl0_body_ctl1');
+ $this->assertTextPresent("ctl0_body_ctl2 clicked using callback");
+
+ // a checkbox validated by a required field validator
+ $this->assertNotChecked("//input[@name='ctl0\$body\$CheckBox']");
+ $this->verifyNotVisible('ctl0_body_ctl4');
+ $this->click("//input[@type='submit' and @value='Submit']", "");
+ $this->verifyVisible('ctl0_body_ctl4');
+ $this->click("//input[@name='ctl0\$body\$CheckBox']", "");
+ $this->assertChecked("//input[@name='ctl0\$body\$CheckBox']");
+ $this->click("//input[@type='submit' and @value='Submit']", "");
+ $this->verifyNotVisible('ctl0_body_ctl4');
+ $this->assertTextPresent("ctl0_body_CheckBox clicked");
+
+ // a checkbox validated by a required field validator using AutoPostBack
+ $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
+ $this->verifyNotVisible('ctl0_body_ctl5');
+ $this->click("//input[@name='ctl0\$body\$CheckBox2']", "");
+ $this->verifyVisible('ctl0_body_ctl5');
+ $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
+ }
+}
+
+?> \ No newline at end of file