diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-10 15:29:09 +0100 |
---|---|---|
committer | Fabio Bas <ctrlaltca@gmail.com> | 2014-02-10 15:29:09 +0100 |
commit | 031d20c405b922808f4bdf2997f964880b33ab66 (patch) | |
tree | 7fbda08ea61c9948db6b6fd1dd6db9a13370da4e | |
parent | f35d43399a9ce03f08ffa326812bc5ed6764ef9e (diff) |
More tests porting
13 files changed, 53 insertions, 54 deletions
diff --git a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page index 4124e59e..e2378ed5 100644 --- a/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page +++ b/demos/quickstart/protected/pages/GettingStarted/Upgrading32.page @@ -200,6 +200,11 @@ Porting prado to jQuery some method signatures has changed, or have been adapted <br/>// or, better, use <a href="http://modernizr.com/">Modernizr</a> </td> </tr> + <tr> + <td>Get a PRADO object from an object ID</td> + <td>Prado.Registry.get('id')</td> + <td>Prado.Registry.['id']</td> + </tr> </table> <h2>Specific controls changes</h2> diff --git a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page index 28f27b8f..54e6e39c 100755 --- a/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page +++ b/tests/FunctionalTests/active-controls/protected/pages/CustomValidatorByPass.page @@ -2,7 +2,7 @@ <h1>Custom Login</h1>
-<a id="showLogin" href="#" onclick="new Effect.Appear('loginBox')">Login</a>
+<a id="showLogin" href="#" onclick="$('#loginBox').fadeIn()">Login</a>
<div id="loginBox" style="display: none;">
<div style="height:1em">
@@ -29,7 +29,7 @@ <br />
<com:TActiveLinkButton ID="checkLogin" OnCallback="doLogin" Text="Login" ValidationGroup="login" />
- <a href="#" onclick="new Effect.Fade('loginBox')">Close</a>
+ <a href="#" onclick="$('#loginBox').fadeOut()">Close</a>
</div>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page index e4c8fa95..fec54092 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket220.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket220.page @@ -1,30 +1,26 @@ <com:TContent ID="Content"> <h1>ClientScript Test</h1> - + <com:TClientScript ScriptUrl=<%~ test.js %>> if(typeof(ClientScriptInfo) == "undefined") ClientScriptInfo = []; ClientScriptInfo.push("ok 3?") </com:TClientScript> - + <com:TClientScript> if(typeof(ClientScriptInfo) == "undefined") ClientScriptInfo = []; ClientScriptInfo.push("ok 2!") </com:TClientScript> - + <com:TLabel ID="label1" Text="Label 1" /> <input type="button" id="button1" value="update" /> - + <com:TClientScript PradoScripts="prado"> - Event.observe("button1", "click", function() + $('#button1').click(function() { - element = $("<%= $this->label1->ClientID %>"); - if(element) - element.innerHTML = "Label 1: "+inspect(ClientScriptInfo); - else - alert("failed"); + $("#<%= $this->label1->ClientID %>").html('Label 1: ' + ClientScriptInfo.join('; ')); }); </com:TClientScript> - + </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page index e7341bcc..8afaff22 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket278.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket278.page @@ -21,7 +21,7 @@ OnPreRender="validate2_onPostValidate"
ErrorMessage="Text 2 is required">
<prop:ClientSide.OnValidate>
- sender.enabled = $("<%= $this->check1->ClientID %>").checked;
+ sender.enabled = $("#<%= $this->check1->ClientID %>").get(0).checked;
</prop:ClientSide.OnValidate>
</com:TRequiredFieldValidator>
@@ -30,13 +30,11 @@ <com:TButton ID="button1" Text="Submit!" />
<com:TClientScript>
- Event.OnLoad(function()
- {
- Event.observe("<%= $this->check1->ClientID %>", "click", function(ev)
- {
- $("<%= $this->panel1->ClientID %>").toggle();
+ jQuery( document ).ready(function() {
+ jQuery("#<%= $this->check1->ClientID %>").click(function() {
+ $("#<%= $this->panel1->ClientID %>").toggle();
+ });
});
- });
</com:TClientScript>
</com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page index 767a9c3a..535997d1 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket504.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket504.page @@ -9,48 +9,48 @@ <com:TCallbackOptions ID="LoadDataOptions">
<prop:ClientSide.OnSuccess>
- $('status').innerHTML = sender.ActiveControl.CallbackParameter + " updated";
+ $('#status').html(sender.options.CallbackParameter + " updated");
</prop:ClientSide.OnSuccess>
<prop:ClientSide.OnLoading>
- $('loading').show();
+ $('#loading').show();
</prop:ClientSide.OnLoading>
<prop:ClientSide.OnComplete>
- $('loading').hide();
+ $('#loading').hide();
</prop:ClientSide.OnComplete>
</com:TCallbackOptions>
-
-<com:TActiveLinkButton
+
+<com:TActiveLinkButton
Text="Tab A"
ID="linka"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelA"
- />
+ />
<com:TActiveLinkButton
Text="Tab B"
ID="linkb"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelB"
- />
+ />
<com:TActiveLinkButton
Text="Tab C"
ID="linkc"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelC"
- />
+ />
<com:TActiveLinkButton
Text="Tab D"
ID="linkd"
OnCallback="changePanel"
ActiveControl.CallbackOptions="LoadDataOptions"
ActiveControl.CallbackParameter="panelD"
- />
+ />
<com:TActivePanel ID="panelA">
<h1>Panel A</h1>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page index 9c02df4e..58cff91c 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket585.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket585.page @@ -5,12 +5,12 @@ ID="validator1"
ControlToValidate="test"
OnServerValidate="ChkDate"
- ErrorMessage="*">
+ ErrorMessage="*">
<prop:ClientSide
- OnValidationError="$('error').innerHTML='Error'"
- OnValidationSuccess="$('error').innerHTML='Success'"
+ OnValidationError="$('#error').html('Error')"
+ OnValidationSuccess="$('#error').html('Success')"
ObserveChanges="false"
-
+
/>
</com:TActiveCustomValidator>
<span id="error"></span>
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page index e5c4d8f7..ce55715d 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket691.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket691.page @@ -3,7 +3,7 @@ <com:TCallbackOptions ID="RatingOption"> <prop:ClientSide.OnComplete> - $('<%=$this->Title->ClientID%>').innerHTML = 'Thanks'; + $('#<%=$this->Title->ClientID%>').html('Thanks'); </prop:ClientSide.OnComplete> </com:TCallbackOptions> <com:TActiveLabel ID="Title" Text="Cast your vote:" /> @@ -16,7 +16,7 @@ <com:TListItem Value="5" Text="Five stars" /> <com:TListItem Value="6" Text="Six stars" /> </com:TActiveRatingList> -<com:TActiveLabel ID="Result"/> +<com:TActiveLabel ID="Result"/> </com:TContent>
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php index da5e8c15..120e7bd0 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php @@ -8,9 +8,9 @@ class Ticket220TestCase extends PradoGenericSeleniumTest $this->open('tickets/index.php?page=Ticket220'); $this->assertTextPresent('ClientScript Test'); $this->assertText("{$base}label1", "Label 1"); - + $this->click("button1"); - $this->assertText("{$base}label1", 'exact:Label 1: ["ok", "ok 3?", "ok 2!"]'); + $this->assertText("{$base}label1", 'exact:Label 1: ok; ok 3?; ok 2!'); $this->assertAlertNotPresent(); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php index d5064c1e..7fa37bad 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php @@ -16,7 +16,7 @@ class Ticket587TestCase extends PradoGenericSeleniumTest $this->assertText($base."label1", "Selection 2: value 3 - item 4"); $this->type($base.'text1', 't'); - $this->runScript("Prado.Registry.get('{$base}text1').onKeyPress({})"); + $this->runScript("Prado.Registry['{$base}text1'].onKeyPress({})"); $this->pause(800); $this->select($base."list2", "asd 3 - item 2"); $this->pause(800); diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php index c71cb0a8..4205427b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php @@ -6,36 +6,36 @@ class Ticket719TestCase extends PradoGenericSeleniumTest { $this->open("tickets/index.php?page=Ticket719"); $this->verifyTextPresent("Verifying Ticket 719"); - + $base="ctl0_Content_"; - + $this->click("${base}ctl2"); $this->pause(800); $this->assertVisible("${base}ctl0", 'Required'); $this->assertVisible("${base}ctl1", 'Required'); - + $this->type("${base}autocomplete", 'f'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->runScript("Prado.Registry['${base}autocomplete'].onKeyPress({})"); $this->pause(500); $this->verifyTextPresent('Finland'); $this->type("${base}autocomplete", 'fr'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->runScript("Prado.Registry['${base}autocomplete'].onKeyPress({})"); $this->pause(500); $this->verifyTextPresent('French'); $this->type("${base}autocomplete", 'fra'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->runScript("Prado.Registry['${base}autocomplete'].onKeyPress({})"); $this->pause(500); $this->verifyTextPresent('France'); - + $this->click("css=#${base}autocomplete_result ul li"); $this->pause(800); $this->assertNotVisible("${base}ctl1"); $this->type("${base}textbox", "Prado"); $this->assertNotVisible("${base}ctl0"); - + $this->click("${base}ctl2"); $this->pause(800); $this->assertText("${base}Result", "TextBox Content : Prado -- Autocomplete Content :France"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php index 468342a5..74ca48da 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket769TestCase.php @@ -7,22 +7,22 @@ class Ticket769TestCase extends PradoGenericSeleniumTest $base="ctl0_Content_"; $this->open('tickets/index.php?page=Ticket769'); $this->assertTitle("Verifying Ticket 769"); - + $this->click($base.'ctl0'); $this->assertVisible($base.'ctl1'); - + $this->type($base.'T1', 'Prado'); $this->click($base.'ctl0'); $this->pause(800); $this->assertNotVisible($base.'ctl1'); $this->verifyTextPresent($base.'ctl0', 'T1 clicked' ); - + $this->click($base.'ctl2'); $this->pause(800); $this->verifyTextPresent($base.'B', 'This is B'); $this->click($base.'ctl3'); $this->pause(800); - + $this->type($base.'T1', ''); $this->click($base.'ctl0'); $this->assertVisible($base.'ctl1'); @@ -31,6 +31,6 @@ class Ticket769TestCase extends PradoGenericSeleniumTest $this->pause(800); $this->assertNotVisible($base.'ctl1'); $this->verifyTextPresent($base.'ctl0', 'T1 clicked clicked' ); - + } }
\ No newline at end of file diff --git a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page index 2d0d490b..47238e48 100755 --- a/tests/FunctionalTests/validators/protected/pages/CustomValidator.page +++ b/tests/FunctionalTests/validators/protected/pages/CustomValidator.page @@ -2,7 +2,7 @@ <h1>Prado CustomValidator Tests</h1>
<script type="text/javascript">
-var MyCustomValidator =
+var MyCustomValidator =
{
validate : function(sender, value)
{
@@ -17,7 +17,7 @@ var MyCustomValidator = ControlToValidate="text1"
ErrorMessage="Enter 'Prado'"
ControlCssClass="required"
- ClientValidationFunction="MyCustomValidator.validate"
+ ClientValidationFunction="MyCustomValidator.validate"
OnServerValidate="CustomValidation"
/>
<com:TButton ID="submit1" Text="Test" />
diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index 8ee278f8..50c73384 100755 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -17,7 +17,7 @@ class RequiredFieldTestCase extends PradoGenericSeleniumTest $this->assertNotVisible("{$base}validator1"); $this->click("{$base}submit2"); $this->assertNotVisible("{$base}validator1"); - $this->assertNotVisible("{$base}validator2"); + $this->assertVisible("{$base}validator2"); $this->assertVisible("{$base}validator3"); $this->assertVisible("{$base}validator4"); $this->type("{$base}text2", "testing2"); |