From 94e54d3023ed89281f89125f3ad0553afb9312cb Mon Sep 17 00:00:00 2001 From: Fabio Bas Date: Wed, 5 Mar 2014 23:02:18 +0100 Subject: Started cleaning tests' selenium2 compatibility layer (cherry picked from commit 4ce02f6973aa40c313364b5ff7990f2244309790) Conflicts: tests/FunctionalTests/tickets/tests/Ticket220TestCase.php tests/FunctionalTests/tickets/tests/Ticket719TestCase.php tests/FunctionalTests/tickets/tests/Ticket769TestCase.php tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php tests/FunctionalTests/validators/tests/DatePickerTestCase.php --- .../Controls/RadioButtonListTestCase.php | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php') diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php index a9092225..6242cebe 100755 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php @@ -8,10 +8,10 @@ class QuickstartRadioButtonListTestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRadioButtonList.Home&notheme=true&lang=en"); // RadioButton list with default settings: - $this->click("//input[@name='ctl0\$body\$ctl0' and @value='value 3']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl0' and @value='value 3']")->click(); // RadioButton list with customized cellpadding, cellspacing, color and text alignment: - $this->click("//input[@name='ctl0\$body\$ctl1' and @value='value 1']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value 1']")->click(); // *** Currently unable to test the following cases: // RadioButton list with vertical (default) repeat direction @@ -20,33 +20,33 @@ class QuickstartRadioButtonListTestCase extends PradoGenericSelenium2Test // RadioButton list with flow layout and horizontal repeat direction: // RadioButton list's behavior upon postback - $this->click("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']", ""); - $this->clickAndWait("//input[@type='submit' and @value='Submit']", ""); - $this->assertTextPresent("Your selection is: (Index: 2, Value: value 3, Text: item 3)", ""); + $this->byXPath("//input[@name='ctl0\$body\$RadioButtonList' and @value='value 3']")->click(); + $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); // Auto postback check box list - $this->clickAndWait("//input[@name='ctl0\$body\$ctl7' and @value='value 5']", ""); - $this->assertTextPresent("Your selection is: (Index: 4, Value: value 5, Text: item 5)", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl7' and @value='value 5']")->click(); + $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source()); // Databind to an integer-indexed array - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']", ""); - $this->assertTextPresent("Your selection is: (Index: 0, Value: 0, Text: item 1)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList1' and @value='0']")->click(); + $this->assertContains("Your selection is: (Index: 0, Value: 0, Text: item 1)", $this->source()); // Databind to an associative array: - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']", ""); - $this->assertTextPresent("Your selection is: (Index: 1, Value: key 2, Text: item 2)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList2' and @value='key 2']")->click(); + $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified - $this->clickAndWait("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']", ""); - $this->assertTextPresent("Your selection is: (Index: 2, Value: 003, Text: Cary)", ""); + $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']")->click(); + $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // RadioButton list causing validation $this->assertNotVisible('ctl0_body_ctl8'); - $this->click("//input[@name='ctl0\$body\$ctl9' and @value='Agree']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Agree']")->click(); // $this->pause(1000); $this->assertVisible('ctl0_body_ctl8'); $this->type("ctl0\$body\$TextBox", "test"); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl9' and @value='Disagree']")->click(); $this->assertNotVisible('ctl0_body_ctl8'); } } -- cgit v1.2.3