From 934069ca2164753f72783eaa7d9fd98e4280f2ec Mon Sep 17 00:00:00 2001 From: xue <> Date: Mon, 13 Feb 2006 06:04:33 +0000 Subject: Reorganized FT test folder. --- tests/FunctionalTests/config.php | 9 +-- tests/FunctionalTests/index.php | 54 +++---------- tests/FunctionalTests/quickstart.php | 39 +++++++++ tests/FunctionalTests/quickstart/Advanced/I18N.php | 54 +++++++++++++ .../quickstart/Controls/ButtonTestCase.php | 35 ++++++++ .../quickstart/Controls/CheckBoxListTestCase.php | 54 +++++++++++++ .../quickstart/Controls/CheckBoxTestCase.php | 55 +++++++++++++ .../quickstart/Controls/DropDownListTestCase.php | 67 ++++++++++++++++ .../quickstart/Controls/HyperLinkTestCase.php | 17 ++++ .../quickstart/Controls/ImageButtonTestCase.php | 30 +++++++ .../quickstart/Controls/ImageTestCase.php | 20 +++++ .../quickstart/Controls/LabelTestCase.php | 23 ++++++ .../quickstart/Controls/LinkButtonTestCase.php | 34 ++++++++ .../quickstart/Controls/ListBoxTestCase.php | 84 +++++++++++++++++++ .../quickstart/Controls/PanelTestCase.php | 18 +++++ .../Controls/RadioButtonListTestCase.php | 54 +++++++++++++ .../quickstart/Controls/RadioButtonTestCase.php | 58 ++++++++++++++ .../quickstart/Controls/TableTestCase.php | 20 +++++ .../quickstart/Controls/TextBoxTestCase.php | 93 ++++++++++++++++++++++ .../quickstart/Fundamentals/HangmanTestCase.php | 34 ++++++++ .../quickstart/Fundamentals/HelloWorldTestCase.php | 16 ++++ .../quickstart_tests/Advanced/I18N.php | 54 ------------- .../quickstart_tests/Controls/ButtonTestCase.php | 35 -------- .../Controls/CheckBoxListTestCase.php | 54 ------------- .../quickstart_tests/Controls/CheckBoxTestCase.php | 55 ------------- .../Controls/DropDownListTestCase.php | 67 ---------------- .../Controls/HyperLinkTestCase.php | 17 ---- .../Controls/ImageButtonTestCase.php | 30 ------- .../quickstart_tests/Controls/ImageTestCase.php | 20 ----- .../quickstart_tests/Controls/LabelTestCase.php | 23 ------ .../Controls/LinkButtonTestCase.php | 34 -------- .../quickstart_tests/Controls/ListBoxTestCase.php | 84 ------------------- .../quickstart_tests/Controls/PanelTestCase.php | 18 ----- .../Controls/RadioButtonListTestCase.php | 54 ------------- .../Controls/RadioButtonTestCase.php | 58 -------------- .../quickstart_tests/Controls/TableTestCase.php | 20 ----- .../quickstart_tests/Controls/TextBoxTestCase.php | 93 ---------------------- .../Fundamentals/HangmanTestCase.php | 34 -------- .../Fundamentals/HelloWorldTestCase.php | 16 ---- tests/FunctionalTests/tickets.php | 39 +++++++++ tests/FunctionalTests/tickets/application.xml | 4 + tests/FunctionalTests/tickets/index.php | 8 ++ .../tickets/protected/pages/Layout.php | 14 ++++ .../tickets/protected/pages/Layout.tpl | 45 +++++++++++ .../tickets/protected/pages/Ticket21.page | 10 +++ .../tickets/protected/pages/Ticket21.php | 22 +++++ .../tickets/protected/pages/Ticket27.page | 17 ++++ .../tickets/protected/pages/config.xml | 5 ++ .../tickets/tests/Ticket21TestCase.php | 16 ++++ .../tickets/tests/Ticket27TestCase.php | 18 +++++ 50 files changed, 1018 insertions(+), 814 deletions(-) create mode 100644 tests/FunctionalTests/quickstart.php create mode 100644 tests/FunctionalTests/quickstart/Advanced/I18N.php create mode 100644 tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/ImageTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/LabelTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/PanelTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/TableTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Fundamentals/HelloWorldTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Advanced/I18N.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/ButtonTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/DropDownListTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/ImageButtonTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/LinkButtonTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/ListBoxTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Fundamentals/HangmanTestCase.php delete mode 100644 tests/FunctionalTests/quickstart_tests/Fundamentals/HelloWorldTestCase.php create mode 100644 tests/FunctionalTests/tickets.php create mode 100644 tests/FunctionalTests/tickets/application.xml create mode 100644 tests/FunctionalTests/tickets/index.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Layout.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Layout.tpl create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket21.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket21.php create mode 100644 tests/FunctionalTests/tickets/protected/pages/Ticket27.page create mode 100644 tests/FunctionalTests/tickets/protected/pages/config.xml create mode 100644 tests/FunctionalTests/tickets/tests/Ticket21TestCase.php create mode 100644 tests/FunctionalTests/tickets/tests/Ticket27TestCase.php (limited to 'tests') diff --git a/tests/FunctionalTests/config.php b/tests/FunctionalTests/config.php index 99644888..73491c6e 100644 --- a/tests/FunctionalTests/config.php +++ b/tests/FunctionalTests/config.php @@ -90,15 +90,12 @@ class PradoApplicationTester extends TApplication protected function getTestServiceParameter($file) { - $file = realpath($file); - $base = realpath($this->testConfig->tests_directory().'/pages/'); + $file = strtr(realpath($file),'\\','/'); + $base = strtr(realpath($this->testConfig->tests_directory().'/pages/'),'\\','/'); $search = array($base, '.php'); $replace = array('', ''); $pagePath = str_replace($search, $replace, $file); - $separator = array("/", "\\"); - if(in_array($pagePath[0], $separator)) - $pagePath = substr($pagePath, 1); - return str_replace($separator, array('.','.'), $pagePath); + return strtr(trim($pagePath,'/'),'/','.'); } } diff --git a/tests/FunctionalTests/index.php b/tests/FunctionalTests/index.php index d104f10e..7cf01abd 100644 --- a/tests/FunctionalTests/index.php +++ b/tests/FunctionalTests/index.php @@ -1,42 +1,12 @@ -get_directories(dirname(__FILE__).'/quickstart_tests', $groups); - - //tests to verify tickets - $this->get_directories($this->tests_directory(),$groups); - - return $groups; - } - - protected function get_directories($base,&$groups) - { - $groups[] = realpath($base); - $dirs = new DirectoryIterator($base); - foreach($dirs as $dir) - if(!$dir->isDot() && $dir->isDir() - && !preg_match("/\.svn/", $dir->getPathName())) - $this->get_directories($dir->getPathName(), $groups); - } -} - - -$root = dirname(__FILE__); -$server = SimpleSeleniumProxyServer::getInstance($root); - -$tester = new PradoSimpleTester(new BrowserTestConfig()); -$browser_tests = $tester->getTests(); -$browser_tests->run(new SimpleReporter()); - -$server->handleRequest(); - -?> \ No newline at end of file + + + +Prado Functional Test Suites + + + +Tests of QuickStart Tutorial Demo +
+Tests of Trac Tickets + + \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart.php b/tests/FunctionalTests/quickstart.php new file mode 100644 index 00000000..e4157aca --- /dev/null +++ b/tests/FunctionalTests/quickstart.php @@ -0,0 +1,39 @@ +get_directories(dirname(__FILE__).'/quickstart', $groups); + + return $groups; + } + + protected function get_directories($base,&$groups) + { + $groups[] = realpath($base); + $dirs = new DirectoryIterator($base); + foreach($dirs as $dir) + if(!$dir->isDot() && $dir->isDir() + && !preg_match("/\.svn/", $dir->getPathName())) + $this->get_directories($dir->getPathName(), $groups); + } +} + + +$root = dirname(__FILE__); +$server = SimpleSeleniumProxyServer::getInstance($root); + +$tester = new PradoSimpleTester(new BrowserTestConfig()); +$browser_tests = $tester->getTests(); +$browser_tests->run(new SimpleReporter()); + +$server->handleRequest(); + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Advanced/I18N.php b/tests/FunctionalTests/quickstart/Advanced/I18N.php new file mode 100644 index 00000000..fc45b096 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Advanced/I18N.php @@ -0,0 +1,54 @@ +open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=en&notheme=true", ""); + $this->verifyTitle("Internationlization in PRADO", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("$12.40", ""); + $this->verifyTextPresent("€100.00", ""); + $this->verifyTextPresent("December 6, 2004", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh&notheme=true", ""); + $this->verifyTitle("PRADO 国际化", ""); + $this->verifyTextPresent("2004 十二月", ""); + $this->verifyTextPresent("US$ 12.40", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00 ", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh_TW&notheme=true", ""); + $this->verifyTitle("PRADO 國際化", ""); + $this->verifyTextPresent("2004年12月6日", ""); + $this->verifyTextPresent("US$12.40", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=de&notheme=true", ""); + $this->verifyTitle("Internationalisierung in PRADO", ""); + $this->verifyTextPresent("6. Dezember 2004 ", ""); + $this->verifyTextPresent("$ 12,40", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=es&notheme=true", ""); + $this->verifyTitle("Internationlization en PRADO", ""); + $this->verifyTextPresent("6 de diciembre de 2004", ""); + $this->verifyTextPresent("US$12.40", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=fr&notheme=true", ""); + $this->verifyTitle("Internationalisation dans PRADO", ""); + $this->verifyTextPresent("6 décembre 2004", ""); + $this->verifyTextPresent("12,40 $", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00", ""); + $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=pl&notheme=true", ""); + $this->verifyTitle("Internacjonalizacja w PRADO", ""); + $this->verifyTextPresent("6 grudnia 2004", ""); + $this->verifyTextPresent("US$ 12,40", ""); + $this->verifyTextPresent("46.412,42 €", ""); + $this->verifyTextPresent("€100.00", ""); + + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php new file mode 100644 index 00000000..032f5ff1 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php @@ -0,0 +1,35 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a regular button + $this->clickAndWait("//input[@type='submit' and @value='text']", ""); + + // a click button + $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); + $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); + + // a command button + $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); + $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); + $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); + + // a button causing validation + $this->verifyNotVisible('ctl0_body_ctl3'); + $this->click("//input[@type='submit' and @value='submit']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@type='submit' and @value='submit']", ""); + $this->verifyNotVisible('ctl0_body_ctl3'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php new file mode 100644 index 00000000..783e2ccc --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php @@ -0,0 +1,54 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&notheme=true", ""); + + // Check box list with default settings: + $this->click("//input[@name='ctl0\$body\$ctl0\$0' and @value='value 1']", ""); + + // Check box list with customized cellpadding, cellspacing, color and text alignment: + $this->click("//input[@name='ctl0\$body\$ctl1\$1' and @value='value 2']", ""); + + // *** Currently unable to test the following cases: + // Check box list with vertical (default) repeat direction + // Check box list with horizontal repeat direction + // Check box list with flow layout and vertical (default) repeat direction + // Check box list with flow layout and horizontal repeat direction: + + // Check box list's behavior upon postback + $this->click("//input[@name='ctl0\$body\$CheckBoxList\$2' and @value='value 3']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", ""); + + // Auto postback check box list + $this->clickAndWait("//input[@name='ctl0\$body\$ctl7\$1' and @value='value 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + + // Databind to an integer-indexed array + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList1\$1' and @value='item 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: item 2, Text: item 2)", ""); + + // Databind to an associative array: + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList2\$1' and @value='key 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList3\$2' and @value='003']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // CheckBox list causing validation + $this->verifyNotVisible('ctl0_body_ctl8'); + $this->click("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl8'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); + $this->verifyNotVisible('ctl0_body_ctl8'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php new file mode 100644 index 00000000..a24ce937 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php @@ -0,0 +1,55 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a regular checkbox + $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); + + // a checkbox with customized value + $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); + + // an auto postback checkbox + $this->verifyTextNotPresent("I'm clicked"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + + // a checkbox causing validation on a textbox + $this->verifyNotVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->verifyNotVisible('ctl0_body_ctl3'); + + // a checkbox validated by a required field validator + $this->verifyNotVisible('ctl0_body_ctl6'); + $this->click("//input[@type='submit' and @value='Submit']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl6'); + $this->click("//input[@name='ctl0\$body\$CheckBox' and @value='ctl0\$body\$CheckBox']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyNotVisible('ctl0_body_ctl6'); + + // a checkbox validated by a required field validator using AutoPostBack + $this->verifyNotVisible('ctl0_body_ctl7'); + $this->click("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl7'); + $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); + $this->verifyNotVisible('ctl0_body_ctl7'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php new file mode 100644 index 00000000..cfb2047b --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php @@ -0,0 +1,67 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // dropdown list with default settings + $this->verifyElementPresent("ctl0\$body\$ctl0"); + + // dropdown list with initial options + $this->verifySelectOptions("ctl0\$body\$ctl1","item 1,item 2,item 3,item 4"); + $this->verifySelected("ctl0\$body\$ctl1","value=value 2"); + + // dropdown list with customized styles + $this->verifySelectOptions("ctl0\$body\$ctl2","item 1,item 2,item 3,item 4"); + $this->verifySelected("ctl0\$body\$ctl2","value=value 2"); + + // a disabled dropdown list + $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); + + // an auto postback dropdown list + $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + + // a single selection list box upon postback + $this->select("ctl0\$body\$DropDownList1", "label=item 4"); + $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + + // Databind to an integer-indexed array + $this->selectAndWait("ctl0\$body\$DBDropDownList1", "label=item 3"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: item 3, Text: item 3)", ""); + + // Databind to an associative array + $this->selectAndWait("ctl0\$body\$DBDropDownList2", "label=item 2"); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->selectAndWait("ctl0\$body\$DBDropDownList3", "label=Cary"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // dropdown list is being validated + $this->verifyNotVisible('ctl0_body_ctl6'); + $this->click("id=ctl0_body_ctl7", ""); + $this->verifyVisible('ctl0_body_ctl6'); + $this->select("ctl0\$body\$VDropDownList1", "label=item 2"); + $this->clickAndWait("id=ctl0_body_ctl7", ""); + $this->verifyNotVisible('ctl0_body_ctl6'); + + // dropdown list causing validation + $this->verifyNotVisible('ctl0_body_ctl8'); + $this->select("ctl0\$body\$VDropDownList2", "label=Disagree"); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl8'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->selectAndWait("ctl0\$body\$VDropDownList2", "label=Agree"); + $this->verifyNotVisible('ctl0_body_ctl8'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php new file mode 100644 index 00000000..b0b964f8 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php @@ -0,0 +1,17 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&notheme=true", ""); + $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->verifyElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); + $this->verifyTextPresent("Welcome to", ""); + $this->verifyTextPresent("Body contents", ""); + $this->verifyElementPresent("//a[img/@alt='Hello World']"); + $this->verifyElementPresent("//a[contains(text(),'Body contents')]"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php new file mode 100644 index 00000000..cc0bda53 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php @@ -0,0 +1,30 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a click button + $this->clickAndWait("//input[@type='image' and @alt='hello world']", ""); + $this->verifyTextPresent("You clicked at ",""); + + // a command button + $this->clickAndWait("ctl0\$body\$ctl1", ""); + $this->verifyTextPresent("Command name: test, Command parameter: value",""); + + // a button causing validation + $this->verifyNotVisible('ctl0_body_ctl2'); + $this->click("id=ctl0_body_ctl3", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl2'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("id=ctl0_body_ctl3", ""); + $this->verifyNotVisible('ctl0_body_ctl2'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php new file mode 100644 index 00000000..a0ad6d6b --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php @@ -0,0 +1,20 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']"); + $this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']"); + $this->verifyTextPresent("Hello World! Hello World! Hello World!", ""); + //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']"); + //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php new file mode 100644 index 00000000..aa045e0c --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php @@ -0,0 +1,23 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&notheme=true", ""); + $this->verifyTitle("PRADO QuickStart Sample", ""); + $this->verifyTextPresent("This is a label with customized color and font.", ""); + $this->verifyTextPresent("This is a form label associated with the TTextBox control below", ""); + $this->verifyTextPresent("This is a label with empty Text property and nonempty body", ""); + $this->verifyTextPresent("This is a disabled label", ""); + + $this->verifyAttribute("ctl0_body_Label2@disabled","regexp:true|disabled"); + + //$this->verifyAttribute("ctl0_body_Label1@for","ctl0_body_test"); + + $this->type("ctl0\$body\$test", "test"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php new file mode 100644 index 00000000..49c3c61a --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php @@ -0,0 +1,34 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // regular buttons + $this->clickAndWait("link=link button", ""); + $this->clickAndWait("//a[contains(text(),'body content')]", ""); + + // a click button + $this->clickAndWait("link=click me", ""); + $this->clickAndWait("link=I'm clicked", ""); + + // a command button + $this->clickAndWait("link=click me", ""); + $this->clickAndWait("//a[contains(text(),'Name: test, Param: value')]", ""); + + // a button causing validation + $this->verifyNotVisible('ctl0_body_ctl4'); + $this->click("link=submit", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl4'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("link=submit", ""); + $this->verifyNotVisible('ctl0_body_ctl4'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php new file mode 100644 index 00000000..6f86719a --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php @@ -0,0 +1,84 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&notheme=true", ""); + + // a default single selection listbox + $this->verifyAttribute("ctl0\$body\$ctl0@size","4"); + + // single selection list box with initial options + $this->verifySelectOptions("ctl0\$body\$ctl1","item 1,item 2,item 3,item 4"); + $this->verifySelected("ctl0\$body\$ctl1","value=value 2"); + + // a single selection list box with customized style + $this->verifyAttribute("ctl0\$body\$ctl2@size","3"); + $this->verifySelectOptions("ctl0\$body\$ctl2","item 1,item 2,item 3,item 4"); + $this->verifySelected("ctl0\$body\$ctl2","value=value 2"); + + // a disabled list box + $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); + + // an auto postback single selection list box + $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + + // a single selection list box upon postback + $this->select("ctl0\$body\$ListBox1", "label=item 4"); + $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); + + // a multiple selection list box + $this->verifyAttribute("ctl0\$body\$ctl6[]@size","4"); + $this->verifyAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple"); + + // a multiple selection list box with initial options + $this->verifyAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple"); + $this->verifySelectOptions("ctl0\$body\$ctl7[]","item 1,item 2,item 3,item 4"); + + // multiselection list box's behavior upon postback + $this->select("ctl0\$body\$ListBox2[]", "label=item 3"); + $this->clickAndWait("name=ctl0\$body\$ctl8", ""); + $this->verifyText("ctl0_body_MultiSelectionResult2","Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)"); + + // Auto postback multiselection list box + $this->selectAndWait("ctl0\$body\$ctl9[]", "label=item 1"); + $this->verifyText("ctl0_body_MultiSelectionResult","Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)"); + + // Databind to an integer-indexed array + $this->selectAndWait("ctl0\$body\$DBListBox1[]", "label=item 3"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: item 3, Text: item 3)", ""); + + // Databind to an associative array + $this->selectAndWait("ctl0\$body\$DBListBox2[]", "label=item 2"); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->selectAndWait("ctl0\$body\$DBListBox3[]", "label=Cary"); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // List box is being validated + $this->verifyNotVisible('ctl0_body_ctl10'); + $this->click("id=ctl0_body_ctl11", ""); + $this->verifyVisible('ctl0_body_ctl10'); + $this->select("ctl0\$body\$VListBox1", "label=item 2"); + $this->clickAndWait("id=ctl0_body_ctl11", ""); + $this->verifyNotVisible('ctl0_body_ctl10'); + + // List box causing validation + $this->verifyNotVisible('ctl0_body_ctl12'); + $this->select("ctl0\$body\$VListBox2", "label=Agree"); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl12'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->selectAndWait("ctl0\$body\$VListBox2", "label=Disagree"); + $this->verifyNotVisible('ctl0_body_ctl12'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php new file mode 100644 index 00000000..32134512 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php @@ -0,0 +1,18 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&notheme=true", ""); + $this->verifyTextPresent("This is panel content with", ""); + $this->verifyElementPresent("//span[text()='label']"); + $this->verifyTextPresent("grouping text", ""); + $this->click("//input[@name='ctl0\$body\$ctl17' and @value='ctl0\$body\$ctl17']", ""); + $this->verifyTextNotPresent("You have clicked on 'button2'."); + $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); + $this->verifyTextPresent("You have clicked on 'button2'."); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php new file mode 100644 index 00000000..b6242d05 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php @@ -0,0 +1,54 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&notheme=true", ""); + + // RadioButton list with default settings: + $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", ""); + + // RadioButton list with customized cellpadding, cellspacing, color and text alignment: + $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", ""); + + // *** Currently unable to test the following cases: + // RadioButton list with vertical (default) repeat direction + // RadioButton list with horizontal repeat direction + // RadioButton list with flow layout and vertical (default) repeat direction + // RadioButton list with flow layout and horizontal repeat direction: + + // RadioButton list's behavior upon postback + $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + + // Auto postback check box list + $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", ""); + $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + + // Databind to an integer-indexed array + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='item 1']", ""); + $this->verifyTextPresent("Your selection is: (Index: 0, Value: item 1, Text: item 1)", ""); + + // Databind to an associative array: + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", ""); + $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + + // Databind with DataTextField and DataValueField specified + $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", ""); + $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + + // RadioButton list causing validation + $this->verifyNotVisible('ctl0_body_ctl8'); + $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl8'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", ""); + $this->verifyNotVisible('ctl0_body_ctl8'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php new file mode 100644 index 00000000..d6d5f2e3 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php @@ -0,0 +1,58 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a regular radiobutton + $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); + + // a radiobutton with customized value + $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); + + // an auto postback radiobutton + $this->verifyTextNotPresent("I'm clicked"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + $this->click("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); + $this->verifyTextPresent("I'm clicked"); + + // a radiobutton causing validation on a textbox + $this->verifyNotVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl3'); + $this->type("ctl0\$body\$TextBox", "test"); + $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); + $this->verifyNotVisible('ctl0_body_ctl3'); + + // a radiobutton validated by a required field validator + $this->verifyNotVisible('ctl0_body_ctl6'); + $this->click("//input[@type='submit' and @value='Submit']", ""); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl6'); + $this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyNotVisible('ctl0_body_ctl6'); + + // a radiobutton group + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is empty"); + $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']", ""); + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is 2"); + $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']", ""); + $this->click("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']", ""); + $this->clickAndWait("name=ctl0\$body\$ctl7", ""); + $this->verifyTextPresent("Your selection is 34"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/TableTestCase.php b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php new file mode 100644 index 00000000..e9bd63be --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/TableTestCase.php @@ -0,0 +1,20 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&notheme=true", ""); + + $this->verifyElementPresent("//table[@rules='all' and @border='1']"); + $this->verifyElementPresent("//table/caption[@align='bottom' and text()='This is table caption']"); + $this->verifyElementPresent("//th[text()='header cell 2']"); + $this->verifyElementPresent("//tr[@align='right']/td[text()='text']"); + $this->verifyElementPresent("//td[@align='center' and contains(text(),'cell 5')]"); + + $this->verifyElementPresent("//th[text()='Header 1']"); + $this->verifyElementPresent("//td[text()='Cell 1']"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php new file mode 100644 index 00000000..e1c76938 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php @@ -0,0 +1,93 @@ +open("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&notheme=true", ""); + + $this->verifyTitle("PRADO QuickStart Sample", ""); + + // a normal textbox + $this->type("ctl0\$body\$ctl0", "test"); + + // textbox with maxlength set + $this->verifyAttribute("ctl0\$body\$ctl1@size","4"); + $this->verifyAttribute("ctl0\$body\$ctl1@maxlength","6"); + $this->type("ctl0\$body\$ctl1", "textte"); + + // vCard textboxes + $this->verifyAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName"); + $this->type("ctl0\$body\$ctl2", "first"); + $this->verifyAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName"); + $this->type("ctl0\$body\$ctl3", "last"); + + // a disabled textbox + $this->verifyAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled"); + + // a read-only textbox + $this->verifyAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly"); + + // auto postback textbox, CausesValidation=false + $this->verifyValue("ctl0\$body\$ctl6", "change me"); + $this->typeAndWait("ctl0\$body\$ctl6", "change mes"); + $this->verifyValue("ctl0\$body\$ctl6", "text changed"); + + // auto postback textbox, CausesValidation=true + $this->verifyNotVisible('ctl0_body_ctl7'); + $this->type("ctl0\$body\$TextBox3", "test"); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl7'); + $this->typeAndWait("ctl0\$body\$TextBox3", "non test"); + $this->verifyNotVisible('ctl0_body_ctl7'); + + // submitting textbox with a button + $this->type("ctl0\$body\$TextBox1", "texttext"); + $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); + $this->verifyValue("ctl0\$body\$TextBox1", "You just entered 'texttext'."); + + // SafeText + $this->verifyText("ctl0_body_Output","test"); + $this->typeAndWait("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>"); + $this->verifyText("ctl0_body_Output","malicious code"); + + // password + $this->verifyAttribute("ctl0\$body\$ctl9@type","password"); + + // ------------------multiline textbox---------------------- + + // regular textbox + $this->type("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); + $this->type("ctl0\$body\$ctl11", "This is a multiline text box. +In HTML, it is displayed as a textarea. +End of message +"); + + // a disabled multiline textbox + $this->verifyAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled"); + + // a read-only multiline textbox + $this->verifyAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly"); + $this->verifyAttribute("ctl0\$body\$ctl13@wrap","off"); + + // auto postback textbox + $this->verifyValue("ctl0\$body\$ctl14", "change me"); + $this->typeAndWait("ctl0\$body\$ctl14", "change mes"); + $this->verifyValue("ctl0\$body\$ctl14", "text changed"); + $this->verifyValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); + $this->verifyValue("ctl0\$body\$ctl11", "This is a multiline text box. +In HTML, it is displayed as a textarea. +End of message +"); + + // textbox associated with a validator + $this->verifyNotVisible('ctl0_body_ctl15'); + $this->type("ctl0\$body\$MultiTextBox3", "demo"); + $this->pause(1000); + $this->verifyVisible('ctl0_body_ctl15'); + $this->typeAndWait("ctl0\$body\$MultiTextBox3", "non demo"); + $this->verifyNotVisible('ctl0_body_ctl15'); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php new file mode 100644 index 00000000..cad3dc0e --- /dev/null +++ b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php @@ -0,0 +1,34 @@ +open("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true", ""); + $this->verifyTitle("Hangman Game", ""); + $this->verifyTextPresent("Medium game; you are allowed 5 misses.", ""); + $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); + $this->verifyTextPresent("You must choose a difficulty level", ""); + $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); + $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='3']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); + $this->verifyTextPresent("Please make a guess", ""); + $this->verifyTextPresent("maximum of 3", ""); + $this->clickAndWait("link=B", ""); + $this->clickAndWait("link=F", ""); + $this->clickAndWait("link=Give up?", ""); + $this->verifyTextPresent("You Lose", ""); + $this->clickAndWait("link=Start Again", ""); + $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); + $this->verifyTextPresent("Please make a guess", ""); + $this->verifyTextPresent("maximum of 3", ""); + $this->clickAndWait("link=Give up?", ""); + $this->verifyTextPresent("You Lose", ""); + $this->clickAndWait("link=Start Again", ""); + $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='5']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); + $this->verifyTextPresent("maximum of 5", ""); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HelloWorldTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HelloWorldTestCase.php new file mode 100644 index 00000000..e3da5a72 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Fundamentals/HelloWorldTestCase.php @@ -0,0 +1,16 @@ +open("../../demos/quickstart/index.php?page=Fundamentals.Samples.HelloWorld.Home&notheme=true", ""); + $this->verifyTitle("Hello World", ""); + $this->clickAndWait("//input[@type='submit' and @value='Click Me']", ""); + $this->clickAndWait("//input[@type='submit' and @value='Hello World']", ""); + $this->verifyTitle("Hello World", ""); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Advanced/I18N.php b/tests/FunctionalTests/quickstart_tests/Advanced/I18N.php deleted file mode 100644 index fc45b096..00000000 --- a/tests/FunctionalTests/quickstart_tests/Advanced/I18N.php +++ /dev/null @@ -1,54 +0,0 @@ -open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=en&notheme=true", ""); - $this->verifyTitle("Internationlization in PRADO", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("$12.40", ""); - $this->verifyTextPresent("€100.00", ""); - $this->verifyTextPresent("December 6, 2004", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh&notheme=true", ""); - $this->verifyTitle("PRADO 国际化", ""); - $this->verifyTextPresent("2004 十二月", ""); - $this->verifyTextPresent("US$ 12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00 ", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh_TW&notheme=true", ""); - $this->verifyTitle("PRADO 國際化", ""); - $this->verifyTextPresent("2004年12月6日", ""); - $this->verifyTextPresent("US$12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=de&notheme=true", ""); - $this->verifyTitle("Internationalisierung in PRADO", ""); - $this->verifyTextPresent("6. Dezember 2004 ", ""); - $this->verifyTextPresent("$ 12,40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=es&notheme=true", ""); - $this->verifyTitle("Internationlization en PRADO", ""); - $this->verifyTextPresent("6 de diciembre de 2004", ""); - $this->verifyTextPresent("US$12.40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=fr&notheme=true", ""); - $this->verifyTitle("Internationalisation dans PRADO", ""); - $this->verifyTextPresent("6 décembre 2004", ""); - $this->verifyTextPresent("12,40 $", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - $this->open("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=pl&notheme=true", ""); - $this->verifyTitle("Internacjonalizacja w PRADO", ""); - $this->verifyTextPresent("6 grudnia 2004", ""); - $this->verifyTextPresent("US$ 12,40", ""); - $this->verifyTextPresent("46.412,42 €", ""); - $this->verifyTextPresent("€100.00", ""); - - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/ButtonTestCase.php deleted file mode 100644 index 032f5ff1..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/ButtonTestCase.php +++ /dev/null @@ -1,35 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TButton.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // a regular button - $this->clickAndWait("//input[@type='submit' and @value='text']", ""); - - // a click button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); - $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); - $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); - - // a command button - $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); - $this->clickAndWait("//input[@type='submit' and @value='click me']", ""); - $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); - - // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@type='submit' and @value='submit']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@type='submit' and @value='submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php deleted file mode 100644 index 783e2ccc..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxListTestCase.php +++ /dev/null @@ -1,54 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBoxList.Home&notheme=true", ""); - - // Check box list with default settings: - $this->click("//input[@name='ctl0\$body\$ctl0\$0' and @value='value 1']", ""); - - // Check box list with customized cellpadding, cellspacing, color and text alignment: - $this->click("//input[@name='ctl0\$body\$ctl1\$1' and @value='value 2']", ""); - - // *** Currently unable to test the following cases: - // Check box list with vertical (default) repeat direction - // Check box list with horizontal repeat direction - // Check box list with flow layout and vertical (default) repeat direction - // Check box list with flow layout and horizontal repeat direction: - - // Check box list's behavior upon postback - $this->click("//input[@name='ctl0\$body\$CheckBoxList\$2' and @value='value 3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", ""); - - // Auto postback check box list - $this->clickAndWait("//input[@name='ctl0\$body\$ctl7\$1' and @value='value 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); - - // Databind to an integer-indexed array - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList1\$1' and @value='item 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: item 2, Text: item 2)", ""); - - // Databind to an associative array: - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList2\$1' and @value='key 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); - - // Databind with DataTextField and DataValueField specified - $this->clickAndWait("//input[@name='ctl0\$body\$DBCheckBoxList3\$2' and @value='003']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); - - // CheckBox list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->click("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl9$0' and @value='Agree']", ""); - $this->verifyNotVisible('ctl0_body_ctl8'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php deleted file mode 100644 index a24ce937..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/CheckBoxTestCase.php +++ /dev/null @@ -1,55 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TCheckBox.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // a regular checkbox - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); - - // a checkbox with customized value - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); - - // an auto postback checkbox - $this->verifyTextNotPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - - // a checkbox causing validation on a textbox - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); - - // a checkbox validated by a required field validator - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("//input[@type='submit' and @value='Submit']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl6'); - $this->click("//input[@name='ctl0\$body\$CheckBox' and @value='ctl0\$body\$CheckBox']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); - - // a checkbox validated by a required field validator using AutoPostBack - $this->verifyNotVisible('ctl0_body_ctl7'); - $this->click("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl7'); - $this->clickAndWait("//input[@name='ctl0\$body\$CheckBox2' and @value='ctl0\$body\$CheckBox2']", ""); - $this->verifyNotVisible('ctl0_body_ctl7'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/DropDownListTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/DropDownListTestCase.php deleted file mode 100644 index cfb2047b..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/DropDownListTestCase.php +++ /dev/null @@ -1,67 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TDropDownList.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // dropdown list with default settings - $this->verifyElementPresent("ctl0\$body\$ctl0"); - - // dropdown list with initial options - $this->verifySelectOptions("ctl0\$body\$ctl1","item 1,item 2,item 3,item 4"); - $this->verifySelected("ctl0\$body\$ctl1","value=value 2"); - - // dropdown list with customized styles - $this->verifySelectOptions("ctl0\$body\$ctl2","item 1,item 2,item 3,item 4"); - $this->verifySelected("ctl0\$body\$ctl2","value=value 2"); - - // a disabled dropdown list - $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); - - // an auto postback dropdown list - $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - - // a single selection list box upon postback - $this->select("ctl0\$body\$DropDownList1", "label=item 4"); - $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - - // Databind to an integer-indexed array - $this->selectAndWait("ctl0\$body\$DBDropDownList1", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: item 3, Text: item 3)", ""); - - // Databind to an associative array - $this->selectAndWait("ctl0\$body\$DBDropDownList2", "label=item 2"); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); - - // Databind with DataTextField and DataValueField specified - $this->selectAndWait("ctl0\$body\$DBDropDownList3", "label=Cary"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); - - // dropdown list is being validated - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("id=ctl0_body_ctl7", ""); - $this->verifyVisible('ctl0_body_ctl6'); - $this->select("ctl0\$body\$VDropDownList1", "label=item 2"); - $this->clickAndWait("id=ctl0_body_ctl7", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); - - // dropdown list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->select("ctl0\$body\$VDropDownList2", "label=Disagree"); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->selectAndWait("ctl0\$body\$VDropDownList2", "label=Agree"); - $this->verifyNotVisible('ctl0_body_ctl8'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php deleted file mode 100644 index b0b964f8..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php +++ /dev/null @@ -1,17 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&notheme=true", ""); - $this->verifyTitle("PRADO QuickStart Sample", ""); - $this->verifyElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); - $this->verifyTextPresent("Welcome to", ""); - $this->verifyTextPresent("Body contents", ""); - $this->verifyElementPresent("//a[img/@alt='Hello World']"); - $this->verifyElementPresent("//a[contains(text(),'Body contents')]"); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/ImageButtonTestCase.php deleted file mode 100644 index cc0bda53..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/ImageButtonTestCase.php +++ /dev/null @@ -1,30 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TImageButton.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // a click button - $this->clickAndWait("//input[@type='image' and @alt='hello world']", ""); - $this->verifyTextPresent("You clicked at ",""); - - // a command button - $this->clickAndWait("ctl0\$body\$ctl1", ""); - $this->verifyTextPresent("Command name: test, Command parameter: value",""); - - // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl2'); - $this->click("id=ctl0_body_ctl3", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl2'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("id=ctl0_body_ctl3", ""); - $this->verifyNotVisible('ctl0_body_ctl2'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php deleted file mode 100644 index a0ad6d6b..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php +++ /dev/null @@ -1,20 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']"); - $this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']"); - $this->verifyTextPresent("Hello World! Hello World! Hello World!", ""); - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']"); - //$this->verifyElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]"); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php deleted file mode 100644 index aa045e0c..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php +++ /dev/null @@ -1,23 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&notheme=true", ""); - $this->verifyTitle("PRADO QuickStart Sample", ""); - $this->verifyTextPresent("This is a label with customized color and font.", ""); - $this->verifyTextPresent("This is a form label associated with the TTextBox control below", ""); - $this->verifyTextPresent("This is a label with empty Text property and nonempty body", ""); - $this->verifyTextPresent("This is a disabled label", ""); - - $this->verifyAttribute("ctl0_body_Label2@disabled","regexp:true|disabled"); - - //$this->verifyAttribute("ctl0_body_Label1@for","ctl0_body_test"); - - $this->type("ctl0\$body\$test", "test"); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/LinkButtonTestCase.php deleted file mode 100644 index 49c3c61a..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/LinkButtonTestCase.php +++ /dev/null @@ -1,34 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TLinkButton.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // regular buttons - $this->clickAndWait("link=link button", ""); - $this->clickAndWait("//a[contains(text(),'body content')]", ""); - - // a click button - $this->clickAndWait("link=click me", ""); - $this->clickAndWait("link=I'm clicked", ""); - - // a command button - $this->clickAndWait("link=click me", ""); - $this->clickAndWait("//a[contains(text(),'Name: test, Param: value')]", ""); - - // a button causing validation - $this->verifyNotVisible('ctl0_body_ctl4'); - $this->click("link=submit", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl4'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("link=submit", ""); - $this->verifyNotVisible('ctl0_body_ctl4'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/ListBoxTestCase.php deleted file mode 100644 index 6f86719a..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/ListBoxTestCase.php +++ /dev/null @@ -1,84 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TListBox.Home&notheme=true", ""); - - // a default single selection listbox - $this->verifyAttribute("ctl0\$body\$ctl0@size","4"); - - // single selection list box with initial options - $this->verifySelectOptions("ctl0\$body\$ctl1","item 1,item 2,item 3,item 4"); - $this->verifySelected("ctl0\$body\$ctl1","value=value 2"); - - // a single selection list box with customized style - $this->verifyAttribute("ctl0\$body\$ctl2@size","3"); - $this->verifySelectOptions("ctl0\$body\$ctl2","item 1,item 2,item 3,item 4"); - $this->verifySelected("ctl0\$body\$ctl2","value=value 2"); - - // a disabled list box - $this->verifyAttribute("ctl0\$body\$ctl3@disabled","regexp:true|disabled"); - - // an auto postback single selection list box - $this->verifyTextNotPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - $this->selectAndWait("ctl0\$body\$ctl4", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - - // a single selection list box upon postback - $this->select("ctl0\$body\$ListBox1", "label=item 4"); - $this->verifyTextNotPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 3, Value: value 4, Text: item 4)", ""); - - // a multiple selection list box - $this->verifyAttribute("ctl0\$body\$ctl6[]@size","4"); - $this->verifyAttribute("ctl0\$body\$ctl6[]@multiple","regexp:true|multiple"); - - // a multiple selection list box with initial options - $this->verifyAttribute("ctl0\$body\$ctl7[]@multiple","regexp:true|multiple"); - $this->verifySelectOptions("ctl0\$body\$ctl7[]","item 1,item 2,item 3,item 4"); - - // multiselection list box's behavior upon postback - $this->select("ctl0\$body\$ListBox2[]", "label=item 3"); - $this->clickAndWait("name=ctl0\$body\$ctl8", ""); - $this->verifyText("ctl0_body_MultiSelectionResult2","Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)"); - - // Auto postback multiselection list box - $this->selectAndWait("ctl0\$body\$ctl9[]", "label=item 1"); - $this->verifyText("ctl0_body_MultiSelectionResult","Your selection is: (Index: 0, Value: value 1, Text: item 1)(Index: 1, Value: value 2, Text: item 2)(Index: 3, Value: value 4, Text: item 4)"); - - // Databind to an integer-indexed array - $this->selectAndWait("ctl0\$body\$DBListBox1[]", "label=item 3"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: item 3, Text: item 3)", ""); - - // Databind to an associative array - $this->selectAndWait("ctl0\$body\$DBListBox2[]", "label=item 2"); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); - - // Databind with DataTextField and DataValueField specified - $this->selectAndWait("ctl0\$body\$DBListBox3[]", "label=Cary"); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); - - // List box is being validated - $this->verifyNotVisible('ctl0_body_ctl10'); - $this->click("id=ctl0_body_ctl11", ""); - $this->verifyVisible('ctl0_body_ctl10'); - $this->select("ctl0\$body\$VListBox1", "label=item 2"); - $this->clickAndWait("id=ctl0_body_ctl11", ""); - $this->verifyNotVisible('ctl0_body_ctl10'); - - // List box causing validation - $this->verifyNotVisible('ctl0_body_ctl12'); - $this->select("ctl0\$body\$VListBox2", "label=Agree"); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl12'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->selectAndWait("ctl0\$body\$VListBox2", "label=Disagree"); - $this->verifyNotVisible('ctl0_body_ctl12'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php deleted file mode 100644 index 32134512..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php +++ /dev/null @@ -1,18 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&notheme=true", ""); - $this->verifyTextPresent("This is panel content with", ""); - $this->verifyElementPresent("//span[text()='label']"); - $this->verifyTextPresent("grouping text", ""); - $this->click("//input[@name='ctl0\$body\$ctl17' and @value='ctl0\$body\$ctl17']", ""); - $this->verifyTextNotPresent("You have clicked on 'button2'."); - $this->clickAndWait("//input[@type='submit' and @value='button2']", ""); - $this->verifyTextPresent("You have clicked on 'button2'."); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php deleted file mode 100644 index b6242d05..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonListTestCase.php +++ /dev/null @@ -1,54 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&notheme=true", ""); - - // RadioButton list with default settings: - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", ""); - - // RadioButton list with customized cellpadding, cellspacing, color and text alignment: - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", ""); - - // *** Currently unable to test the following cases: - // RadioButton list with vertical (default) repeat direction - // RadioButton list with horizontal repeat direction - // RadioButton list with flow layout and vertical (default) repeat direction - // RadioButton list with flow layout and horizontal repeat direction: - - // RadioButton list's behavior upon postback - $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); - - // Auto postback check box list - $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", ""); - $this->verifyTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); - - // Databind to an integer-indexed array - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='item 1']", ""); - $this->verifyTextPresent("Your selection is: (Index: 0, Value: item 1, Text: item 1)", ""); - - // Databind to an associative array: - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", ""); - $this->verifyTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); - - // Databind with DataTextField and DataValueField specified - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", ""); - $this->verifyTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); - - // RadioButton list causing validation - $this->verifyNotVisible('ctl0_body_ctl8'); - $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl8'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", ""); - $this->verifyNotVisible('ctl0_body_ctl8'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php deleted file mode 100644 index d6d5f2e3..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/RadioButtonTestCase.php +++ /dev/null @@ -1,58 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButton.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // a regular radiobutton - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='ctl0\$body\$ctl0']", ""); - - // a radiobutton with customized value - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value']", ""); - - // an auto postback radiobutton - $this->verifyTextNotPresent("I'm clicked"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - $this->click("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']", ""); - $this->verifyTextPresent("I'm clicked"); - - // a radiobutton causing validation on a textbox - $this->verifyNotVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->click("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl3'); - $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']", ""); - $this->verifyNotVisible('ctl0_body_ctl3'); - - // a radiobutton validated by a required field validator - $this->verifyNotVisible('ctl0_body_ctl6'); - $this->click("//input[@type='submit' and @value='Submit']", ""); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl6'); - $this->click("//input[@name='ctl0\$body\$RadioButton' and @value='ctl0\$body\$RadioButton']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyNotVisible('ctl0_body_ctl6'); - - // a radiobutton group - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is empty"); - $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']", ""); - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is 2"); - $this->click("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']", ""); - $this->click("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']", ""); - $this->clickAndWait("name=ctl0\$body\$ctl7", ""); - $this->verifyTextPresent("Your selection is 34"); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php deleted file mode 100644 index e9bd63be..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php +++ /dev/null @@ -1,20 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home&notheme=true", ""); - - $this->verifyElementPresent("//table[@rules='all' and @border='1']"); - $this->verifyElementPresent("//table/caption[@align='bottom' and text()='This is table caption']"); - $this->verifyElementPresent("//th[text()='header cell 2']"); - $this->verifyElementPresent("//tr[@align='right']/td[text()='text']"); - $this->verifyElementPresent("//td[@align='center' and contains(text(),'cell 5')]"); - - $this->verifyElementPresent("//th[text()='Header 1']"); - $this->verifyElementPresent("//td[text()='Cell 1']"); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php deleted file mode 100644 index e1c76938..00000000 --- a/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php +++ /dev/null @@ -1,93 +0,0 @@ -open("../../demos/quickstart/index.php?page=Controls.Samples.TTextBox.Home&notheme=true", ""); - - $this->verifyTitle("PRADO QuickStart Sample", ""); - - // a normal textbox - $this->type("ctl0\$body\$ctl0", "test"); - - // textbox with maxlength set - $this->verifyAttribute("ctl0\$body\$ctl1@size","4"); - $this->verifyAttribute("ctl0\$body\$ctl1@maxlength","6"); - $this->type("ctl0\$body\$ctl1", "textte"); - - // vCard textboxes - $this->verifyAttribute("ctl0\$body\$ctl2@vcard_name","vCard.FirstName"); - $this->type("ctl0\$body\$ctl2", "first"); - $this->verifyAttribute("ctl0\$body\$ctl3@vcard_name","vCard.LastName"); - $this->type("ctl0\$body\$ctl3", "last"); - - // a disabled textbox - $this->verifyAttribute("ctl0\$body\$ctl4@disabled","regexp:true|disabled"); - - // a read-only textbox - $this->verifyAttribute("ctl0\$body\$ctl5@readonly","regexp:true|readonly"); - - // auto postback textbox, CausesValidation=false - $this->verifyValue("ctl0\$body\$ctl6", "change me"); - $this->typeAndWait("ctl0\$body\$ctl6", "change mes"); - $this->verifyValue("ctl0\$body\$ctl6", "text changed"); - - // auto postback textbox, CausesValidation=true - $this->verifyNotVisible('ctl0_body_ctl7'); - $this->type("ctl0\$body\$TextBox3", "test"); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl7'); - $this->typeAndWait("ctl0\$body\$TextBox3", "non test"); - $this->verifyNotVisible('ctl0_body_ctl7'); - - // submitting textbox with a button - $this->type("ctl0\$body\$TextBox1", "texttext"); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->verifyValue("ctl0\$body\$TextBox1", "You just entered 'texttext'."); - - // SafeText - $this->verifyText("ctl0_body_Output","test"); - $this->typeAndWait("ctl0\$body\$TextBox2","<a href=javascript:xxx>malicious code</a>"); - $this->verifyText("ctl0_body_Output","malicious code"); - - // password - $this->verifyAttribute("ctl0\$body\$ctl9@type","password"); - - // ------------------multiline textbox---------------------- - - // regular textbox - $this->type("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); - $this->type("ctl0\$body\$ctl11", "This is a multiline text box. -In HTML, it is displayed as a textarea. -End of message -"); - - // a disabled multiline textbox - $this->verifyAttribute("ctl0\$body\$ctl12@disabled","regexp:true|disabled"); - - // a read-only multiline textbox - $this->verifyAttribute("ctl0\$body\$ctl13@readonly","regexp:true|readonly"); - $this->verifyAttribute("ctl0\$body\$ctl13@wrap","off"); - - // auto postback textbox - $this->verifyValue("ctl0\$body\$ctl14", "change me"); - $this->typeAndWait("ctl0\$body\$ctl14", "change mes"); - $this->verifyValue("ctl0\$body\$ctl14", "text changed"); - $this->verifyValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); - $this->verifyValue("ctl0\$body\$ctl11", "This is a multiline text box. -In HTML, it is displayed as a textarea. -End of message -"); - - // textbox associated with a validator - $this->verifyNotVisible('ctl0_body_ctl15'); - $this->type("ctl0\$body\$MultiTextBox3", "demo"); - $this->pause(1000); - $this->verifyVisible('ctl0_body_ctl15'); - $this->typeAndWait("ctl0\$body\$MultiTextBox3", "non demo"); - $this->verifyNotVisible('ctl0_body_ctl15'); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart_tests/Fundamentals/HangmanTestCase.php deleted file mode 100644 index cad3dc0e..00000000 --- a/tests/FunctionalTests/quickstart_tests/Fundamentals/HangmanTestCase.php +++ /dev/null @@ -1,34 +0,0 @@ -open("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true", ""); - $this->verifyTitle("Hangman Game", ""); - $this->verifyTextPresent("Medium game; you are allowed 5 misses.", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("You must choose a difficulty level", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("Please make a guess", ""); - $this->verifyTextPresent("maximum of 3", ""); - $this->clickAndWait("link=B", ""); - $this->clickAndWait("link=F", ""); - $this->clickAndWait("link=Give up?", ""); - $this->verifyTextPresent("You Lose", ""); - $this->clickAndWait("link=Start Again", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("Please make a guess", ""); - $this->verifyTextPresent("maximum of 3", ""); - $this->clickAndWait("link=Give up?", ""); - $this->verifyTextPresent("You Lose", ""); - $this->clickAndWait("link=Start Again", ""); - $this->click("//input[@name='ctl0\$body\$LevelSelection' and @value='5']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Play!']", ""); - $this->verifyTextPresent("maximum of 5", ""); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/quickstart_tests/Fundamentals/HelloWorldTestCase.php b/tests/FunctionalTests/quickstart_tests/Fundamentals/HelloWorldTestCase.php deleted file mode 100644 index e3da5a72..00000000 --- a/tests/FunctionalTests/quickstart_tests/Fundamentals/HelloWorldTestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -open("../../demos/quickstart/index.php?page=Fundamentals.Samples.HelloWorld.Home&notheme=true", ""); - $this->verifyTitle("Hello World", ""); - $this->clickAndWait("//input[@type='submit' and @value='Click Me']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Hello World']", ""); - $this->verifyTitle("Hello World", ""); - } -} - -?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets.php b/tests/FunctionalTests/tickets.php new file mode 100644 index 00000000..a2ea99d2 --- /dev/null +++ b/tests/FunctionalTests/tickets.php @@ -0,0 +1,39 @@ +get_directories(dirname(__FILE__).'/tickets/tests', $groups); + + return $groups; + } + + protected function get_directories($base,&$groups) + { + $groups[] = realpath($base); + $dirs = new DirectoryIterator($base); + foreach($dirs as $dir) + if(!$dir->isDot() && $dir->isDir() + && !preg_match("/\.svn/", $dir->getPathName())) + $this->get_directories($dir->getPathName(), $groups); + } +} + + +$root = dirname(__FILE__); +$server = SimpleSeleniumProxyServer::getInstance($root); + +$tester = new PradoSimpleTester(new BrowserTestConfig()); +$browser_tests = $tester->getTests(); +$browser_tests->run(new SimpleReporter()); + +$server->handleRequest(); + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/application.xml b/tests/FunctionalTests/tickets/application.xml new file mode 100644 index 00000000..e973d37d --- /dev/null +++ b/tests/FunctionalTests/tickets/application.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/index.php b/tests/FunctionalTests/tickets/index.php new file mode 100644 index 00000000..fe127639 --- /dev/null +++ b/tests/FunctionalTests/tickets/index.php @@ -0,0 +1,8 @@ +run(); + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.php b/tests/FunctionalTests/tickets/protected/pages/Layout.php new file mode 100644 index 00000000..64b0aebe --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Layout.php @@ -0,0 +1,14 @@ +getPage())); + $this->getPage()->setTitle("Verifying Ticket $num"); + $this->ticketlink->setText("Verifying Ticket $num"); + $this->ticketlink->setNavigateUrl("http://trac.pradosoft.com/ticket/{$num}"); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Layout.tpl b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl new file mode 100644 index 00000000..bf2f8fab --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Layout.tpl @@ -0,0 +1,45 @@ + + + + + + + + + +

