diff options
author | xue <> | 2006-04-27 13:13:17 +0000 |
---|---|---|
committer | xue <> | 2006-04-27 13:13:17 +0000 |
commit | 1f63d5c05ba117e0158c02d5bc79fa1f38f8ce85 (patch) | |
tree | a583561d32abb2e7ee400d8532d34d1acae96157 /tests | |
parent | 8ab196ce6c2d5de323bdd8ebcc11a73814c0cdca (diff) |
merge from 3.0 branch till 978.
Diffstat (limited to 'tests')
11 files changed, 358 insertions, 0 deletions
diff --git a/tests/FunctionalTests/features/protected/controls/Layout.tpl b/tests/FunctionalTests/features/protected/controls/Layout.tpl index d1b33d94..dbd433b8 100644 --- a/tests/FunctionalTests/features/protected/controls/Layout.tpl +++ b/tests/FunctionalTests/features/protected/controls/Layout.tpl @@ -16,6 +16,11 @@ margin-top: 2em;
display: block;
}
+ .required
+ {
+ border:1px solid red;
+ background-color: #fdd;
+ }
/*]]>*/
</style>
</com:THead>
diff --git a/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page new file mode 100644 index 00000000..47d99969 --- /dev/null +++ b/tests/FunctionalTests/features/protected/pages/ValidatorEffects.page @@ -0,0 +1,91 @@ +<com:TContent ID="Content">
+
+<h1>Validator Visual Effects Test</h1>
+<fieldset id="quickRegistration">
+ <legend>Create New Account</legend>
+
+<com:TClientScript UsingPradoScripts="effects" />
+
+<div class="username">
+ Username:
+ <com:TTextBox ID="Username" />
+ <com:TRequiredFieldValidator
+ ID="UsernameVal"
+ ControlToValidate="Username"
+ ValidationGroup="registration"
+ ControlCssClass="required"
+ Display="Dynamic"
+ ErrorMessage="a username is required.">
+ <prop:ClientValidation.OnError>
+ Effect.Shake(validator.control);
+ Effect.Appear(validator.message);
+ </prop:ClientValidation.OnError>
+ <prop:ClientValidation.OnSuccess>
+ Effect.Fade(validator.message);
+ </prop:ClientValidation.OnSuccess>
+ </com:TRequiredFieldValidator>
+</div>
+<div class="password">
+ Password
+ <com:TTextBox ID="Password" TextMode="Password" />
+ <!-- alternate synatx : see
+ http://encytemedia.com/blog/articles/2006/03/07/prototype-gets-some-serious-syntactic-sugar
+ -->
+<com:TRequiredFieldValidator
+ ID="PasswordVal"
+ ControlToValidate="Password"
+ ValidationGroup="registration"
+ ControlCssClass="required"
+ Display="Dynamic"
+ ClientValidation.OnError="validator.message.visualEffect('appear')"
+ ClientValidation.OnSuccess="validator.message.visualEffect('fade')"
+ ErrorMessage="a password is required." />
+</div>
+<div class="create">
+ <com:TButton ID="Create" ValidationGroup="registration" Text="Create New Account"/>
+</div>
+
+</fieldset>
+
+
+<fieldset id="LoginForm">
+ <legend>Sign In</legend>
+
+<div class="username">
+ Login Name:
+ <com:TTextBox ID="UserID" />
+
+ <com:TRequiredFieldValidator
+ ID="UserVal1"
+ ControlToValidate="UserID"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the username or email was not provided" />
+</div>
+
+<div class="password" >
+ Password:
+ <com:TTextBox ID="Pass" TextMode="Password" />
+ <com:TRequiredFieldValidator
+ ID="loginValidator3"
+ ControlToValidate="Pass"
+ Display="None"
+ ValidationGroup="signin"
+ ErrorMessage="the password was not provided" />
+</div>
+
+
+<com:TButton ID="login" ValidationGroup="signin" CssClass="button" Text="Sign In" />
+
+<div class="validation">
+ <com:TValidationSummary
+ ID="summary2"
+ ValidationGroup="signin"
+ AutoUpdate="false"
+ HeaderText="<p>You could not login because</p>" />
+</div>
+
+</fieldset>
+
+
+</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php new file mode 100644 index 00000000..dfa1036f --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php @@ -0,0 +1,15 @@ +<?php
+
+class ExpressionTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TExpression.Home&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ $this->verifyTextPresent('PRADO QuickStart Sample');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php new file mode 100644 index 00000000..212ff6b9 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php @@ -0,0 +1,15 @@ +<?php
+
+class HtmlAreaTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.THtmlArea.Home&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // can't perform any test
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php new file mode 100644 index 00000000..c94a325c --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php @@ -0,0 +1,38 @@ +<?php
+
+class MultiViewTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TMultiView.Home&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // view 1 : type in a string
+ $this->verifyNotVisible('ctl0_body_Result1');
+ $this->verifyNotVisible('ctl0_body_Result2');
+ $this->type('ctl0_body_Memo','test');
+ $this->clickAndWait('ctl0$body$ctl1');
+
+ // view 3 : check if the output is updated
+ $this->verifyTextPresent('Your text input is: test');
+ $this->verifyTextPresent('Your color choice is: Red');
+ $this->clickAndWait('ctl0$body$ctl7');
+
+ // view 2 : update dropdownlist
+ $this->verifyNotVisible('ctl0_body_Result1');
+ $this->verifyNotVisible('ctl0_body_Result2');
+ $this->select('ctl0$body$DropDownList', "label=Blue");
+ $this->clickAndWait('ctl0$body$ctl4');
+
+ // view 3 : check if the output is updated
+ $this->verifyTextPresent('Your text input is: test');
+ $this->verifyTextPresent('Your color choice is: Blue');
+ $this->clickAndWait('ctl0$body$ctl7');
+
+ // view 2 : check if dropdownlist maintains state
+ $this->verifySelected('ctl0$body$DropDownList', "label=Blue");
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php new file mode 100644 index 00000000..93844296 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php @@ -0,0 +1,15 @@ +<?php
+
+class StatementsTestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TStatements.Home&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ $this->verifyTextPresent('UniqueID is \'ctl0$body$ctl0\'');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php new file mode 100644 index 00000000..ea071612 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php @@ -0,0 +1,26 @@ +<?php
+
+class Wizard1TestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample1&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // step 1
+ $this->verifyTextPresent('Wizard Step 1');
+ $this->verifyTextNotPresent('Wizard Step 2');
+ $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0$body$Wizard1$DropDownList1', "label=Purple");
+ $this->clickAndWait('ctl0$body$Wizard1$ctl8$ctl1');
+
+ // step 2
+ $this->verifyTextPresent('Your favorite color is: Purple');
+ $this->verifyTextNotPresent('Wizard Step 1');
+ $this->verifyTextPresent('Wizard Step 2');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php new file mode 100644 index 00000000..ca94bb19 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php @@ -0,0 +1,26 @@ +<?php
+
+class Wizard2TestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample2&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // step 1
+ $this->verifyTextPresent('Please let us know your preference');
+ $this->verifyTextNotPresent('Thank you for your answer');
+ $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0$body$Wizard1$DropDownList1', "label=Blue");
+ $this->clickAndWait('ctl0$body$Wizard1$ctl8$ctl1');
+
+ // step 2
+ $this->verifyTextPresent('Your favorite color is: Blue');
+ $this->verifyTextNotPresent('Please let us know your preference');
+ $this->verifyTextPresent('Thank you for your answer');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php new file mode 100644 index 00000000..807e7dc6 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php @@ -0,0 +1,46 @@ +<?php
+
+class Wizard3TestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // step 1
+ $this->verifyTextPresent('A Mini Survey');
+ $this->verifyTextPresent('PRADO QuickStart Sample');
+ $this->click('ctl0_body_Wizard3_StudentCheckBox');
+ $this->clickAndWait('ctl0$body$Wizard3$ctl8$ctl0');
+
+ // step 2
+ $this->select('ctl0$body$Wizard3$DropDownList11', "label=Chemistry");
+ $this->clickAndWait('ctl0$body$Wizard3$ctl9$ctl1');
+
+ // step 3
+ $this->select('ctl0$body$Wizard3$DropDownList22', "label=Tennis");
+ $this->clickAndWait('ctl0$body$Wizard3$ctl10$ctl1');
+
+ // step 4
+ $this->verifyTextPresent('You are a college student');
+ $this->verifyTextPresent('You are in major: Chemistry');
+ $this->verifyTextPresent('Your favorite sport is: Tennis');
+
+ // run the example again. this time we skip the page asking about major
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true", "");
+
+ // step 1
+ $this->clickAndWait('ctl0$body$Wizard3$ctl8$ctl0');
+
+ // step 3
+ $this->select('ctl0$body$Wizard3$DropDownList22', "label=Baseball");
+ $this->clickAndWait('ctl0$body$Wizard3$ctl10$ctl1');
+
+ // step 4
+ $this->verifyTextNotPresent('You are a college student');
+ $this->verifyTextPresent('Your favorite sport is: Baseball');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php new file mode 100644 index 00000000..41fd7dd2 --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php @@ -0,0 +1,44 @@ +<?php
+
+class Wizard4TestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample4&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // step 1
+ $this->verifyTextPresent('Step 1 of 3');
+ $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan");
+ $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton');
+
+ // step 3
+ $this->verifyTextPresent('Step 3 of 3');
+ $this->verifyTextPresent('Thank you for completing this survey.');
+ $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+
+ // step 1
+ $this->verifySelected('ctl0_body_Wizard1_DropDownList1', "label=Cyan");
+ $this->select('ctl0_body_Wizard1_DropDownList1', "label=Black");
+ $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0');
+
+ // step 2
+ $this->verifyTextPresent('Step 2 of 3');
+ $this->verifyTextPresent('Your favorite color is: Black');
+ $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl0');
+
+ // step 1
+ $this->verifyTextPresent('Step 1 of 3');
+ $this->verifySelected('ctl0_body_Wizard1_DropDownList1', "label=Black");
+ $this->clickAndWait('ctl0_body_Wizard1_ctl4_ctl0');
+
+ // step 2
+ $this->clickAndWait('ctl0_body_Wizard1_ctl5_ctl1');
+
+ // step 3
+ $this->verifyTextPresent('Step 3 of 3');
+ }
+}
+
+?>
\ No newline at end of file diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php new file mode 100644 index 00000000..e25ce86d --- /dev/null +++ b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php @@ -0,0 +1,37 @@ +<?php
+
+class Wizard5TestCase extends SeleniumTestCase
+{
+ function test ()
+ {
+ $this->open("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample5&notheme=true", "");
+
+ $this->verifyTitle("PRADO QuickStart Sample", "");
+
+ // step 1
+ $this->verifyTextPresent('Please let us know your preference');
+ $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton');
+ $this->verifyVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton');
+ $this->verifyAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled');
+ $this->select('ctl0_body_Wizard1_DropDownList1', "label=Cyan");
+ $this->clickAndWait('ctl0$body$Wizard1$ctl6$ctl0');
+
+ // step 2
+ $this->select('ctl0_body_Wizard1_Step2_DropDownList2','label=Football');
+ $this->clickAndWait('ctl0$body$Wizard1$ctl8$ctl0');
+
+ // step 1
+ $this->verifySelected('ctl0_body_Wizard1_DropDownList1','label=Cyan');
+ $this->clickAndWait('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton');
+
+ // step 2
+ $this->verifySelected('ctl0_body_Wizard1_Step2_DropDownList2','label=Football');
+ $this->clickAndWait('ctl0$body$Wizard1$ctl8$ctl1');
+
+ // step 3
+ $this->verifyTextPresent('Your favorite color is: Cyan');
+ $this->verifyTextPresent('Your favorite sport is: Football');
+ }
+}
+
+?>
\ No newline at end of file |