summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/quickstart
diff options
context:
space:
mode:
authorxue <>2006-02-14 02:29:31 +0000
committerxue <>2006-02-14 02:29:31 +0000
commitf5e5fddf2b624ba00933b7d22724be1e80741cb2 (patch)
tree492b31fe4faf811d56d19efb948aec966f73507f /tests/FunctionalTests/quickstart
parent3e60cbad4b79301ae086ecacbdc63af333532a43 (diff)
Added datalist FT.
Diffstat (limited to 'tests/FunctionalTests/quickstart')
-rw-r--r--tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php26
-rw-r--r--tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php60
2 files changed, 86 insertions, 0 deletions
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php
new file mode 100644
index 00000000..ef61b13f
--- /dev/null
+++ b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php
@@ -0,0 +1,26 @@
+<?php
+
+class DataList1TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&amp;notheme=true", "");
+
+ // verify if all required texts are present
+ $this->verifyTextPresent('ITN001','');
+ $this->verifyTextPresent('$100','');
+ $this->verifyTextPresent('Motherboard','');
+ $this->verifyTextPresent('ITN018','');
+ $this->verifyTextPresent('Surge protector','');
+ $this->verifyTextPresent('45','');
+ $this->verifyTextPresent('$15','');
+ $this->verifyTextPresent('Total 19 products.','');
+ $this->verifyTextPresent('Computer Parts','');
+
+ // verify specific table tags
+ $this->verifyElementPresent("ctl0_body_DataList");
+ $this->verifyElementPresent("//td[@align='right']");
+ }
+}
+
+?> \ No newline at end of file
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
new file mode 100644
index 00000000..c0c3399c
--- /dev/null
+++ b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
@@ -0,0 +1,60 @@
+<?php
+
+class DataList2TestCase extends SeleniumTestCase
+{
+ function test()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&amp;notheme=true", "");
+
+ // verify initial presentation
+ $this->verifyTextPresent("Motherboard ", "");
+ $this->verifyTextPresent("Monitor ", "");
+
+ // verify selecting an item
+ $this->clickAndWait("link=ITN003", "");
+ $this->verifyTextPresent("Quantity", "");
+ $this->verifyTextPresent("Price", "");
+ $this->verifyTextPresent("\$80", "");
+ $this->clickAndWait("link=ITN005", "");
+ $this->verifyTextPresent("\$150", "");
+
+ // verify editting an item
+ $this->clickAndWait("id=ctl0_body_DataList_ctl5_ctl4", "");
+ $this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11");
+ $this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99");
+ $this->click("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported' and @value='ctl0\$body\$DataList\$ctl5\$ProductImported']", "");
+ $this->clickAndWait("link=Save", "");
+
+ // verify item is saved
+ $this->clickAndWait("link=ITN005", "");
+ $this->verifyTextPresent("\$140.99", "");
+ $this->verifyTextPresent("11", "");
+
+ // verify editting another item
+ $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl2", "");
+ $this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive");
+ $this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23");
+ $this->click("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported' and @value='ctl0\$body\$DataList\$ctl3\$ProductImported']", "");
+ $this->clickAndWait("link=Cancel", "");
+
+ // verify item is canceled
+ $this->clickAndWait("link=ITN003", "");
+ $this->verifyTextPresent("2", "");
+ $this->verifyTextPresent("Harddrive ", "");
+
+ // verify item deletion
+ $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl5", "");
+ $this->verifyConfirmation("Are you sure?");
+ $this->chooseCancelOnNextConfirmation();
+ $this->click("id=ctl0_body_DataList_ctl5_ctl3", "");
+ $this->verifyTextPresent("Motherboard ", "");
+ $this->verifyTextPresent("CPU ", "");
+ $this->verifyTextNotPresent("Harddrive","");
+ $this->verifyTextPresent("Sound card", "");
+ $this->verifyTextPresent("Video card", "");
+ $this->verifyTextPresent("Keyboard","");
+ $this->verifyTextPresent("Monitor ", "");
+ }
+}
+
+?> \ No newline at end of file