diff options
Diffstat (limited to 'tests/FunctionalTests/quickstart_tests/Controls')
6 files changed, 88 insertions, 5 deletions
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php index 5ebd2bf3..70801f0e 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/HyperLinkTestCase.php @@ -4,7 +4,7 @@ class HyperLinkTestCase extends SeleniumTestCase {
function test ()
{
- $this->open("../../demos/quickstart/?page=Controls.Samples.THyperLink.Home", "");
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home", "");
$this->verifyTitle("PRADO QuickStart Sample", "");
$this->verifyAttribute("//a[@href=\"http://www.pradosoft.com/\"]/@target","_blank");
$this->verifyTextPresent("Welcome to", "");
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php index ebd7f7d9..cccee6c7 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/ImageTestCase.php @@ -5,7 +5,7 @@ class ImageTestCase extends SeleniumTestCase {
function test ()
{
- $this->open("../../demos/quickstart/?page=Controls.Samples.TImage.Home", "");
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TImage.Home", "");
$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!']");
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php index 40ff3eb2..087965ac 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/LabelTestCase.php @@ -11,7 +11,6 @@ class LabelTestCase extends SeleniumTestCase $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->verifyElementPresent("//span[@style='color:yellow;background-color:blue;font-size:14pt;font-family:Arial;']");
$this->verifyElementPresent("//span[@disabled='disabled']");
$this->verifyElementPresent("//label[@for=\"ctl0_body_test\"]");
$this->type("ctl0\$body\$test", "test");
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php index f5f5ccfd..6fb3918b 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/PanelTestCase.php @@ -4,7 +4,7 @@ class PanelTestCase extends SeleniumTestCase {
function test ()
{
- $this->open("../../demos/quickstart/?page=Controls.Samples.TPanel.Home", "");
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home", "");
$this->verifyTextPresent("This is panel content with", "");
$this->verifyElementPresent("//span[text()='label']");
$this->verifyTextPresent("grouping text", "");
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php index 56ae8db9..abaabcf3 100644 --- a/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php +++ b/tests/FunctionalTests/quickstart_tests/Controls/TableTestCase.php @@ -4,7 +4,7 @@ class TableTestCase extends SeleniumTestCase {
function test ()
{
- $this->open("../../demos/quickstart/?page=Controls.Samples.TTable.Home", "");
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TTable.Home", "");
$this->verifyElementPresent("//table[@cellpadding='2' and @cellspacing='0' and @rules='all' and @border='1']");
$this->verifyElementPresent("//table/caption[@align='bottom' and text()='This is table caption']");
diff --git a/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php new file mode 100644 index 00000000..583d7583 --- /dev/null +++ b/tests/FunctionalTests/quickstart_tests/Controls/TextBoxTestCase.php @@ -0,0 +1,84 @@ +<?php
+
+class TextBoxTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/?page=Controls.Samples.TTextBox.Home", "");
+ // a read-only multiline textbox
+ $this->verifyAttribute("ctl0\$body\$ctl13@readonly","regexp:/(true|readonly)/");
+return;
+ $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","disabled");
+
+ // a read-only textbox
+ $this->verifyAttribute("ctl0\$body\$ctl5@readonly","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");
+
+ $this->type("ctl0\$body\$TextBox3", "tests");
+ $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
+ $this->clickAndWait("//input[@type='submit' and @value='Submit']", "");
+ $this->type("ctl0\$body\$ctl9", "test");
+ $this->type("ctl0\$body\$ctl10", "test
+test
+test");
+ $this->type("ctl0\$body\$ctl11", "This is a multiline text box.
+In HTML, it is displayed as a textarea.
+test ");
+ $this->typeAndWait("ctl0\$body\$ctl14", "change med");
+ $this->type("ctl0\$body\$MultiTextBox3", "test");
+ $this->verifyTextPresent("You must enter a value not equal to 'test'.", "");
+ $this->typeAndWait("ctl0\$body\$MultiTextBox3", "testd");
+
+
+ // a disabled multiline textbox
+ $this->verifyAttribute("ctl0\$body\$ctl12@disabled","disabled");
+
+ //$this->verifyElementPresent("//ctl0\$body\$ctl13[@readonly]");
+ $this->verifyAttribute("ctl0\$body\$ctl13@wrap","off");
+
+ }
+}
+
+?>
\ No newline at end of file |