summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
diff options
context:
space:
mode:
authorDavid <ottodavid@gmx.net>2015-08-06 18:12:45 +0200
committerDavid <ottodavid@gmx.net>2015-08-06 18:14:04 +0200
commitbdfd9f07f17de1751a7e4d94940acb426af4be77 (patch)
tree093d0e40504e0ece761733780934e0d6f09888fe /tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
parent1feb1e95660fdfeb5b6d9e12c6fe085aa2bec5ad (diff)
Fix tests
work around stale references by explicitly waiting
Diffstat (limited to 'tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php')
-rwxr-xr-xtests/FunctionalTests/quickstart/Controls/DataList2TestCase.php40
1 files changed, 23 insertions, 17 deletions
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
index c21d71f3..65f137af 100755
--- a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
+++ b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php
@@ -7,59 +7,65 @@ class QuickstartDataList2TestCase extends PradoGenericSelenium2Test
$this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&amp;notheme=true&amp;lang=en");
// verify initial presentation
- $this->assertContains("Motherboard", $this->source());
- $this->assertContains("Monitor", $this->source());
+ $this->assertSourceContains("Motherboard");
+ $this->assertSourceContains("Monitor");
// verify selecting an item
$this->byLinkText("ITN003")->click();
- $this->assertContains("Quantity", $this->source());
- $this->assertContains("Price", $this->source());
- $this->assertContains("\$80", $this->source());
+ $this->assertSourceContains("Quantity");
+ $this->assertSourceContains("Price");
+ $this->assertSourceContains("\$80");
$this->byLinkText("ITN005")->click();
- $this->assertContains("\$150", $this->source());
+ $this->assertSourceContains("\$150");
// verify editting an item
$this->byId("ctl0_body_DataList_ctl5_ctl0")->click();
+ $this->pause(50);
$this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11");
$this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99");
$this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']")->click();
$this->byLinkText("Save")->click();
+ $this->pause(50);
// verify item is saved
$this->byLinkText("ITN005")->click();
- $this->assertContains("\$140.99", $this->source());
- $this->assertContains("11", $this->source());
+ $this->assertSourceContains("\$140.99");
+ $this->assertSourceContains("11");
// verify editting another item
$this->byId("ctl0_body_DataList_ctl3_ctl1")->click();
+ $this->pause(50);
$this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive");
$this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23");
$this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']")->click();
$this->byLinkText("Cancel")->click();
+ $this->pause(50);
// verify item is canceled
$this->byLinkText("ITN003")->click();
- $this->assertContains("2", $this->source());
- $this->assertContains("Harddrive", $this->source());
+ $this->assertSourceContains("2");
+ $this->assertSourceContains("Harddrive");
// verify item deletion
$this->byId("ctl0_body_DataList_ctl3_ctl1")->click();
+ $this->pause(50);
$this->assertEquals("Are you sure?", $this->alertText());
$this->acceptAlert();
$this->pause(300); // wait for reload
$this->byId("ctl0_body_DataList_ctl5_ctl2")->click();
+ $this->pause(50);
$this->assertEquals("Are you sure?", $this->alertText());
$this->dismissAlert();
- $this->assertContains("Motherboard", $this->source());
- $this->assertContains("CPU", $this->source());
- $this->assertNotContains("Harddrive", $this->source());
- $this->assertContains("Sound card", $this->source());
- $this->assertContains("Video card", $this->source());
- $this->assertContains("Keyboard", $this->source());
- $this->assertContains("Monitor", $this->source());
+ $this->assertSourceContains("Motherboard");
+ $this->assertSourceContains("CPU");
+ $this->assertSourceNotContains("Harddrive");
+ $this->assertSourceContains("Sound card");
+ $this->assertSourceContains("Video card");
+ $this->assertSourceContains("Keyboard");
+ $this->assertSourceContains("Monitor");
}
}