diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-03-25 22:41:33 +0100 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2014-08-21 17:32:09 +0200 |
commit | 94e34ad61868dc6a28de6f1a708d63ae0b6b4cf9 (patch) | |
tree | 79c298bb04c06c2d3673ceec9f8ae81968be5295 /tests/FunctionalTests/tickets | |
parent | 2f2a18b9ccf154543ca02e9c189f23cc2862017d (diff) |
More selenium2 tests porting
(cherry picked from commit 68bbb645ba5be61c2e3024ac3943c7346b30f1f2)
Conflicts:
tests/FunctionalTests/tickets/tests/Ticket587TestCase.php
tests/FunctionalTests/tickets/tests/Ticket719TestCase.php
Diffstat (limited to 'tests/FunctionalTests/tickets')
12 files changed, 37 insertions, 27 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page index e9d40b92..3d4bf647 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket290.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket290.page @@ -1,18 +1,17 @@ <com:TContent ID="Content"> - <h3>Needs manual testing</h3> <com:TPanel ID="panel1" DefaultButton="button2" Style="border:1px solid #ccc; padding:2em"> <com:TTextBox ID="textbox1" /> - + <com:TCustomValidator ControlToValidate="textbox1" OnServerValidate="customValidate" ValidationGroup="group1" ErrorMessage="required" /> - - <com:TButton ID="button1" Text="Button 1" + + <com:TButton ID="button1" Text="Button 1" ValidationGroup="group1" OnClick="button_clicked" /> - <com:TButton ID="button2" Text="Button 2 (default)" + <com:TButton ID="button2" Text="Button 2 (default)" ValidationGroup="group1" OnClick="button_clicked" /> <com:TLabel ID="label1" Text="Label 1" /> diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page index 29751cab..31bc7237 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket586.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket586.page @@ -1,5 +1,4 @@ <com:TContent ID="Content">
-<h3>Needs manual testing</h3>
<com:TPanel DefaultButton="button2" Style="border:1px solid #ccc; padding:2em;">
<com:TTextBox ID="text1" />
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page index b36d2d66..3f2bc17b 100755 --- a/tests/FunctionalTests/tickets/protected/pages/Ticket719.page +++ b/tests/FunctionalTests/tickets/protected/pages/Ticket719.page @@ -1,5 +1,4 @@ <com:TContent id="Content"> -<h3>Needs manual testing</h3> <style> .autocomplete { @@ -45,7 +44,7 @@ ul.different OnSuggest="suggestCountries" Separator=", " OnSuggestionSelected="suggestion_selected" ResultPanel.CssClass="autocomplete" CausesValidation="false" /> - + </p> <p> <com:TButton OnClick="validForm" Text="Validate Form" /><br/> diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page index 0d633657..0d633657 100644..100755 --- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page +++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.page diff --git a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php index 31cf0851..31cf0851 100644..100755 --- a/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php +++ b/tests/FunctionalTests/tickets/protected/pages/ToggleTest.php diff --git a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php index 57b0c95b..35274e6f 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php @@ -7,7 +7,9 @@ class Ticket205TestCase extends PradoGenericSelenium2Test $base = 'ctl0_Content_'; $this->url("tickets/index.php?page=Ticket205"); $this->assertEquals($this->title(), "Verifying Ticket 205"); - $this->assertNotVisible("{$base}validator1"); + + $validator=$this->byId("{$base}validator1"); + $this->assertFalse($validator->displayed()); $this->type("{$base}textbox1", "test"); $this->byId("{$base}button1")->click(); @@ -15,10 +17,13 @@ class Ticket205TestCase extends PradoGenericSelenium2Test $this->assertEquals("error", $this->alertText()); $this->acceptAlert(); - $this->assertVisible("{$base}validator1"); + $this->assertTrue($validator->displayed()); + + // type() calls clear() that triggers a focus change and thus a second alert + $this->typeSpecial("{$base}textbox1", "Prado"); - $this->type("{$base}textbox1", "Prado"); $this->byId("{$base}button1")->click(); - $this->assertNotVisible("{$base}validator1"); + $validator=$this->byId("{$base}validator1"); + $this->assertFalse($validator->displayed()); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php index 3adb107c..948d8642 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket578TestCase.php @@ -14,7 +14,12 @@ class Ticket578TestCase extends PradoGenericSelenium2Test $this->assertText("{$base}label1", "Button 1 was clicked :"); $text="helloworld"; - $this->runScript("tinyMCE.get('{$base}text1').setContent('{$text}')"); + + $this->execute(array( + 'script' => "tinyMCE.get('{$base}text1').setContent('{$text}')", + 'args' => array() + )); + $this->byId("{$base}button1")->click(); $this->pause(800); $this->assertText("{$base}label1", "Button 1 was clicked : <p>{$text}</p>"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php index aa81a55e..cb42c343 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket587TestCase.php @@ -16,7 +16,6 @@ class Ticket587TestCase extends PradoGenericSelenium2Test $this->assertText($base."label1", "Selection 2: value 3 - item 4"); $this->type($base.'text1', 't'); - $this->runScript("Prado.Registry.get('{$base}text1').onKeyPress({})"); $this->pause(800); $this->select($base."list2", "asd 3 - item 2"); $this->pause(800); diff --git a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php index 672a1d18..b51f55d3 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket622TestCase.php @@ -10,8 +10,9 @@ class Ticket622TestCase extends PradoGenericSelenium2Test $this->byId($base.'ctl0')->click(); $this->pause(800); - $this->assertAttribute($base.'ALB@style',''); - $this->assertAttribute('css=span#acb span@style', ''); - $this->assertAttribute('css=span#arb span@style', ''); + + $this->assertEquals('', $this->byId($base.'ALB')->attribute('style')); + $this->assertEquals('', $this->byCssSelector('span#acb span')->attribute('style')); + $this->assertEquals('', $this->byCssSelector('span#arb span')->attribute('style')); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php index cc460ee7..46346ca1 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php @@ -14,18 +14,17 @@ class Ticket719TestCase extends PradoGenericSelenium2Test $this->assertVisible("${base}ctl0", 'Required'); $this->assertVisible("${base}ctl1", 'Required'); - $this->type("${base}autocomplete", 'f'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->byId("${base}autocomplete")->click(); + + $this->keys('f'); $this->pause(500); $this->assertContains('Finland', $this->source()); - $this->type("${base}autocomplete", 'fr'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->keys('r'); $this->pause(500); $this->assertContains('French', $this->source()); - $this->type("${base}autocomplete", 'fra'); - $this->runScript("Prado.Registry.get('${base}autocomplete').onKeyPress({})"); + $this->keys('a'); $this->pause(500); $this->assertContains('France', $this->source()); @@ -33,7 +32,11 @@ class Ticket719TestCase extends PradoGenericSelenium2Test $this->pause(800); $this->assertNotVisible("${base}ctl1"); - $this->type("${base}textbox", "Prado"); + $this->byId("${base}textbox")->clear(); + $this->byId("${base}textbox")->value('Prado'); + // trigger onblur() event + $this->byCssSelector('body')->click(); + $this->assertNotVisible("${base}ctl0"); $this->byId("${base}ctl2")->click(); diff --git a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php index 7b7a7759..163eb541 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket823TestCase.php @@ -6,7 +6,7 @@ class Ticket823TestCase extends PradoGenericSelenium2Test { $this->url('tickets/index.php?page=Ticket823'); $this->assertEquals($this->title(), "Verifying Ticket 823"); $base = 'ctl0_Content_'; - $this->assertElementPresent('xpath=//option[@value="Choose..."]'); + $this->assertElementPresent('//option[@value="Choose..."]'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php index 29d4d6c6..361235fc 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php @@ -7,9 +7,9 @@ class Ticket876TestCase extends PradoGenericSelenium2Test { $this->assertEquals($this->title(), "Verifying Ticket 876"); $base = 'ctl0_Content_'; - $this->assertElementPresent('xpath=//link[@rel="stylesheet"]'); + $this->assertElementPresent('//link[@rel="stylesheet"]'); $this->byId($base.'Button')->click(); - $this->assertElementNotPresent('xpath=//link[@rel="stylesheet"]'); + $this->assertElementNotPresent('//link[@rel="stylesheet"]'); /*$this->select($base.'Date_month', 10); $this->select($base.'Date_day', 22); |