From 68bbb645ba5be61c2e3024ac3943c7346b30f1f2 Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Tue, 25 Mar 2014 22:41:33 +0100 Subject: More selenium2 tests porting --- .../ActiveRatingListTestCase.php | 6 +-- .../features/protected/pages/RatingList.php | 0 .../quickstart/Controls/TextBoxTestCase.php | 14 +++---- .../tickets/protected/pages/Ticket290.page | 9 ++--- .../tickets/protected/pages/Ticket586.page | 1 - .../tickets/protected/pages/Ticket719.page | 3 +- .../tickets/protected/pages/ToggleTest.page | 0 .../tickets/protected/pages/ToggleTest.php | 0 .../tickets/tests/Ticket205TestCase.php | 13 +++++-- .../tickets/tests/Ticket578TestCase.php | 7 +++- .../tickets/tests/Ticket587TestCase.php | 1 - .../tickets/tests/Ticket622TestCase.php | 7 ++-- .../tickets/tests/Ticket719TestCase.php | 17 +++++---- .../tickets/tests/Ticket823TestCase.php | 2 +- .../tickets/tests/Ticket876TestCase.php | 4 +- tests/test_tools/PradoGenericSelenium2Test.php | 44 +++++----------------- 16 files changed, 57 insertions(+), 71 deletions(-) mode change 100644 => 100755 tests/FunctionalTests/features/protected/pages/RatingList.php mode change 100644 => 100755 tests/FunctionalTests/tickets/protected/pages/ToggleTest.page mode change 100644 => 100755 tests/FunctionalTests/tickets/protected/pages/ToggleTest.php mode change 100644 => 100755 tests/test_tools/PradoGenericSelenium2Test.php diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php index 6b2f6f97..2b9a0166 100755 --- a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php +++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php @@ -207,7 +207,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $this->assertElementPresent("//input[@id='{$base}RatingList_c4']/../../../td[contains(@class, 'rating')]"); $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); - $this->mouseOver("//input[@id='{$base}RatingList_c4']/../.."); + $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c4']/../..")); $this->assertText("{$base}Status", "Excellent"); $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_hover')]"); $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_hover')]"); @@ -217,7 +217,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[not(contains(@class, 'rating_hover'))]"); $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); - $this->mouseOut("//input[@id='{$base}RatingList_c4']/../.."); + $this->moveto($this->byCssSelector('body')); $this->assertText("{$base}Status", "CaptionID='Status'"); $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); @@ -228,7 +228,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $this->assertElementPresent("//input[@id='{$base}RatingList_c5']/../../../td[contains(@class, 'rating')]"); - $this->mouseOver("//input[@id='{$base}RatingList_c1']/../.."); + $this->moveto($this->byXPath("//input[@id='{$base}RatingList_c1']/../..")); $this->assertText("{$base}Status", "Fair"); $this->byXPath("//input[@id='{$base}RatingList_c1']/../..")->click(); diff --git a/tests/FunctionalTests/features/protected/pages/RatingList.php b/tests/FunctionalTests/features/protected/pages/RatingList.php old mode 100644 new mode 100755 diff --git a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php index 52095321..3865e33d 100755 --- a/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/TextBoxTestCase.php @@ -30,15 +30,15 @@ class QuickstartTextBoxTestCase extends PradoGenericSelenium2Test // auto postback textbox, CausesValidation=false $this->assertValue("ctl0\$body\$ctl6", "change me"); - $this->type("ctl0\$body\$ctl6", "change mes"); + $this->typeSpecial("ctl0\$body\$ctl6", "change mes"); $this->assertValue("ctl0\$body\$ctl6", "text changed"); // auto postback textbox, CausesValidation=true $this->assertNotVisible('ctl0_body_ctl7'); - $this->type("ctl0\$body\$TextBox3", "test"); + $this->typeSpecial("ctl0\$body\$TextBox3", "test"); // $this->pause(1000); $this->assertVisible('ctl0_body_ctl7'); - $this->type("ctl0\$body\$TextBox3", "non test"); + $this->typeSpecial("ctl0\$body\$TextBox3", "non test"); $this->assertNotVisible('ctl0_body_ctl7'); // submitting textbox with a button @@ -48,7 +48,7 @@ class QuickstartTextBoxTestCase extends PradoGenericSelenium2Test // SafeText $this->assertText("ctl0_body_Output","test"); - $this->type("ctl0\$body\$TextBox2","malicious code"); + $this->typeSpecial("ctl0\$body\$TextBox2","malicious code"); $this->assertText("ctl0_body_Output","malicious code"); // password @@ -72,7 +72,7 @@ End of message // auto postback textbox $this->assertValue("ctl0\$body\$ctl14", "change me"); - $this->type("ctl0\$body\$ctl14", "change mes"); + $this->typeSpecial("ctl0\$body\$ctl14", "change mes"); $this->assertValue("ctl0\$body\$ctl14", "text changed"); $this->assertValue("ctl0\$body\$ctl10", "This is a\nmultiline\ntextbox."); $this->assertValue("ctl0\$body\$ctl11", "This is a multiline text box. @@ -82,10 +82,10 @@ End of message // textbox associated with a validator $this->assertNotVisible('ctl0_body_ctl15'); - $this->type("ctl0\$body\$MultiTextBox3", "demo"); + $this->typeSpecial("ctl0\$body\$MultiTextBox3", "demo"); // $this->pause(1000); $this->assertVisible('ctl0_body_ctl15'); - $this->type("ctl0\$body\$MultiTextBox3", "non demo"); + $this->typeSpecial("ctl0\$body\$MultiTextBox3", "non demo"); $this->assertNotVisible('ctl0_body_ctl15'); } } 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 @@ -

Needs manual testing

- + - - - 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 @@ -

Needs manual testing

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 @@ -

Needs manual testing