+ + +
+ +
+
+ + Validate XHTML 1.0 + +View Source +
+ + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket21.page b/tests/FunctionalTests/tickets/protected/pages/Ticket21.page new file mode 100644 index 00000000..e0619ea1 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket21.page @@ -0,0 +1,10 @@ + +

TRadioButton always postback if AutoPostBack=true

+ + +
+ + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket21.php b/tests/FunctionalTests/tickets/protected/pages/Ticket21.php new file mode 100644 index 00000000..041ba4b7 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket21.php @@ -0,0 +1,22 @@ +IsPostBack) + $this->setViewState("clicks", 0); + } + + public function doClick($sender, $param) + { + $clicks = $this->getViewState("clicks"); + $clicks++; + $this->label1->setText("Radio button clicks: $clicks"); + $this->setViewState("clicks", $clicks); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket27.page b/tests/FunctionalTests/tickets/protected/pages/Ticket27.page new file mode 100644 index 00000000..f92511c7 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket27.page @@ -0,0 +1,17 @@ + +

TCheckBoxList demo js error on IE

+ + + + + + + + + +
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/config.xml b/tests/FunctionalTests/tickets/protected/pages/config.xml new file mode 100644 index 00000000..83bb5791 --- /dev/null +++ b/tests/FunctionalTests/tickets/protected/pages/config.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php new file mode 100644 index 00000000..d9677779 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php @@ -0,0 +1,16 @@ +open('tickets/index.php?page=Ticket21'); + $this->assertTitle("Verifying Ticket 21"); + $this->clickAndWait("ctl0_Content_button1"); + $this->verifyTextPresent("Radio button clicks: 1", ""); + $this->click("ctl0_Content_button1"); + $this->verifyTextPresent("Radio button clicks: 1", ""); + } +} + +?> \ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php new file mode 100644 index 00000000..6a5ccdb9 --- /dev/null +++ b/tests/FunctionalTests/tickets/tests/Ticket27TestCase.php @@ -0,0 +1,18 @@ +open('tickets/index.php?page=Ticket27'); + $this->verifyTitle("Verifying Ticket 27", ""); + $this->click("//input[@value='Agree']", ""); + $this->assertVisible("ctl0_Content_validator1", ""); + $this->type("ctl0_Content_TextBox", "122"); + $this->assertNotVisible("ctl0_Content_validator1", ""); + $this->clickAndWait("//input[@value='Disagree']", ""); + $this->assertNotVisible("ctl0_Content_validator1", ""); + } +} + +?> \ No newline at end of file -- cgit v1.2.3