From 1f63d5c05ba117e0158c02d5bc79fa1f38f8ce85 Mon Sep 17 00:00:00 2001 From: xue <> Date: Thu, 27 Apr 2006 13:13:17 +0000 Subject: merge from 3.0 branch till 978. --- .../features/protected/controls/Layout.tpl | 5 ++ .../features/protected/pages/ValidatorEffects.page | 91 ++++++++++++++++++++++ .../quickstart/Controls/ExpressionTestCase.php | 15 ++++ .../quickstart/Controls/HtmlAreaTestCase.php | 15 ++++ .../quickstart/Controls/MultiViewTestCase.php | 38 +++++++++ .../quickstart/Controls/StatementsTestCase.php | 15 ++++ .../quickstart/Controls/Wizard1TestCase.php | 26 +++++++ .../quickstart/Controls/Wizard2TestCase.php | 26 +++++++ .../quickstart/Controls/Wizard3TestCase.php | 46 +++++++++++ .../quickstart/Controls/Wizard4TestCase.php | 44 +++++++++++ .../quickstart/Controls/Wizard5TestCase.php | 37 +++++++++ 11 files changed, 358 insertions(+) create mode 100644 tests/FunctionalTests/features/protected/pages/ValidatorEffects.page create mode 100644 tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/HtmlAreaTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php create mode 100644 tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php (limited to 'tests') 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; + } /*]]>*/ 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 @@ + + +

Validator Visual Effects Test

+
+ Create New Account + + + +
+ Username: + + + + Effect.Shake(validator.control); + Effect.Appear(validator.message); + + + Effect.Fade(validator.message); + + +
+
+ Password + + + +
+
+ +
+ +
+ + +
+ Sign In + +
+ Login Name: + + + +
+ +
+ Password: + + +
+ + + + +
+ +
+ +
+ + +
\ 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 @@ +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 @@ +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 @@ +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 @@ +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 @@ +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 @@ +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 @@ +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 @@ +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 @@ +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 -- cgit v1.2.3