diff options
Diffstat (limited to 'tests/FunctionalTests/quickstart')
40 files changed, 389 insertions, 328 deletions
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php index 9d816978..dc04fe91 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php @@ -8,7 +8,7 @@ class QuickstartActiveButtonTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('TActiveButton Samples (AJAX)', $this->source()); + $this->assertSourceContains('TActiveButton Samples (AJAX)'); // a click button $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php index 9e537abd..f23a0174 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php @@ -9,18 +9,18 @@ class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('TActiveCheckBox Samples (AJAX)', $this->source()); + $this->assertSourceContains('TActiveCheckBox Samples (AJAX)'); // an auto postback checkbox - $this->assertNotContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->assertSourceNotContains("ctl0_body_ctl0 clicked using callback"); $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click(); $this->pause(800); $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected()); - $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->assertSourceContains("ctl0_body_ctl0 clicked using callback"); $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click(); $this->pause(800); - $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source()); + $this->assertSourceContains("ctl0_body_ctl0 clicked using callback"); $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected()); // a checkbox causing validation on a textbox @@ -33,7 +33,7 @@ class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); $this->pause(800); $this->assertNotVisible('ctl0_body_ctl1'); - $this->assertContains("ctl0_body_ctl2 clicked using callback", $this->source()); + $this->assertSourceContains("ctl0_body_ctl2 clicked using callback"); // a checkbox validated by a required field validator $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected()); @@ -45,7 +45,7 @@ class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); $this->pause(800); $this->assertNotVisible('ctl0_body_ctl4'); - $this->assertContains("ctl0_body_CheckBox clicked", $this->source()); + $this->assertSourceContains("ctl0_body_CheckBox clicked"); // a checkbox validated by a required field validator using AutoPostBack $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected()); diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php index 7cb29382..3b0115dd 100755 --- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php +++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php @@ -8,7 +8,7 @@ class QuickstartActiveCustomValidatorTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('TActiveCustomValidator Samples (AJAX)', $this->source()); + $this->assertSourceContains('TActiveCustomValidator Samples (AJAX)'); $base = 'ctl0_body_'; diff --git a/tests/FunctionalTests/quickstart/Advanced/I18N.php b/tests/FunctionalTests/quickstart/Advanced/I18N.php index ccb8c961..6d979268 100755 --- a/tests/FunctionalTests/quickstart/Advanced/I18N.php +++ b/tests/FunctionalTests/quickstart/Advanced/I18N.php @@ -6,47 +6,47 @@ class QuickstartI18NTestCase extends PradoGenericSelenium2Test function test () { $this->url("../../demos/quickstart/index.php?notheme=true&page=Advanced.Samples.I18N.Home&lang=en&notheme=true"); - $this->assertContains("Internationlization in PRADO", $this->source()); + $this->assertSourceContains("Internationlization in PRADO"); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("$12.40", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("$12.40"); + $this->assertSourceContains("€100.00"); $this->assertContains("December 6, 2004", $this->source()); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh&notheme=true"); - $this->assertContains("PRADO 国际化", $this->source()); - $this->assertContains("2004 十二月", $this->source()); - $this->assertContains("US$ 12.40", $this->source()); + $this->assertSourceContains("PRADO 国际化"); + $this->assertSourceContains("2004 十二月"); + $this->assertSourceContains("US$ 12.40"); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00 ", $this->source()); + $this->assertSourceContains("€100.00 "); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=zh_TW&notheme=true"); - $this->assertContains("PRADO 國際化", $this->source()); - $this->assertContains("2004年12月6日", $this->source()); - $this->assertContains("US$12.40", $this->source()); + $this->assertSourceContains("PRADO 國際化"); + $this->assertSourceContains("2004年12月6日"); + $this->assertSourceContains("US$12.40"); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("€100.00"); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=de&notheme=true"); - $this->assertContains("Internationalisierung in PRADO", $this->source()); - $this->assertContains("6. Dezember 2004 ", $this->source()); + $this->assertSourceContains("Internationalisierung in PRADO"); + $this->assertSourceContains("6. Dezember 2004 "); $this->assertContains("$ 12,40", $this->source()); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("€100.00"); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=es&notheme=true"); - $this->assertContains("Internationlization en PRADO", $this->source()); - $this->assertContains("6 de diciembre de 2004", $this->source()); - $this->assertContains("US$12.40", $this->source()); + $this->assertSourceContains("Internationlization en PRADO"); + $this->assertSourceContains("6 de diciembre de 2004"); + $this->assertSourceContains("US$12.40"); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("€100.00"); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=fr&notheme=true"); - $this->assertContains("Internationalisation avec PRADO", $this->source()); - $this->assertContains("6 décembre 2004", $this->source()); + $this->assertSourceContains("Internationalisation avec PRADO"); + $this->assertSourceContains("6 décembre 2004"); $this->assertContains("12,40 $", $this->source()); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("€100.00"); $this->url("../../demos/quickstart/index.php?page=Advanced.Samples.I18N.Home&lang=pl&notheme=true"); - $this->assertContains("Internacjonalizacja w PRADO", $this->source()); - $this->assertContains("6 grudnia 2004", $this->source()); + $this->assertSourceContains("Internacjonalizacja w PRADO"); + $this->assertSourceContains("6 grudnia 2004"); $this->assertContains("US$ 12,40", $this->source()); $this->assertContains("46.412,42 €", $this->source()); - $this->assertContains("€100.00", $this->source()); + $this->assertSourceContains("€100.00"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php index a23f1d1d..75c0383a 100755 --- a/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/BulletedListTestCase.php @@ -7,13 +7,13 @@ class QuickstartBulletedListTestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TBulletedList.Home&notheme=true&lang=en"); // verify if all required texts are present - $this->assertContains('item 1', $this->source()); - $this->assertContains('item 2', $this->source()); - $this->assertContains('item 3', $this->source()); - $this->assertContains('item 4', $this->source()); - $this->assertContains('google', $this->source()); - $this->assertContains('yahoo', $this->source()); - $this->assertContains('amazon', $this->source()); + $this->assertSourceContains('item 1'); + $this->assertSourceContains('item 2'); + $this->assertSourceContains('item 3'); + $this->assertSourceContains('item 4'); + $this->assertSourceContains('google'); + $this->assertSourceContains('yahoo'); + $this->assertSourceContains('amazon'); // verify order list starting from 5 $this->assertElementPresent("//ol[@start='5']"); @@ -27,10 +27,10 @@ class QuickstartBulletedListTestCase extends PradoGenericSelenium2Test // verify linkbutton list $this->byId("ctl0_body_ctl40")->click(); - $this->assertContains("You clicked google : http://www.google.com/.", $this->source()); + $this->assertSourceContains("You clicked google : http://www.google.com/."); $this->byId("ctl0_body_ctl41")->click(); - $this->assertContains("You clicked yahoo : http://www.yahoo.com/.", $this->source()); + $this->assertSourceContains("You clicked yahoo : http://www.yahoo.com/."); $this->byId("ctl0_body_ctl42")->click(); - $this->assertContains("You clicked amazon : http://www.amazon.com/.", $this->source()); + $this->assertSourceContains("You clicked amazon : http://www.amazon.com/."); } } diff --git a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php index f5a4a979..c734f7b0 100755 --- a/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ButtonTestCase.php @@ -14,17 +14,18 @@ class QuickstartButtonTestCase extends PradoGenericSelenium2Test // a click button $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); $this->byXPath("//input[@type='submit' and @value='click me']")->click(); + $this->pause(50); $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]"); // a command button $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); $this->byXPath("//input[@type='submit' and @value='click me']")->click(); + $this->pause(50); $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value\"]"); // a button causing validation $this->assertNotVisible('ctl0_body_ctl3'); $this->byXPath("//input[@type='submit' and @value='submit']")->click(); -// $this->pause(1000); $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); $this->byXPath("//input[@type='submit' and @value='submit']")->click(); diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php index 781701cf..d29f56aa 100755 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxListTestCase.php @@ -22,28 +22,32 @@ class QuickstartCheckBoxListTestCase extends PradoGenericSelenium2Test // Check box list's behavior upon postback $this->byXPath("//input[@name='ctl0\$body\$CheckBoxList\$c2' and @value='value 3']")->click(); $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); + $this->pause(50); $this->assertContains("Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 4, Value: value 5, Text: item 5)", $this->source()); // Auto postback check box list $this->byXPath("//input[@name='ctl0\$body\$ctl7\$c1' and @value='value 2']")->click(); + $this->pause(50); $this->assertContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)", $this->source()); // Databind to an integer-indexed array $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList1\$c1' and @value='1']")->click(); + $this->pause(50); $this->assertContains("Your selection is: (Index: 1, Value: 1, Text: item 2)", $this->source()); // Databind to an associative array: $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList2\$c1' and @value='key 2']")->click(); + $this->pause(50); $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); // Databind with DataTextField and DataValueField specified $this->byXPath("//input[@name='ctl0\$body\$DBCheckBoxList3\$c2' and @value='003']")->click(); + $this->pause(50); $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); // CheckBox list causing validation $this->assertNotVisible('ctl0_body_ctl8'); $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click(); -// $this->pause(1000); $this->assertVisible('ctl0_body_ctl8'); $this->type("ctl0\$body\$TextBox", "test"); $this->byXPath("//input[@name='ctl0\$body\$ctl9\$c0' and @value='Agree']")->click(); diff --git a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php index ca89b3a0..b051212d 100755 --- a/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/CheckBoxTestCase.php @@ -15,11 +15,11 @@ class QuickstartCheckBoxTestCase extends PradoGenericSelenium2Test $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click(); // an auto postback checkbox - $this->assertNotContains("I'm clicked", $this->source()); + $this->assertSourceNotContains("I'm clicked"); $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); - $this->assertContains("I'm clicked", $this->source()); + $this->assertSourceContains("I'm clicked"); $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click(); - $this->assertContains("I'm clicked", $this->source()); + $this->assertSourceContains("I'm clicked"); // a checkbox causing validation on a textbox $this->assertNotVisible('ctl0_body_ctl3'); diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php index 4f4ca60a..a1041836 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid1TestCase.php @@ -7,20 +7,20 @@ class QuickstartDataGrid1TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->assertContains('id', $this->source()); - $this->assertContains('name', $this->source()); - $this->assertContains('quantity', $this->source()); - $this->assertContains('price', $this->source()); - $this->assertContains('imported', $this->source()); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('Motherboard', $this->source()); - $this->assertContains('100', $this->source()); - $this->assertContains('true', $this->source()); - $this->assertContains('ITN019', $this->source()); - $this->assertContains('Speaker', $this->source()); - $this->assertContains('35', $this->source()); - $this->assertContains('65', $this->source()); - $this->assertContains('false', $this->source()); + $this->assertSourceContains('id'); + $this->assertSourceContains('name'); + $this->assertSourceContains('quantity'); + $this->assertSourceContains('price'); + $this->assertSourceContains('imported'); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('Motherboard'); + $this->assertSourceContains('100'); + $this->assertSourceContains('true'); + $this->assertSourceContains('ITN019'); + $this->assertSourceContains('Speaker'); + $this->assertSourceContains('35'); + $this->assertSourceContains('65'); + $this->assertSourceContains('false'); // verify specific table tags $this->assertElementPresent("ctl0_body_DataGrid"); diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php index 548b04e3..a5940c0b 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid2TestCase.php @@ -7,11 +7,11 @@ 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->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()); + $this->assertSourceContains('Book Title'); + $this->assertSourceContains('Publisher'); + $this->assertSourceContains('Price'); + $this->assertSourceContains('In-stock'); + $this->assertSourceContains('Rating'); // verify book titles $this->assertElementPresent("//a[@href='http://www.amazon.com/gp/product/0596007124' and text()='Head First Design Patterns']",''); @@ -19,11 +19,11 @@ class QuickstartDataGrid2TestCase extends PradoGenericSelenium2Test // verify publishers $this->assertContains("O'Reilly Media, Inc.", $this->source()); - $this->assertContains("Addison-Wesley Professional", $this->source()); + $this->assertSourceContains("Addison-Wesley Professional"); // verify prices - $this->assertContains("\$37.49", $this->source()); - $this->assertContains("\$38.49", $this->source()); + $this->assertSourceContains("\$37.49"); + $this->assertSourceContains("\$38.49"); // verify in-stock $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked','regexp:true|checked'); @@ -38,12 +38,14 @@ class QuickstartDataGrid2TestCase extends PradoGenericSelenium2Test // verify toggle column visibility $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); - $this->assertNotContains('Head First Design Patterns', $this->source()); + $this->assertSourceNotContains('Head First Design Patterns'); $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); + $this->pause(50); $this->assertElementNotPresent('ctl0_body_DataGrid_ctl1_ctl5',''); $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c3' and @value='In-stock']")->click(); + $this->pause(50); $this->assertElementPresent('ctl0_body_DataGrid_ctl1_ctl5',''); $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Book Title']")->click(); - $this->assertContains('Head First Design Patterns', $this->source()); + $this->assertSourceContains('Head First Design Patterns'); } } 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"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php index f67f5634..974b5bca 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid4TestCase.php @@ -7,22 +7,27 @@ class QuickstartDataGrid4TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample4&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_ctl5@checked','regexp:true|checked'); $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@disabled','regexp:true|disabled'); // verify sorting $this->byLinkText("Book Title")->click(); + $this->pause(50); $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null); $this->byLinkText("Publisher")->click(); + $this->pause(50); $this->assertAttribute('ctl0_body_DataGrid_ctl6_ctl5@checked', null); $this->byLinkText("Price")->click(); + $this->pause(50); $this->assertAttribute('ctl0_body_DataGrid_ctl2_ctl5@checked', null); $this->byLinkText("In-stock")->click(); + $this->pause(50); $this->assertAttribute('ctl0_body_DataGrid_ctl1_ctl5@checked', null); $this->byLinkText("Rating")->click(); + $this->pause(50); $this->assertAttribute('ctl0_body_DataGrid_ctl4_ctl5@checked', null); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php index 3df22ff8..66630581 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid5TestCase.php @@ -8,106 +8,113 @@ class QuickstartDataGrid5TestCase extends PradoGenericSelenium2Test // verify if all required texts are present // verify column headers - $this->assertContains('id', $this->source()); - $this->assertContains('name', $this->source()); - $this->assertContains('quantity', $this->source()); - $this->assertContains('price', $this->source()); - $this->assertContains('imported', $this->source()); + $this->assertSourceContains('id'); + $this->assertSourceContains('name'); + $this->assertSourceContains('quantity'); + $this->assertSourceContains('price'); + $this->assertSourceContains('imported'); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertContains('ITN005', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceContains('ITN005'); + $this->assertSourceNotContains('ITN006'); // verify paging $this->byLinkText("2")->click(); - $this->assertContains('ITN006', $this->source()); - $this->assertContains('ITN007', $this->source()); - $this->assertContains('ITN008', $this->source()); - $this->assertContains('ITN009', $this->source()); - $this->assertContains('ITN010', $this->source()); - $this->assertNotContains('ITN011', $this->source()); - $this->assertNotContains('ITN005', $this->source()); + $this->assertSourceContains('ITN006'); + $this->assertSourceContains('ITN007'); + $this->assertSourceContains('ITN008'); + $this->assertSourceContains('ITN009'); + $this->assertSourceContains('ITN010'); + $this->assertSourceNotContains('ITN011'); + $this->assertSourceNotContains('ITN005'); $this->byLinkText("4")->click(); - $this->assertContains('ITN016', $this->source()); - $this->assertContains('ITN017', $this->source()); - $this->assertContains('ITN018', $this->source()); - $this->assertContains('ITN019', $this->source()); - $this->assertNotContains('ITN015', $this->source()); + $this->assertSourceContains('ITN016'); + $this->assertSourceContains('ITN017'); + $this->assertSourceContains('ITN018'); + $this->assertSourceContains('ITN019'); + $this->assertSourceNotContains('ITN015'); $this->byLinkText("1")->click(); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertContains('ITN005', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceContains('ITN005'); + $this->assertSourceNotContains('ITN006'); // show top pager $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click(); + $this->pause(50); $this->byId("ctl0_body_DataGrid_ctl8_ctl3")->click(); + $this->pause(50); $this->byLinkText("1")->click(); + $this->pause(50); // hide top pager $this->byXPath("//input[@name='ctl0\$body\$ctl1\$c0' and @value='Top']")->click(); + $this->pause(50); // change next prev caption $this->type("ctl0\$body\$NextPageText", "Next Page"); + $this->pause(50); $this->type("ctl0\$body\$PrevPageText", "Prev Page"); $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); // verify next prev paging - $this->assertContains('ITN001', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceNotContains('ITN006'); $this->byLinkText("Next Page")->click(); - $this->assertNotContains('ITN005', $this->source()); - $this->assertContains('ITN006', $this->source()); - $this->assertNotContains('ITN011', $this->source()); + $this->assertSourceNotContains('ITN005'); + $this->assertSourceContains('ITN006'); + $this->assertSourceNotContains('ITN011'); $this->byLinkText("Next Page")->click(); - $this->assertNotContains('ITN010', $this->source()); - $this->assertContains('ITN011', $this->source()); - $this->assertNotContains('ITN016', $this->source()); + $this->assertSourceNotContains('ITN010'); + $this->assertSourceContains('ITN011'); + $this->assertSourceNotContains('ITN016'); $this->byLinkText("Next Page")->click(); - $this->assertNotContains('ITN015', $this->source()); - $this->assertContains('ITN016', $this->source()); + $this->assertSourceNotContains('ITN015'); + $this->assertSourceContains('ITN016'); $this->byLinkText("Prev Page")->click(); - $this->assertNotContains('ITN010', $this->source()); - $this->assertContains('ITN011', $this->source()); - $this->assertNotContains('ITN016', $this->source()); + $this->assertSourceNotContains('ITN010'); + $this->assertSourceContains('ITN011'); + $this->assertSourceNotContains('ITN016'); $this->byLinkText("Prev Page")->click(); - $this->assertNotContains('ITN005', $this->source()); - $this->assertContains('ITN006', $this->source()); - $this->assertNotContains('ITN011', $this->source()); + $this->assertSourceNotContains('ITN005'); + $this->assertSourceContains('ITN006'); + $this->assertSourceNotContains('ITN011'); $this->byLinkText("Prev Page")->click(); - $this->assertContains('ITN001', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceNotContains('ITN006'); // change button count $this->type("ctl0\$body\$PageButtonCount", "2"); $this->byName("ctl0\$body\$ctl6")->click(); + $this->pause(50); $this->byLinkText("Next Page")->click(); - $this->assertNotContains('ITN010', $this->source()); - $this->assertContains('ITN011', $this->source()); - $this->assertNotContains('ITN016', $this->source()); + $this->assertSourceNotContains('ITN010'); + $this->assertSourceContains('ITN011'); + $this->assertSourceNotContains('ITN016'); $this->byLinkText("4")->click(); - $this->assertNotContains('ITN015', $this->source()); - $this->assertContains('ITN016', $this->source()); + $this->assertSourceNotContains('ITN015'); + $this->assertSourceContains('ITN016'); $this->byLinkText("Prev Page")->click(); - $this->assertNotContains('ITN005', $this->source()); - $this->assertContains('ITN006', $this->source()); - $this->assertNotContains('ITN011', $this->source()); + $this->assertSourceNotContains('ITN005'); + $this->assertSourceContains('ITN006'); + $this->assertSourceNotContains('ITN011'); $this->type("ctl0\$body\$PageButtonCount", "10"); $this->byName("ctl0\$body\$ctl6")->click(); $this->type("ctl0\$body\$PageSize", "2"); + $this->pause(50); $this->byName("ctl0\$body\$ctl8")->click(); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertNotContains('ITN003', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceNotContains('ITN003'); $this->byLinkText("10")->click(); - $this->assertContains('ITN019', $this->source()); - $this->assertNotContains('ITN018', $this->source()); + $this->assertSourceContains('ITN019'); + $this->assertSourceNotContains('ITN018'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php index 54af86a8..7df67e07 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataGrid6TestCase.php @@ -7,42 +7,42 @@ class QuickstartDataGrid6TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataGrid.Sample6&notheme=true&lang=en"); // verify column headers - $this->assertContains('id', $this->source()); - $this->assertContains('name', $this->source()); - $this->assertContains('quantity', $this->source()); - $this->assertContains('price', $this->source()); - $this->assertContains('imported', $this->source()); + $this->assertSourceContains('id'); + $this->assertSourceContains('name'); + $this->assertSourceContains('quantity'); + $this->assertSourceContains('price'); + $this->assertSourceContains('imported'); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertContains('ITN005', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceContains('ITN005'); + $this->assertSourceNotContains('ITN006'); // verify paging $this->byLinkText("2")->click(); - $this->assertContains('ITN006', $this->source()); - $this->assertContains('ITN007', $this->source()); - $this->assertContains('ITN008', $this->source()); - $this->assertContains('ITN009', $this->source()); - $this->assertContains('ITN010', $this->source()); - $this->assertNotContains('ITN011', $this->source()); - $this->assertNotContains('ITN005', $this->source()); + $this->assertSourceContains('ITN006'); + $this->assertSourceContains('ITN007'); + $this->assertSourceContains('ITN008'); + $this->assertSourceContains('ITN009'); + $this->assertSourceContains('ITN010'); + $this->assertSourceNotContains('ITN011'); + $this->assertSourceNotContains('ITN005'); $this->byLinkText("4")->click(); - $this->assertContains('ITN016', $this->source()); - $this->assertContains('ITN017', $this->source()); - $this->assertContains('ITN018', $this->source()); - $this->assertContains('ITN019', $this->source()); - $this->assertNotContains('ITN015', $this->source()); + $this->assertSourceContains('ITN016'); + $this->assertSourceContains('ITN017'); + $this->assertSourceContains('ITN018'); + $this->assertSourceContains('ITN019'); + $this->assertSourceNotContains('ITN015'); $this->byLinkText("1")->click(); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertContains('ITN005', $this->source()); - $this->assertNotContains('ITN006', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceContains('ITN005'); + $this->assertSourceNotContains('ITN006'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php index 436af2ad..10786e7d 100755 --- a/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DataList1TestCase.php @@ -7,15 +7,15 @@ class QuickstartDataList1TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TDataList.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->assertContains('ITN001', $this->source()); - $this->assertContains('$100', $this->source()); - $this->assertContains('Motherboard', $this->source()); - $this->assertContains('ITN018', $this->source()); - $this->assertContains('Surge protector', $this->source()); - $this->assertContains('45', $this->source()); - $this->assertContains('$15', $this->source()); - $this->assertContains('Total 19 products.', $this->source()); - $this->assertContains('Computer Parts', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('$100'); + $this->assertSourceContains('Motherboard'); + $this->assertSourceContains('ITN018'); + $this->assertSourceContains('Surge protector'); + $this->assertSourceContains('45'); + $this->assertSourceContains('$15'); + $this->assertSourceContains('Total 19 products.'); + $this->assertSourceContains('Computer Parts'); // verify specific table tags $this->assertElementPresent("ctl0_body_DataList"); 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&notheme=true&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"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php index cb01e948..aefd9cb7 100755 --- a/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/DropDownListTestCase.php @@ -25,25 +25,25 @@ class QuickstartDropDownListTestCase extends PradoGenericSelenium2Test // an auto postback dropdown list $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); $this->selectAndWait("ctl0\$body\$ctl4", "item 3"); - $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)"); // a single selection list box upon postback $this->select("ctl0\$body\$DropDownList1", "item 4"); $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); - $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)"); // Databind to an integer-indexed array $this->selectAndWait("ctl0\$body\$DBDropDownList1", "item 3"); - $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: 2, Text: item 3)"); // Databind to an associative array $this->selectAndWait("ctl0\$body\$DBDropDownList2", "item 2"); - $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)"); // Databind with DataTextField and DataValueField specified $this->selectAndWait("ctl0\$body\$DBDropDownList3", "Cary"); - $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: 003, Text: Cary)"); // dropdown list is being validated $this->assertNotVisible('ctl0_body_ctl6'); diff --git a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php index 8c5add48..74650393 100755 --- a/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ExpressionTestCase.php @@ -8,6 +8,6 @@ class QuickstartExpressionTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('PRADO QuickStart Sample', $this->source()); + $this->assertSourceContains('PRADO QuickStart Sample'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php index bc7ef8b8..9fdb78bf 100755 --- a/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/HyperLinkTestCase.php @@ -7,8 +7,8 @@ class QuickstartHyperLinkTestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.THyperLink.Home&notheme=true&lang=en"); $this->assertEquals("PRADO QuickStart Sample", $this->title()); $this->assertElementPresent("//a[@href=\"http://www.pradosoft.com/\" and @target=\"_blank\"]"); - $this->assertContains("Welcome to", $this->source()); - $this->assertContains("Body contents", $this->source()); + $this->assertSourceContains("Welcome to"); + $this->assertSourceContains("Body contents"); $this->assertElementPresent("//a[img/@alt='Hello World']"); $this->assertElementPresent("//a[contains(text(),'Body contents')]"); } diff --git a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php index 0f86216e..4b2813a7 100755 --- a/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ImageButtonTestCase.php @@ -10,11 +10,11 @@ class QuickstartImageButtonTestCase extends PradoGenericSelenium2Test // a click button $this->byXPath("//input[@type='image' and @alt='hello world']")->click(); - $this->assertContains("You clicked at ", $this->source()); + $this->assertSourceContains("You clicked at "); // a command button $this->byName("ctl0\$body\$ctl1")->click(); - $this->assertContains("Command name: test, Command parameter: value", $this->source()); + $this->assertSourceContains("Command name: test, Command parameter: value"); // a button causing validation $this->assertNotVisible('ctl0_body_ctl2'); diff --git a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php index f3bd4775..9becc9f4 100755 --- a/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ImageTestCase.php @@ -11,7 +11,7 @@ class QuickstartImageTestCase extends PradoGenericSelenium2Test //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='']"); $this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @alt='Hello World!']"); - $this->assertContains("Hello World! Hello World! Hello World!", $this->source()); + $this->assertSourceContains("Hello World! Hello World! Hello World!"); //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and @align='baseline']"); //$this->assertElementPresent("//img[contains(@src,'/hello_world.gif') and contains(@longdesc,'HelloWorld.html')]"); } diff --git a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php index a9aa0bbe..f23ba586 100755 --- a/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/LabelTestCase.php @@ -7,10 +7,10 @@ class QuickstartLabelTestCase extends PradoGenericSelenium2Test { $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TLabel.Home&notheme=true&lang=en"); $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains("This is a label with customized color and font.", $this->source()); - $this->assertContains("This is a form label associated with the TTextBox control below", $this->source()); - $this->assertContains("This is a label with empty Text property and <b>nonempty body</b>", $this->source()); - $this->assertContains("This is a disabled label", $this->source()); + $this->assertSourceContains("This is a label with customized color and font."); + $this->assertSourceContains("This is a form label associated with the TTextBox control below"); + $this->assertSourceContains("This is a label with empty Text property and <b>nonempty body</b>"); + $this->assertSourceContains("This is a disabled label"); $this->assertAttribute("ctl0_body_Label2@disabled","regexp:true|disabled"); diff --git a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php index 97b4863d..d1dc00e1 100755 --- a/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/LinkButtonTestCase.php @@ -10,14 +10,19 @@ class QuickstartLinkButtonTestCase extends PradoGenericSelenium2Test // regular buttons $this->byLinkText("link button")->click(); + $this->pause(50); $this->byXPath("//a[contains(text(),'body content')]")->click(); + $this->pause(50); // a click button $this->byLinkText("click me")->click(); + $this->pause(50); $this->byLinkText("I'm clicked")->click(); + $this->pause(50); // a command button $this->byLinkText("click me")->click(); + $this->pause(50); $this->byXPath("//a[contains(text(),'Name: test, Param: value')]")->click(); // a button causing validation diff --git a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php index 11910ba5..a61bd5e2 100755 --- a/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/ListBoxTestCase.php @@ -25,13 +25,13 @@ class QuickstartListBoxTestCase extends PradoGenericSelenium2Test // an auto postback single selection list box $this->assertNotContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); $this->selectAndWait("ctl0\$body\$ctl4", "item 3"); - $this->assertContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)"); // a single selection list box upon postback $this->select("ctl0\$body\$ListBox1", "item 4"); $this->assertNotContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); $this->byXPath("//input[@type='submit' and @value='Submit']")->click(); - $this->assertContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 3, Value: value 4, Text: item 4)"); // a multiple selection list box $this->assertAttribute("ctl0\$body\$ctl6[]@size","4"); @@ -44,6 +44,7 @@ class QuickstartListBoxTestCase extends PradoGenericSelenium2Test // multiselection list box's behavior upon postback $this->addSelection("ctl0\$body\$ListBox2[]", "item 3"); $this->byName("ctl0\$body\$ctl8")->click(); + $this->pause(50); $this->assertText("ctl0_body_MultiSelectionResult2","Your selection is: (Index: 1, Value: value 2, Text: item 2)(Index: 2, Value: value 3, Text: item 3)(Index: 3, Value: value 4, Text: item 4)"); // Auto postback multiselection list box @@ -52,15 +53,15 @@ class QuickstartListBoxTestCase extends PradoGenericSelenium2Test // Databind to an integer-indexed array $this->selectAndWait("ctl0\$body\$DBListBox1[]", "item 3"); - $this->assertContains("Your selection is: (Index: 2, Value: 2, Text: item 3)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: 2, Text: item 3)"); // Databind to an associative array $this->selectAndWait("ctl0\$body\$DBListBox2[]", "item 2"); - $this->assertContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)"); // Databind with DataTextField and DataValueField specified $this->selectAndWait("ctl0\$body\$DBListBox3[]", "Cary"); - $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: 003, Text: Cary)"); // List box is being validated $this->assertNotVisible('ctl0_body_ctl10'); diff --git a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php index d7a5ebec..091b3db8 100755 --- a/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/MultiViewTestCase.php @@ -13,11 +13,12 @@ class QuickstartMultiViewTestCase extends PradoGenericSelenium2Test $this->assertElementNotPresent('ctl0_body_Result2'); $this->type('ctl0_body_Memo','test'); $this->byName('ctl0$body$ctl0')->click(); // view 2 to select the dropdown + $this->pause(50); $this->byName('ctl0$body$ctl4')->click(); // view 3 : check if the output is updated - $this->assertContains('Your text input is: test', $this->source()); - $this->assertContains('Your color choice is: Red', $this->source()); + $this->assertSourceContains('Your text input is: test'); + $this->assertSourceContains('Your color choice is: Red'); $this->byName('ctl0$body$ctl7')->click(); // view 2 : update dropdownlist @@ -27,8 +28,8 @@ class QuickstartMultiViewTestCase extends PradoGenericSelenium2Test $this->byName('ctl0$body$ctl4')->click(); // view 3 : check if the output is updated - $this->assertContains('Your text input is: test', $this->source()); - $this->assertContains('Your color choice is: Blue', $this->source()); + $this->assertSourceContains('Your text input is: test'); + $this->assertSourceContains('Your color choice is: Blue'); $this->byName('ctl0$body$ctl7')->click(); // view 2 : check if dropdownlist maintains state diff --git a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php index 7e4a6627..c8daeff5 100755 --- a/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/PagerTestCase.php @@ -7,50 +7,50 @@ class QuickstartPagerTestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPager.Sample1&notheme=true&lang=en"); // verify datalist content - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertNotContains('ITN003', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceNotContains('ITN003'); // verify numeric paging $this->byId("ctl0_body_Pager_ctl1")->click(); // 2nd page - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertNotContains('ITN002', $this->source()); - $this->assertNotContains('ITN005', $this->source()); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceNotContains('ITN002'); + $this->assertSourceNotContains('ITN005'); $this->byId("ctl0_body_Pager_ctl3")->click(); // 4rd page - $this->assertContains('ITN007', $this->source()); - $this->assertContains('ITN008', $this->source()); - $this->assertNotContains('ITN006', $this->source()); - $this->assertNotContains('ITN009', $this->source()); + $this->assertSourceContains('ITN007'); + $this->assertSourceContains('ITN008'); + $this->assertSourceNotContains('ITN006'); + $this->assertSourceNotContains('ITN009'); $this->byId("ctl0_body_Pager_ctl6")->click(); // last page - $this->assertContains('ITN019', $this->source()); - $this->assertNotContains('ITN018', $this->source()); - $this->assertNotContains('ITN001', $this->source()); + $this->assertSourceContains('ITN019'); + $this->assertSourceNotContains('ITN018'); + $this->assertSourceNotContains('ITN001'); // verify next-prev paging $this->byId("ctl0_body_Pager2_ctl1")->click(); // prev page - $this->assertContains('ITN017', $this->source()); - $this->assertContains('ITN018', $this->source()); - $this->assertNotContains('ITN019', $this->source()); - $this->assertNotContains('ITN016', $this->source()); + $this->assertSourceContains('ITN017'); + $this->assertSourceContains('ITN018'); + $this->assertSourceNotContains('ITN019'); + $this->assertSourceNotContains('ITN016'); $this->byId("ctl0_body_Pager2_ctl0")->click(); // first page - $this->assertContains('ITN001', $this->source()); - $this->assertContains('ITN002', $this->source()); - $this->assertNotContains('ITN003', $this->source()); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('ITN002'); + $this->assertSourceNotContains('ITN003'); $this->byId("ctl0_body_Pager2_ctl2")->click(); // next page - $this->assertContains('ITN003', $this->source()); - $this->assertContains('ITN004', $this->source()); - $this->assertNotContains('ITN002', $this->source()); - $this->assertNotContains('ITN005', $this->source()); + $this->assertSourceContains('ITN003'); + $this->assertSourceContains('ITN004'); + $this->assertSourceNotContains('ITN002'); + $this->assertSourceNotContains('ITN005'); $this->assertSelected("ctl0_body_Pager3_ctl0","2"); $this->selectAndWait("ctl0_body_Pager3_ctl0", "5"); - $this->assertContains('ITN009', $this->source()); - $this->assertContains('ITN010', $this->source()); - $this->assertNotContains('ITN008', $this->source()); - $this->assertNotContains('ITN011', $this->source()); + $this->assertSourceContains('ITN009'); + $this->assertSourceContains('ITN010'); + $this->assertSourceNotContains('ITN008'); + $this->assertSourceNotContains('ITN011'); $this->selectAndWait("ctl0_body_Pager3_ctl0", "10"); - $this->assertContains('ITN019', $this->source()); - $this->assertNotContains('ITN018', $this->source()); + $this->assertSourceContains('ITN019'); + $this->assertSourceNotContains('ITN018'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php index 0d3e2797..e7f0531b 100755 --- a/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/PanelTestCase.php @@ -5,12 +5,12 @@ class QuickstartPanelTestCase extends PradoGenericSelenium2Test function test () { $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TPanel.Home&notheme=true&lang=en"); - $this->assertContains("This is panel content with", $this->source()); + $this->assertSourceContains("This is panel content with"); $this->assertElementPresent("//span[text()='label']"); - $this->assertContains("grouping text", $this->source()); + $this->assertSourceContains("grouping text"); $this->byXPath("//input[@name='ctl0\$body\$ctl17']")->click(); - $this->assertNotContains("You have clicked on 'button2'.", $this->source()); + $this->assertSourceNotContains("You have clicked on 'button2'."); $this->byXPath("//input[@type='submit' and @value='button2']")->click(); - $this->assertContains("You have clicked on 'button2'.", $this->source()); + $this->assertSourceContains("You have clicked on 'button2'."); } } diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php index 6242cebe..16a6e303 100755 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonListTestCase.php @@ -22,23 +22,23 @@ class QuickstartRadioButtonListTestCase extends PradoGenericSelenium2Test // RadioButton list's behavior upon postback $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()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: value 3, Text: item 3)"); // Auto postback check box list $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()); + $this->assertSourceContains("Your selection is: (Index: 4, Value: value 5, Text: item 5)"); // Databind to an integer-indexed array $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()); + $this->assertSourceContains("Your selection is: (Index: 0, Value: 0, Text: item 1)"); // Databind to an associative array: $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()); + $this->assertSourceContains("Your selection is: (Index: 1, Value: key 2, Text: item 2)"); // Databind with DataTextField and DataValueField specified $this->byXPath("//input[@name='ctl0\$body\$DBRadioButtonList3' and @value='003']")->click(); - $this->assertContains("Your selection is: (Index: 2, Value: 003, Text: Cary)", $this->source()); + $this->assertSourceContains("Your selection is: (Index: 2, Value: 003, Text: Cary)"); // RadioButton list causing validation $this->assertNotVisible('ctl0_body_ctl8'); diff --git a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php index 214b1596..7dfff756 100755 --- a/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/RadioButtonTestCase.php @@ -15,11 +15,11 @@ class QuickstartRadioButtonTestCase extends PradoGenericSelenium2Test $this->byXPath("//input[@name='ctl0\$body\$ctl1' and @value='value']")->click(); // an auto postback radiobutton - $this->assertNotContains("I'm clicked", $this->source()); + $this->assertSourceNotContains("I'm clicked"); $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click(); - $this->assertContains("I'm clicked", $this->source()); + $this->assertSourceContains("I'm clicked"); $this->byXPath("//input[@name='ctl0\$body\$ctl2' and @value='ctl0\$body\$ctl2']")->click(); - $this->assertContains("I'm clicked", $this->source()); + $this->assertSourceContains("I'm clicked"); // a radiobutton causing validation on a textbox $this->assertNotVisible('ctl0_body_ctl3'); @@ -27,7 +27,7 @@ class QuickstartRadioButtonTestCase extends PradoGenericSelenium2Test $this->pause(1000); $this->assertVisible('ctl0_body_ctl3'); $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click(); - $this->pause(1000); + $this->pause(500); $this->assertVisible('ctl0_body_ctl3'); $this->type("ctl0\$body\$TextBox", "test"); $this->byXPath("//input[@name='ctl0\$body\$ctl4' and @value='ctl0\$body\$ctl4']")->click(); @@ -44,13 +44,13 @@ class QuickstartRadioButtonTestCase extends PradoGenericSelenium2Test // a radiobutton group $this->byName("ctl0\$body\$ctl7")->click(); - $this->assertContains("Your selection is empty", $this->source()); + $this->assertSourceContains("Your selection is empty"); $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio2']")->click(); $this->byName("ctl0\$body\$ctl7")->click(); - $this->assertContains("Your selection is 2", $this->source()); + $this->assertSourceContains("Your selection is 2"); $this->byXPath("//input[@name='ctl0\$body\$RadioGroup' and @value='ctl0\$body\$Radio3']")->click(); $this->byXPath("//input[@name='ctl0\$body\$Radio4' and @value='ctl0\$body\$Radio4']")->click(); $this->byName("ctl0\$body\$ctl7")->click(); - $this->assertContains("Your selection is 34", $this->source()); + $this->assertSourceContains("Your selection is 34"); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php index 4d7db9b3..de027da4 100755 --- a/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Repeater1TestCase.php @@ -7,18 +7,18 @@ class QuickstartRepeater1TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample1&notheme=true&lang=en"); // verify if all required texts are present - $this->assertContains('ID', $this->source()); - $this->assertContains('Name', $this->source()); - $this->assertContains('Quantity', $this->source()); - $this->assertContains('Price', $this->source()); - $this->assertContains('Imported', $this->source()); - $this->assertContains('ITN001', $this->source()); - $this->assertContains('Motherboard', $this->source()); - $this->assertContains('Yes', $this->source()); - $this->assertContains('ITN019', $this->source()); - $this->assertContains('Speaker', $this->source()); - $this->assertContains('No', $this->source()); - $this->assertContains('Computer Parts Inventory', $this->source()); + $this->assertSourceContains('ID'); + $this->assertSourceContains('Name'); + $this->assertSourceContains('Quantity'); + $this->assertSourceContains('Price'); + $this->assertSourceContains('Imported'); + $this->assertSourceContains('ITN001'); + $this->assertSourceContains('Motherboard'); + $this->assertSourceContains('Yes'); + $this->assertSourceContains('ITN019'); + $this->assertSourceContains('Speaker'); + $this->assertSourceContains('No'); + $this->assertSourceContains('Computer Parts Inventory'); // verify specific table tags $this->assertElementPresent("//td[@colspan='5']"); diff --git a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php index 8eb8c863..d4487d6b 100755 --- a/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Repeater2TestCase.php @@ -7,12 +7,12 @@ class QuickstartRepeater2TestCase extends PradoGenericSelenium2Test $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TRepeater.Sample2&notheme=true&lang=en"); // verify if all required texts are present - $this->assertContains('North', $this->source()); - $this->assertContains('John', $this->source()); - $this->assertContains('Developer', $this->source()); - $this->assertContains('South', $this->source()); - $this->assertContains('Carter', $this->source()); - $this->assertContains('Program Manager', $this->source()); + $this->assertSourceContains('North'); + $this->assertSourceContains('John'); + $this->assertSourceContains('Developer'); + $this->assertSourceContains('South'); + $this->assertSourceContains('Carter'); + $this->assertSourceContains('Program Manager'); // verify specific table tags $this->assertElementPresent("//table[@cellspacing='1']"); diff --git a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php index df0e6f89..c0420d53 100755 --- a/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/StatementsTestCase.php @@ -8,6 +8,6 @@ class QuickstartStatementsTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('UniqueID is \'ctl0$body$ctl0\'', $this->source()); + $this->assertSourceContains('UniqueID is \'ctl0$body$ctl0\''); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php index 7ac55349..215de1ac 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard1TestCase.php @@ -9,16 +9,16 @@ class QuickstartWizard1TestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->assertContains('Wizard Step 1', $this->source()); - $this->assertNotContains('Wizard Step 2', $this->source()); + $this->assertSourceContains('Wizard Step 1'); + $this->assertSourceNotContains('Wizard Step 2'); $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); $this->select('ctl0$body$Wizard1$DropDownList1', "Purple"); $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); // step 2 - $this->assertContains('Your favorite color is: Purple', $this->source()); - $this->assertNotContains('Wizard Step 1', $this->source()); - $this->assertContains('Wizard Step 2', $this->source()); + $this->assertSourceContains('Your favorite color is: Purple'); + $this->assertSourceNotContains('Wizard Step 1'); + $this->assertSourceContains('Wizard Step 2'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php index 85ef8655..03fb401f 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard2TestCase.php @@ -9,16 +9,16 @@ class QuickstartWizard2TestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->assertContains('Please let us know your preference', $this->source()); - $this->assertNotContains('Thank you for your answer', $this->source()); + $this->assertSourceContains('Please let us know your preference'); + $this->assertSourceNotContains('Thank you for your answer'); $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton@disabled','regexp:true|disabled'); $this->select('ctl0$body$Wizard1$DropDownList1', "Blue"); $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); // step 2 - $this->assertContains('Your favorite color is: Blue', $this->source()); - $this->assertNotContains('Please let us know your preference', $this->source()); - $this->assertContains('Thank you for your answer', $this->source()); + $this->assertSourceContains('Your favorite color is: Blue'); + $this->assertSourceNotContains('Please let us know your preference'); + $this->assertSourceContains('Thank you for your answer'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php index 2568f233..9c602b09 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard3TestCase.php @@ -9,36 +9,43 @@ class QuickstartWizard3TestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->assertContains('A Mini Survey', $this->source()); - $this->assertContains('PRADO QuickStart Sample', $this->source()); + $this->assertSourceContains('A Mini Survey'); + $this->assertSourceContains('PRADO QuickStart Sample'); $this->byId('ctl0_body_Wizard3_StudentCheckBox')->click(); + $this->pause(50); $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click(); + $this->pause(50); // step 2 $this->select('ctl0$body$Wizard3$DropDownList11', "Chemistry"); + $this->pause(50); $this->byName('ctl0$body$Wizard3$ctl5$ctl1')->click(); + $this->pause(50); // step 3 $this->select('ctl0$body$Wizard3$DropDownList22', "Tennis"); + $this->pause(50); $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click(); // step 4 - $this->assertContains('You are a college student', $this->source()); - $this->assertContains('You are in major: Chemistry', $this->source()); - $this->assertContains('Your favorite sport is: Tennis', $this->source()); + $this->assertSourceContains('You are a college student'); + $this->assertSourceContains('You are in major: Chemistry'); + $this->assertSourceContains('Your favorite sport is: Tennis'); // run the example again. this time we skip the page asking about major $this->url("../../demos/quickstart/index.php?page=Controls.Samples.TWizard.Sample3&notheme=true"); // step 1 $this->byName('ctl0$body$Wizard3$ctl4$ctl0')->click(); + $this->pause(50); // step 3 $this->select('ctl0$body$Wizard3$DropDownList22', "Baseball"); + $this->pause(50); $this->byName('ctl0$body$Wizard3$ctl6$ctl1')->click(); // step 4 - $this->assertNotContains('You are a college student', $this->source()); - $this->assertContains('Your favorite sport is: Baseball', $this->source()); + $this->assertSourceNotContains('You are a college student'); + $this->assertSourceContains('Your favorite sport is: Baseball'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php index 41d3463e..469fbf5a 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard4TestCase.php @@ -9,34 +9,36 @@ class QuickstartWizard4TestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->assertContains('Step 1 of 3', $this->source()); + $this->assertSourceContains('Step 1 of 3'); $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan"); $this->byId('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton')->click(); // step 3 - $this->assertContains('Step 3 of 3', $this->source()); - $this->assertContains('Thank you for completing this survey.', $this->source()); + $this->assertSourceContains('Step 3 of 3'); + $this->assertSourceContains('Thank you for completing this survey.'); $this->byId('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton')->click(); // step 1 + $this->pause(50); $this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Cyan"); $this->select('ctl0_body_Wizard1_DropDownList1', "Black"); $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click(); // step 2 - $this->assertContains('Step 2 of 3', $this->source()); - $this->assertContains('Your favorite color is: Black', $this->source()); + $this->assertSourceContains('Step 2 of 3'); + $this->assertSourceContains('Your favorite color is: Black'); $this->byId('ctl0_body_Wizard1_ctl5_ctl0')->click(); // step 1 - $this->assertContains('Step 1 of 3', $this->source()); + $this->assertSourceContains('Step 1 of 3'); $this->assertSelected('ctl0_body_Wizard1_DropDownList1', "Black"); $this->byId('ctl0_body_Wizard1_ctl4_ctl0')->click(); // step 2 + $this->pause(50); $this->byId('ctl0_body_Wizard1_ctl5_ctl1')->click(); // step 3 - $this->assertContains('Step 3 of 3', $this->source()); + $this->assertSourceContains('Step 3 of 3'); } } diff --git a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php index 4c41a074..3ea26697 100755 --- a/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php +++ b/tests/FunctionalTests/quickstart/Controls/Wizard5TestCase.php @@ -9,27 +9,32 @@ class QuickstartWizard5TestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); // step 1 - $this->assertContains('Please let us know your preference', $this->source()); + $this->assertSourceContains('Please let us know your preference'); $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl0_SideBarButton'); $this->assertVisible('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton'); $this->assertAttribute('ctl0_body_Wizard1_SideBarList_ctl2_SideBarButton@disabled','regexp:true|disabled'); $this->select('ctl0_body_Wizard1_DropDownList1', "Cyan"); $this->byName('ctl0$body$Wizard1$ctl4$ctl0')->click(); + $this->pause(50); // step 2 $this->select('ctl0_body_Wizard1_Step2_DropDownList2','Football'); + $this->pause(50); $this->byName('ctl0$body$Wizard1$ctl6$ctl0')->click(); + $this->pause(50); // step 1 $this->assertSelected('ctl0_body_Wizard1_DropDownList1','Cyan'); $this->byId('ctl0_body_Wizard1_SideBarList_ctl1_SideBarButton')->click(); + $this->pause(50); // step 2 $this->assertSelected('ctl0_body_Wizard1_Step2_DropDownList2','Football'); $this->byName('ctl0$body$Wizard1$ctl6$ctl1')->click(); + $this->pause(50); // step 3 - $this->assertContains('Your favorite color is: Cyan', $this->source()); - $this->assertContains('Your favorite sport is: Football', $this->source()); + $this->assertSourceContains('Your favorite color is: Cyan'); + $this->assertSourceContains('Your favorite sport is: Football'); } } diff --git a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php index 8f5557ca..d44cea10 100755 --- a/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php +++ b/tests/FunctionalTests/quickstart/Fundamentals/HangmanTestCase.php @@ -6,27 +6,34 @@ class QuickstartHangmanTestCase extends PradoGenericSelenium2Test { $this->url("../../demos/quickstart/index.php?page=Fundamentals.Samples.Hangman.Home&notheme=true&lang=en"); $this->assertEquals("Hangman Game", $this->title()); - $this->assertContains("Medium game; you are allowed 5 misses.", $this->source()); + $this->assertSourceContains("Medium game; you are allowed 5 misses."); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("You must choose a difficulty level", $this->source()); + $this->assertSourceContains("You must choose a difficulty level"); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); + $this->pause(50); $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='3']")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("Please make a guess", $this->source()); - $this->assertContains("maximum of 3", $this->source()); + $this->assertSourceContains("Please make a guess"); + $this->assertSourceContains("maximum of 3"); $this->byLinkText("B")->click(); + $this->pause(50); $this->byLinkText("F")->click(); + $this->pause(50); $this->byLinkText("Give up?")->click(); - $this->assertContains("You Lose", $this->source()); + $this->assertSourceContains("You Lose"); $this->byLinkText("Start Again")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("Please make a guess", $this->source()); - $this->assertContains("maximum of 3", $this->source()); + $this->assertSourceContains("Please make a guess"); + $this->assertSourceContains("maximum of 3"); $this->byLinkText("Give up?")->click(); - $this->assertContains("You Lose", $this->source()); + $this->assertSourceContains("You Lose"); $this->byLinkText("Start Again")->click(); + $this->pause(50); $this->byXPath("//input[@name='ctl0\$body\$LevelSelection' and @value='5']")->click(); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Play!']")->click(); - $this->assertContains("maximum of 5", $this->source()); + $this->assertSourceContains("maximum of 5"); } } diff --git a/tests/FunctionalTests/quickstart/JuiControls/JuiAutoCompleteTestCase.php b/tests/FunctionalTests/quickstart/JuiControls/JuiAutoCompleteTestCase.php index a3c1ff78..fd805fed 100755 --- a/tests/FunctionalTests/quickstart/JuiControls/JuiAutoCompleteTestCase.php +++ b/tests/FunctionalTests/quickstart/JuiControls/JuiAutoCompleteTestCase.php @@ -12,7 +12,7 @@ class JuiAutoCompleteTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('TJuiAutoComplete Samples', $this->source()); + $this->assertSourceContains('TJuiAutoComplete Samples'); $base = 'ctl0_body_'; @@ -22,7 +22,7 @@ class JuiAutoCompleteTestCase extends PradoGenericSelenium2Test $this->byId("{$base}AutoComplete")->click(); $this->keys('J'); $this->pause(800); - $this->assertContains('John', $this->source()); + $this->assertSourceContains('John'); $this->byCssSelector("#{$base}AutoComplete_result ul li")->click(); $this->pause(800); diff --git a/tests/FunctionalTests/quickstart/JuiControls/JuiDialogTestCase.php b/tests/FunctionalTests/quickstart/JuiControls/JuiDialogTestCase.php index 576582e6..bc96ef2c 100755 --- a/tests/FunctionalTests/quickstart/JuiControls/JuiDialogTestCase.php +++ b/tests/FunctionalTests/quickstart/JuiControls/JuiDialogTestCase.php @@ -12,7 +12,7 @@ class JuiDialogTestCase extends PradoGenericSelenium2Test $this->assertEquals("PRADO QuickStart Sample", $this->title()); - $this->assertContains('TJuiDialog Samples', $this->source()); + $this->assertSourceContains('TJuiDialog Samples'); $base = 'ctl0_body_'; @@ -21,6 +21,8 @@ class JuiDialogTestCase extends PradoGenericSelenium2Test $this->pause(500); $this->assertVisible("${base}dlg1"); + $this->active()->click(); // close + $this->assertEmpty($this->byId("${base}lbl3")->text()); $this->byId("${base}ctl2")->click(); |