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 --- .../quickstart/Controls/DataGrid2TestCase.php | 40 +++++++++++----------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php') diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php index 15a4c510..548b04e3 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php @@ -7,43 +7,43 @@ class QuickstartDataGrid2TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample2&notheme=true&lang=en"); // verify if all required texts are present - $this->assertTextPresent('Book Title',''); - $this->assertTextPresent('Publisher',''); - $this->assertTextPresent('Price',''); - $this->assertTextPresent('In-stock',''); - $this->assertTextPresent('Rating',''); + $this->assertContains('Book Title', $this->source()); + $this->assertContains('Publisher', $this->source()); + $this->assertContains('Price', $this->source()); + $this->assertContains('In-stock', $this->source()); + $this->assertContains('Rating', $this->source()); // verify book titles $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",''); $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0321278658' and text()='Extreme Programming Explained : Embrace Change']",''); // verify publishers - $this->assertTextPresent("O'Reilly Media, Inc.",''); - $this->assertTextPresent("Addison-Wesley Professional",''); + $this->assertContains("O'Reilly Media, Inc.", $this->source()); + $this->assertContains("Addison-Wesley Professional", $this->source()); // verify prices - $this->assertTextPresent("\$37.49",''); - $this->assertTextPresent("\$38.49",''); + $this->assertContains("\$37.49", $this->source()); + $this->assertContains("\$38.49", $this->source()); // verify in-stock - $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); - $this->verifyAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked',null); - $this->verifyAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled'); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@disabled','regexp:true|disabled'); + $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked','regexp:true|checked'); + $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked',null); + $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@disabled','regexp:true|disabled'); // verify ratings //$this->assertElementPresent("//img[@src='images/star5.gif']",''); //$this->assertElementPresent("//img[@src='images/star2.gif']",''); // verify toggle column visibility - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", ""); - $this->assertTextNotPresent('Head First Design Patterns',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); + $this->assertNotContains('Head First Design Patterns', $this->source()); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); $this->assertElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']", ""); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); $this->assertElementPresent('ctl0_body_DataGrid_ctl1_ctl5',''); - $this->clickAndWait("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']", ""); - $this->assertTextPresent('Head First Design Patterns',''); + $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); + $this->assertContains('Head First Design Patterns', $this->source()); } } -- cgit v1.2.3