From bdfd9f07f17de1751a7e4d94940acb426af4be77 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 6 Aug 2015 18:12:45 +0200 Subject: Fix tests work around stale references by explicitly waiting --- .../quickstart/Controls/DataGrid3TestCase.php | 26 +++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php') diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php index e87b9072..32a05fb0 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid3TestCase.php @@ -7,50 +7,56 @@ class QuickstartDataGrid3TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample3&notheme=true&lang=en"); // verify the 2nd row of data - $this->assertContains("Design Patterns: Elements of Reusable Object-Oriented Software", $this->source()); - $this->assertContains("Addison-Wesley Professional", $this->source()); - $this->assertContains("$47.04", $this->source()); + $this->assertSourceContains("Design Patterns: Elements of Reusable Object-Oriented Software"); + $this->assertSourceContains("Addison-Wesley Professional"); + $this->assertSourceContains("$47.04"); $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@checked','regexp:true|checked'); $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); //$this->assertElementPresent("//img[@src='images/star5.gif']",''); // edit the 2nd row $this->byId("ctl0_body_DataGrid_ctl2_ctl7")->click(); + $this->pause(50); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl1", "Design Pattern: Elements of Reusable Object-Oriented Software"); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl3", "Addison Wesley Professional"); $this->type("ctl0\$body\$DataGrid\$ctl2\$ctl5", "\$57.04"); $this->byXPath("//input[@name='ctl0\$body\$DataGrid\$ctl2\$ctl7']")->click(); + $this->pause(50); $this->select("ctl0\$body\$DataGrid\$ctl2\$ctl9", "1"); $this->byLinkText("Save")->click(); + $this->pause(50); // verify the 2nd row is saved - $this->assertContains("Design Pattern: Elements of Reusable Object-Oriented Software", $this->source()); - $this->assertContains("Addison Wesley Professional", $this->source()); - $this->assertContains("$57.04", $this->source()); + $this->assertSourceContains("Design Pattern: Elements of Reusable Object-Oriented Software"); + $this->assertSourceContains("Addison Wesley Professional"); + $this->assertSourceContains("$57.04"); $this->assertAttribute("ctl0_body_DataGrid_ctl2_ctl4@checked", null); $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl4@disabled','regexp:true|disabled'); //$this->assertElementPresent("//img[@src='images/star1.gif']",''); // verify cancel editting the 3rd row $this->byId("ctl0_body_DataGrid_ctl3_ctl7")->click(); + $this->pause(50); $this->byLinkText("Cancel")->click(); - $this->assertContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source()); + $this->assertSourceContains("Design Patterns Explained : A New Perspective on Object-Oriented Design"); // verify deleting $this->byId("ctl0_body_DataGrid_ctl3_ctl9")->click(); + $this->pause(50); $this->assertEquals("Are you sure?", $this->alertText()); $this->acceptAlert(); $this->pause(500); - $this->assertNotContains("Design Patterns Explained : A New Perspective on Object-Oriented Design", $this->source()); + $this->assertSourceNotContains("Design Patterns Explained : A New Perspective on Object-Oriented Design"); - $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source()); + $this->assertSourceContains("Extreme Programming Explained : Embrace Change"); $this->byId("ctl0_body_DataGrid_ctl6_ctl9")->click(); + $this->pause(50); $this->assertEquals("Are you sure?", $this->alertText()); $this->dismissAlert(); - $this->assertContains("Extreme Programming Explained : Embrace Change", $this->source()); + $this->assertSourceContains("Extreme Programming Explained : Embrace Change"); } } -- cgit v1.2.3