diff options
author | Fabio Bas <ctrlaltca@gmail.com> | 2014-03-05 23:02:18 +0100 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2014-08-21 17:30:13 +0200 |
commit | 94e54d3023ed89281f89125f3ad0553afb9312cb (patch) | |
tree | 688470329e8b837252b523b6341fe5e10fe34b95 /tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php | |
parent | 32dfd8233520261483bdf30f23425e3b50f05d17 (diff) |
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
Diffstat (limited to 'tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php')
-rwxr-xr-x | tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php index 2957c96f..911fdc93 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataList2TestCase.php @@ -7,52 +7,58 @@ class QuickstartDataList2TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample2&notheme=true&lang=en"); // verify initial presentation - $this->assertTextPresent("Motherboard", ""); - $this->assertTextPresent("Monitor", ""); + $this->assertContains("Motherboard", $this->source()); + $this->assertContains("Monitor", $this->source()); // verify selecting an item - $this->clickAndWait("link=ITN003", ""); - $this->assertTextPresent("Quantity", ""); - $this->assertTextPresent("Price", ""); - $this->assertTextPresent("\$80", ""); - $this->clickAndWait("link=ITN005", ""); - $this->assertTextPresent("\$150", ""); + $this->byLinkText("ITN003")->click(); + $this->assertContains("Quantity", $this->source()); + $this->assertContains("Price", $this->source()); + $this->assertContains("\$80", $this->source()); + $this->byLinkText("ITN005")->click(); + $this->assertContains("\$150", $this->source()); // verify editting an item - $this->clickAndWait("id=ctl0_body_DataList_ctl5_ctl0", ""); + $this->byId("ctl0_body_DataList_ctl5_ctl0")->click(); $this->type("ctl0\$body\$DataList\$ctl5\$ProductQuantity", "11"); $this->type("ctl0\$body\$DataList\$ctl5\$ProductPrice", "140.99"); - $this->click("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']", ""); - $this->clickAndWait("link=Save", ""); + $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl5\$ProductImported']")->click(); + $this->byLinkText("Save")->click(); // verify item is saved - $this->clickAndWait("link=ITN005", ""); - $this->assertTextPresent("\$140.99", ""); - $this->assertTextPresent("11", ""); + $this->byLinkText("ITN005")->click(); + $this->assertContains("\$140.99", $this->source()); + $this->assertContains("11", $this->source()); // verify editting another item - $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", ""); + $this->byId("ctl0_body_DataList_ctl3_ctl1")->click(); $this->type("ctl0\$body\$DataList\$ctl3\$ProductName", "Hard Drive"); $this->type("ctl0\$body\$DataList\$ctl3\$ProductQuantity", "23"); - $this->click("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']", ""); - $this->clickAndWait("link=Cancel", ""); + $this->byXPath("//input[@name='ctl0\$body\$DataList\$ctl3\$ProductImported']")->click(); + $this->byLinkText("Cancel")->click(); // verify item is canceled - $this->clickAndWait("link=ITN003", ""); - $this->assertTextPresent("2", ""); - $this->assertTextPresent("Harddrive", ""); + $this->byLinkText("ITN003")->click(); + $this->assertContains("2", $this->source()); + $this->assertContains("Harddrive", $this->source()); // verify item deletion - $this->clickAndWait("id=ctl0_body_DataList_ctl3_ctl1", ""); - $this->verifyConfirmation("Are you sure?"); - $this->click("id=ctl0_body_DataList_ctl5_ctl2", ""); - $this->verifyConfirmationDismiss("Are you sure?"); - $this->assertTextPresent("Motherboard", ""); - $this->assertTextPresent("CPU", ""); - $this->assertTextNotPresent("Harddrive",""); - $this->assertTextPresent("Sound card", ""); - $this->assertTextPresent("Video card", ""); - $this->assertTextPresent("Keyboard",""); - $this->assertTextPresent("Monitor", ""); + $this->byId("ctl0_body_DataList_ctl3_ctl1")->click(); + + $this->assertEquals("Are you sure?", $this->alertText()); + $this->acceptAlert(); + + $this->byId("ctl0_body_DataList_ctl5_ctl2")->click(); + + $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()); } } |