summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets
diff options
context:
space:
mode:
authorFabio Bas <ctrlaltca@gmail.com>2014-03-25 22:41:33 +0100
committerFabio Bas <ctrlaltca@gmail.com>2014-03-25 22:41:40 +0100
commit68bbb645ba5be61c2e3024ac3943c7346b30f1f2 (patch)
tree0626fcf6341c30465f2b1dcc03db2a65d6939f84 /tests/FunctionalTests/tickets
parent4e15c84379b99434515c119b72a6c8afcbf917dd (diff)
More selenium2 tests porting
Diffstat (limited to 'tests/FunctionalTests/tickets')
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket290.page9
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket586.page1
-rwxr-xr-xtests/FunctionalTests/tickets/protected/pages/Ticket719.page3
-rwxr-xr-x[-rw-r--r--]tests/FunctionalTests/tickets/protected/pages/ToggleTest.page0
-rwxr-xr-x[-rw-r--r--]tests/FunctionalTests/tickets/protected/pages/ToggleTest.php0
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket205TestCase.php13
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket578TestCase.php7
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket587TestCase.php1
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket622TestCase.php7
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket719TestCase.php17
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket823TestCase.php2
-rwxr-xr-xtests/FunctionalTests/tickets/tests/Ticket876TestCase.php4
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 98492ffb..98492ffb 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 bc2c34bc..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['{$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 633820d2..7c4a1d67 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['${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['${base}autocomplete'].onKeyPress({})");
+ $this->keys('r');
$this->pause(500);
$this->assertContains('French', $this->source());
- $this->type("${base}autocomplete", 'fra');
- $this->runScript("Prado.Registry['${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);