summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/active-controls
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/active-controls')
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page23
-rw-r--r--tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php58
-rw-r--r--tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php32
3 files changed, 113 insertions, 0 deletions
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page
new file mode 100644
index 00000000..f0f3044d
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.page
@@ -0,0 +1,23 @@
+<com:TForm ID="form1">
+ <h1>Control Adapter - State Tracking Tests</h1>
+ <com:TActiveButton ID="button1" Text="Test Button 1" />
+ <com:TActiveButton ID="button2" Text="Test Button 2"
+ Attributes.onclick="alert('ok')"
+ Style.Font.Size="12" Style.BackColor="blue" Style.Height="2em" />
+
+ <div style="margin:1em; padding: 0.5em; border:1px solid #ccc; text-align:center">
+ <com:TActiveButton ID="test1" Text="Enable/Disable Button 1" OnClick="change_enabled"/>
+ <com:TActiveButton ID="test2" Text="Hide/Show Button 1" OnClick="change_visible"/>
+ <br />
+ <com:TActiveButton ID="test3" Text="Change Button 1 Tooltip" OnClick="change_tooltip"/>
+ <com:TActiveButton ID="test4" Text="Change Button 1 TabIndex" OnClick="change_tabindex"/>
+ <com:TActiveButton ID="test5" Text="Change Button 1 AccessKey" OnClick="change_accesskey"/>
+ <br />
+ <com:TActiveButton ID="test6" Text="Change Button 1 BGColor" OnClick="change_bgcolor1"/>
+ <com:TActiveButton ID="test7" Text="Change Button 2 BGColor" OnClick="change_bgcolor2"/>
+ <br />
+ <com:TActiveButton ID="test8" Text="Change Button 1 Attributes" OnClick="change_attributes1"/>
+ <com:TActiveButton ID="test9" Text="Change Button 2 Attributes" OnClick="change_attributes2"/>
+ </div>
+ <com:TJavascriptLogger />
+</com:TForm> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php
new file mode 100644
index 00000000..edaf0720
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/protected/pages/ControlAdapterTest.php
@@ -0,0 +1,58 @@
+<?php
+
+class ControlAdapterTest extends TPage
+{
+ function change_enabled()
+ {
+ $this->button1->Enabled = !$this->button1->Enabled;
+ }
+
+ function change_visible()
+ {
+ $this->button1->Visible = !$this->button1->Visible;
+ }
+
+ function change_tooltip()
+ {
+ $this->button1->ToolTip = "hello world";
+ }
+
+ function change_tabindex()
+ {
+ $this->button1->tabIndex = 10;
+ }
+
+ function change_accesskey()
+ {
+ $this->button1->accessKey = "F";
+ }
+
+ function change_bgcolor1()
+ {
+ $this->button1->BackColor = "orange";
+ $this->button1->ForeColor="white";
+ $this->button1->Font->Bold = true;
+ $this->button1->Font->Size = "2em";
+ }
+
+
+ function change_bgcolor2()
+ {
+ $this->button2->BackColor = "red";
+ $this->button2->ForeColor="white";
+ $this->button2->Font->Bold = true;
+ $this->button2->Font->Size = 14;
+ }
+
+ function change_attributes1()
+ {
+ $this->button1->Attributes['onclick'] = "alert('haha!')";
+ }
+
+ function change_attributes2()
+ {
+ $this->button2->Attributes['onclick'] = "alert('baz!')";
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
new file mode 100644
index 00000000..3a3b292c
--- /dev/null
+++ b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php
@@ -0,0 +1,32 @@
+<?php
+
+class CallbackAdapterTestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("active-controls/index.php?page=ControlAdapterTest");
+ $this->assertTextPresent('Control Adapter - State Tracking Tests');
+
+ $this->click('button2');
+ $this->assertAlert('ok');
+
+ $this->click('test6');
+ $this->pause(500);
+ $this->click('test7');
+ $this->pause(500);
+ $this->click('test8');
+ $this->pause(500);
+ $this->click('test9');
+ $this->pause(500);
+
+ $this->click('button1');
+ $this->assertAlert('haha!');
+
+ $this->click('button2');
+ $this->assertAlert('ok');
+ $this->assertAlert('baz!');
+
+ }
+}
+
+?> \ No newline at end of file