diff options
author | wei <> | 2006-10-01 10:33:49 +0000 |
---|---|---|
committer | wei <> | 2006-10-01 10:33:49 +0000 |
commit | 6a96b55e56773c087b9aad8df22030517ce5022c (patch) | |
tree | c1fbc182d06dff6ea71167872cf93fcd76ccca38 | |
parent | dba2ca98d81aa4b205ac6b3a113ad4627f60c647 (diff) |
update functional test cases for opera
8 files changed, 58 insertions, 26 deletions
diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php index d9677779..394f8c95 100644 --- a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php @@ -4,6 +4,9 @@ class Ticket21TestCase extends SeleniumTestCase {
function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$this->open('tickets/index.php?page=Ticket21');
$this->assertTitle("Verifying Ticket 21");
$this->clickAndWait("ctl0_Content_button1");
diff --git a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php index 966e8383..e8c0f612 100644 --- a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php @@ -4,18 +4,21 @@ class Ticket225TestCase extends SeleniumTestCase { function test() { + //problem with test runner clicking on radio buttons + $this->skipBrowsers(self::OPERA); + $base="ctl0_Content_"; $this->open('tickets/index.php?page=Ticket225'); $this->assertTextPresent('RadioButton Group Tests'); $this->assertText("{$base}label1", "Label 1"); - + $this->assertNotVisible("{$base}validator1"); $this->click("{$base}button4"); $this->assertVisible("{$base}validator1"); - + $this->click("{$base}button2"); $this->clickAndWait("{$base}button4"); - + $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3'); $this->assertNotVisible("{$base}validator1"); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php index bd631c14..6e3666b9 100644 --- a/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket278TestCase.php @@ -4,47 +4,50 @@ class Ticket278TestCase extends SeleniumTestCase {
function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$base = 'ctl0_Content_';
$this->open('tickets/index.php?page=Ticket278');
$this->assertTitle('Verifying Ticket 278');
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertNotVisible($base.'panel1');
-
- $this->click($base.'button1');
+
+ $this->click($base.'button1');
$this->assertVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
-
+
$this->type($base.'text1', 'asd');
$this->clickAndWait($base.'button1');
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertNotVisible($base.'panel1');
-
+
$this->click($base.'check1');
$this->click($base.'button1');
$this->assertNotVisible($base.'validator1');
$this->assertVisible($base.'validator2');
$this->assertVisible($base.'panel1');
-
-
+
+
$this->type($base.'text1', '');
$this->type($base.'text2', 'asd');
$this->click($base.'button1');
$this->assertVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertVisible($base.'panel1');
-
-
+
+
$this->type($base.'text1', 'asd');
$this->clickAndWait($base.'button1');
$this->assertNotVisible($base.'validator1');
$this->assertNotVisible($base.'validator2');
$this->assertVisible($base.'panel1');
-
+
$this->type($base.'text1', '');
$this->type($base.'text2', '');
- $this->click($base.'button1');
+ $this->click($base.'button1');
$this->assertVisible($base.'validator1');
$this->assertVisible($base.'validator2');
$this->assertVisible($base.'panel1');
diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php index 6783572d..41c588ee 100644 --- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php +++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php @@ -4,6 +4,9 @@ class CheckBoxTestCase extends SeleniumTestCase {
function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$this->open('validators/index.php?page=CheckBox');
diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php index 76d84eff..37f35d1b 100644 --- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php +++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php @@ -7,6 +7,9 @@ class ListControlTestCase extends SeleniumTestCase {
function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$base = "ctl0_Content_";
$this->open("validators/index.php?page=ListControl", "");
$this->verifyTextPresent("List Control Required Field Validation Test", "");
diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index 41372b93..5ba23133 100644 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -1,9 +1,12 @@ <?php
-class RequiredFieldTestCase extends SeleniumTestCase
+class RequiredFieldTestCase extends SeleniumTestCase
{
function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$base = "ctl0_Content_";
$this->open("validators/index.php?page=RequiredFieldValidator");
$this->assertTextPresent("RequiredFieldValidator Tests");
@@ -45,11 +48,11 @@ class RequiredFieldTestCase extends SeleniumTestCase $this->assertVisible("{$base}validator2");
$this->click("{$base}check2");
$this->clickAndWait("{$base}submit2");
-
+
$this->type("{$base}text1", "Hello");
$this->click("{$base}check1");
$this->click("{$base}submit2");
-
+
$this->assertNotVisible("{$base}validator5");
$this->assertNotVisible("{$base}validator6");
$this->assertNotVisible("{$base}validator7");
@@ -67,9 +70,9 @@ class RequiredFieldTestCase extends SeleniumTestCase $this->assertNotVisible("{$base}validator5");
$this->assertNotVisible("{$base}validator6");
$this->assertNotVisible("{$base}validator7");
- $this->assertNotVisible("{$base}validator8");
+ $this->assertNotVisible("{$base}validator8");
}
-
+
function testInitialValue()
{
$base = "ctl0_Content_";
diff --git a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php index 23e0f045..9f652583 100644 --- a/tests/FunctionalTests/validators/tests/RequiredListTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredListTestCase.php @@ -5,6 +5,9 @@ class RequiredListTestCase extends SeleniumTestCase function test()
{
+ //problem with test runner clicking on radio buttons
+ $this->skipBrowsers(self::OPERA);
+
$base = "ctl0_Content_";
$this->open("validators/index.php?page=RequiredListValidator");
$this->click("{$base}submit1");
diff --git a/tests/test_tools/selenium/php/selenium.php b/tests/test_tools/selenium/php/selenium.php index 1142458f..c9d403f1 100644 --- a/tests/test_tools/selenium/php/selenium.php +++ b/tests/test_tools/selenium/php/selenium.php @@ -49,7 +49,7 @@ class SeleniumTestRunner if((php_sapi_name() == 'cli')) return; $file = dirname(__FILE__).'/TestRunner.php'; $driver = $this->driver; - + //$base_dir = $this->base_dir; $base_dir = $driver.'?sr='; include($file); @@ -130,20 +130,20 @@ class SeleneseInterpreter public function __call($func, $args) { if($func{0} == '_') return; - + $trace = debug_backtrace(); if($this->isTestOptionFunction($func,$args,$trace)) return; - + $ID = isset($args[0]) ? $args[0] : ""; $value = isset($args[1]) ? $args[1] : ""; if(strpos(strtolower($func),'htmlpresent') || strpos(strtolower($func),'htmlnotpresent')) $ID = htmlspecialchars($ID); $command = array($func, $ID, $value); - + if(is_int(strpos(strtolower($func), 'visible'))) $this->addCommand(array('pause','500',''),$trace); - + return $this->addCommand($command, $trace); } @@ -416,7 +416,7 @@ class SeleniumTestRunnerServer $case = $command[5]; $option=isset($options[$case])?$options[$case]:null; $this->cases[$case][] = - array('test' => $command[2], + array('test' => $command[2], 'trace' => $command[4], 'option'=>$option); if(is_null($this->name)) $this->name = $command[6]; @@ -528,7 +528,12 @@ class SeleniumTestCase extends UnitTestCase function skipBrowsers() { - $arg_list = func_get_args(); + $conditions = $this->getBrowserOptions(func_get_args()); + $this->selenium->skipCondition($conditions); + } + + protected function getBrowserOptions($arg_list) + { $browsers=array(); foreach($arg_list as $arg) { @@ -537,7 +542,13 @@ class SeleniumTestCase extends UnitTestCase else $browsers[] = $arg; } - $this->selenium->skipCondition(implode(' || ', $browsers)); + return implode(' || ', $browsers); + } + + function targetBrowsers() + { + $conditions = $this->getBrowserOptions(func_get_args()); + $this->selenium->skipCondition("!(".$conditions.")"); } } |