diff options
author | David <ottodavid@gmx.net> | 2015-08-06 18:12:45 +0200 |
---|---|---|
committer | David <ottodavid@gmx.net> | 2015-08-06 18:14:04 +0200 |
commit | bdfd9f07f17de1751a7e4d94940acb426af4be77 (patch) | |
tree | 093d0e40504e0ece761733780934e0d6f09888fe | |
parent | 1feb1e95660fdfeb5b6d9e12c6fe085aa2bec5ad (diff) |
Fix tests
work around stale references by explicitly waiting
118 files changed, 656 insertions, 526 deletions
diff --git a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php index acbdbb2a..9054f098 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveButtonTestCase.php @@ -6,7 +6,7 @@ class ActiveButtonTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveButtonTest"); - $this->assertContains("TActiveButton Functional Test", $this->source()); + $this->assertSourceContains("TActiveButton Functional Test"); $this->assertText("{$base}label1", "Label 1"); $this->clickOnElement("{$base}button2"); $this->pause(800); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php index c032c084..3201b8a9 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxListTestCase.php @@ -6,7 +6,7 @@ class ActiveCheckBoxListTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=TActiveCheckBoxListTest"); - $this->assertContains("TActiveCheckBoxList Test Case", $this->source()); + $this->assertSourceContains("TActiveCheckBoxList Test Case"); $this->assertText("{$base}label1", "Label 1"); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php index 782b35be..82f94b06 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveCheckBoxTestCase.php @@ -6,7 +6,7 @@ class ActiveCheckBoxTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveCheckBoxTest"); - $this->assertContains("Active CheckBox Test", $this->source()); + $this->assertSourceContains("Active CheckBox Test"); $this->assertText("{$base}checkbox1_label", "CheckBox 1"); $this->assertText("{$base}checkbox2_label", "CheckBox 2"); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php index c41988cc..e9e5f678 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveControlExpressTagTestCase.php @@ -6,8 +6,8 @@ class ActiveControlExpressionTagTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url('active-controls/index.php?page=ActiveControlExpressionTag'); - $this->assertContains('Active Control With Expression Tag Test', $this->source()); - $this->assertNotContains('Text box content:', $this->source()); + $this->assertSourceContains('Active Control With Expression Tag Test'); + $this->assertSourceNotContains('Text box content:'); $this->type("{$base}textbox1", 'Hello world'); $this->byId("{$base}button1")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php index 570a6717..f81e2129 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDatePickerTestCase.php @@ -5,7 +5,7 @@ class ActiveDatePickerTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveDatePicker"); - $this->assertContains("TActiveDatePicker test", $this->source()); + $this->assertSourceContains("TActiveDatePicker test"); $this->assertText("{$base}status", ""); $this->assertValue("{$base}datepicker", date('m-d-Y')); $this->byId("{$base}increaseButton")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php index cb8c953f..a40f45b0 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveDropDownListTestCase.php @@ -6,7 +6,7 @@ class ActiveDropDownListTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveDropDownList"); - $this->assertContains('Active Drop Down List Test Case', $this->source()); + $this->assertSourceContains('Active Drop Down List Test Case'); $this->assertText("{$base}label1", "Label 1"); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php index d4b82068..690df3f5 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveHiddenFieldTestCase.php @@ -9,7 +9,7 @@ class ActiveHiddenFieldTestCase extends PradoGenericSelenium2Test $fieldEmpty = 'No longer empty'; $fieldUsed = 'My value'; - $this->assertContains('Value of current hidden field', $this->source()); + $this->assertSourceContains('Value of current hidden field'); $this->byId("{$base}Button1")->click(); $this->pause(800); $this->assertText("{$base}ResponseLabel", $fieldEmpty); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php index 6329d826..f6117b9d 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveHyperLinkTestCase.php @@ -6,7 +6,7 @@ class ActiveHyperLinkTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveHyperLinkTest"); - $this->assertContains("Active HyperLink Test Case", $this->source()); + $this->assertSourceContains("Active HyperLink Test Case"); $this->assertText("{$base}link1", "Link 1"); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php index 0ef2e082..e008d53d 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveImageButtonTestCase.php @@ -6,7 +6,7 @@ class ActiveImageButtonTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveImageButtonTest"); - $this->assertContains("TActiveImageButton Functional Test", $this->source()); + $this->assertSourceContains("TActiveImageButton Functional Test"); $this->assertText("{$base}label1", "Label 1"); $this->byId("{$base}image1")->click(); $this->pause(800); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php index 1f7c40ea..09be4e7a 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveLinkButtonTestCase.php @@ -6,7 +6,7 @@ class ActiveLinkButtonTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveLinkButtonTest"); - $this->assertContains("TActiveLinkButton Functional Test", $this->source()); + $this->assertSourceContains("TActiveLinkButton Functional Test"); $this->assertText("{$base}label1", "Label 1"); $this->byId("{$base}button2")->click(); $this->pause(800); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php index be2bf174..a5537e34 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxMasterTestCase.php @@ -5,7 +5,7 @@ class ActiveListBoxMasterTestCase extends PradoGenericSelenium2Test function test() { $this->url("active-controls/index.php?page=ActiveListBoxMasterTest"); - $this->assertContains('Active List Box Functional Test', $this->source()); + $this->assertSourceContains('Active List Box Functional Test'); $base = 'ctl0_body_'; diff --git a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php index 1830f5ab..ee5c779e 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveListBoxTestCase.php @@ -6,7 +6,7 @@ class ActiveListBoxTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveListBoxTest"); - $this->assertContains('Active List Box Functional Test', $this->source()); + $this->assertSourceContains('Active List Box Functional Test'); $this->assertText("{$base}label1", "Label 1"); diff --git a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php index 73ab3ad0..db3999c3 100755 --- a/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActivePanelTestCase.php @@ -6,10 +6,10 @@ class ActivePanelTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActivePanelTest"); - $this->assertContains("Active Panel replacement tests", $this->source()); - $this->assertNotContains('Something lalala', $this->source()); + $this->assertSourceContains("Active Panel replacement tests"); + $this->assertSourceNotContains('Something lalala'); $this->byId("div1")->click(); $this->pause(800); - $this->assertContains("Something lalala", $this->source()); + $this->assertSourceContains("Something lalala"); } } diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php index 82408732..e6e13b52 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonListTestCase.php @@ -6,7 +6,7 @@ class ActiveRadioButtonListTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveRadioButtonListTest"); - $this->assertContains("TActiveRadioButtonList Test Case", $this->source()); + $this->assertSourceContains("TActiveRadioButtonList Test Case"); $this->assertText("{$base}label1", "Label 1"); diff --git a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php index 7606e46b..704e58dc 100755 --- a/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ActiveRadioButtonTestCase.php @@ -6,7 +6,7 @@ class ActiveRadioButtonTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveRadioButtonTest"); - $this->assertContains("Active Radio Button Test", $this->source()); + $this->assertSourceContains("Active Radio Button Test"); $this->assertText("{$base}label1", 'Label 1'); $this->assertFalse($this->byId("{$base}radio1")->selected()); diff --git a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php index 3fbf1e5e..1fc3073a 100755 --- a/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/AutoCompleteTestCase.php @@ -6,19 +6,19 @@ class AutoCompleteTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=AutoCompleteTest"); - $this->assertContains("TAutoComplete Test", $this->source()); + $this->assertSourceContains("TAutoComplete Test"); $this->assertText("{$base}label1", "Label 1"); $this->byId("{$base}textbox3")->click(); $this->keys('a'); $this->pause(800); - $this->assertContains('Andorra', $this->source()); + $this->assertSourceContains('Andorra'); $this->assertText("{$base}label1", "suggestion for a"); $this->keys('u'); $this->pause(800); - $this->assertContains('Australia', $this->source()); + $this->assertSourceContains('Australia'); $this->assertText("{$base}label1", "suggestion for au"); $this->byCssSelector("#{$base}textbox3_result ul li")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php index 9bef7d00..d1496ef4 100755 --- a/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CalculatorTestCase.php @@ -6,7 +6,7 @@ class CalculatorTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=Calculator"); - $this->assertContains("Callback Enabled Calculator", $this->source()); + $this->assertSourceContains("Callback Enabled Calculator"); $this->assertNotVisible("{$base}summary"); $this->byId("{$base}sum")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php index d5d112d8..9f825e09 100755 --- a/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CallbackAdapterTestCase.php @@ -6,9 +6,10 @@ class CallbackAdapterTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ControlAdapterTest"); - $this->assertContains('Control Adapter - State Tracking Tests', $this->source()); + $this->assertSourceContains('Control Adapter - State Tracking Tests'); $this->byId("{$base}button2")->click(); + $this->pause(50); $this->assertEquals('ok', $this->alertText()); $this->acceptAlert(); @@ -22,10 +23,12 @@ class CallbackAdapterTestCase extends PradoGenericSelenium2Test $this->pause(800); $this->byId("{$base}button1")->click(); + $this->pause(50); $this->assertEquals('haha!', $this->alertText()); $this->acceptAlert(); $this->byId("{$base}button2")->click(); + $this->pause(50); $this->assertEquals('ok', $this->alertText()); $this->acceptAlert(); $this->pause(500); @@ -36,7 +39,7 @@ class CallbackAdapterTestCase extends PradoGenericSelenium2Test function testIE() { $this->url("active-controls/index.php?page=ControlAdapterTest"); - $this->assertContains('Control Adapter - State Tracking Tests', $this->source()); + $this->assertSourceContains('Control Adapter - State Tracking Tests'); $this->byId("{$base}button2")->click(); $this->assertEquals('ok', $this->alertText()); diff --git a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php index 4c2c7070..ed7532e1 100755 --- a/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CallbackOptionsTestCase.php @@ -6,7 +6,7 @@ class CallbackOptionsTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=CallbackOptionsTest"); - $this->assertContains("TCallbackOptions Test", $this->source()); + $this->assertSourceContains("TCallbackOptions Test"); $this->assertText("label1", "Label 1"); $this->assertText("label2", "Label 2"); diff --git a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php index 3b594b39..1b5ffea2 100755 --- a/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/CustomTemplateTestCase.php @@ -6,7 +6,7 @@ class CustomTemplateTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url('active-controls/index.php?page=CustomTemplateControlTest'); - $this->assertContains('Add Dynamic Custom TTemplateControl Test', $this->source()); + $this->assertSourceContains('Add Dynamic Custom TTemplateControl Test'); $this->assertText("{$base}label1", 'Label 1'); $this->type("{$base}foo", 'Foo Bar!'); @@ -14,7 +14,7 @@ class CustomTemplateTestCase extends PradoGenericSelenium2Test $this->pause(800); $this->assertVisible("{$base}ctl0_ThePanel"); - $this->assertContains("Client ID: {$base}ctl0_ThePanel", $this->source()); + $this->assertSourceContains("Client ID: {$base}ctl0_ThePanel"); $this->assertText("{$base}label1", 'Button 1 was clicked Foo Bar! using callback!... and this is the textbox text: Foo Bar!'); } diff --git a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php index 49c268ad..406d5ffa 100755 --- a/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/DelayedCallbackTestCase.php @@ -6,7 +6,7 @@ class DelayedCallbackTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=DelayedCallback"); - $this->assertContains("Delayed Callback Test", $this->source()); + $this->assertSourceContains("Delayed Callback Test"); $this->assertText("{$base}status", ""); $this->byId("{$base}button1")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php index 7cc9a3bd..3c5a5457 100755 --- a/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/EventTriggerTestCase.php @@ -6,7 +6,7 @@ class EventTriggerTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("active-controls/index.php?page=EventTriggeredCallback"); - $this->assertContains("Event Triggered Callback Test", $this->source()); + $this->assertSourceContains("Event Triggered Callback Test"); $this->assertText("{$base}label1", 'Label 1'); diff --git a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php index f08a6f78..94e3fac6 100755 --- a/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/NestedActiveControlsTestCase.php @@ -6,14 +6,14 @@ class NestedActiveControlsTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=NestedActiveControls"); - $this->assertContains("Nested Active Controls Test", $this->source()); + $this->assertSourceContains("Nested Active Controls Test"); $this->assertText("{$base}label1", "Label 1"); $this->assertText("{$base}label2", "Label 2"); - $this->assertNotContains("Label 3", $this->source()); + $this->assertSourceNotContains("Label 3"); $this->byId("div1")->click(); $this->pause(800); - $this->assertContains("Something lalala", $this->source()); + $this->assertSourceContains("Something lalala"); $this->assertText("{$base}label3", "Label 3"); $this->byId("{$base}button1")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php index e7f7f287..392cf9e6 100755 --- a/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/PopulateListTestCase.php @@ -6,7 +6,7 @@ class PopulateListTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=PopulateActiveList"); - $this->assertContains("Populate active list controls", $this->source()); + $this->assertSourceContains("Populate active list controls"); $this->assertText("{$base}label1", ""); $this->byId("{$base}button1")->click(); diff --git a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php index 271a2ffb..9bad72e0 100755 --- a/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/PostLoadingTestCase.php @@ -6,9 +6,9 @@ class PostLoadingTestCase extends PradoGenericSelenium2Test { $base="ctl0_Content_"; $this->url('active-controls/index.php?page=PostLoadingTest'); - $this->assertContains('PostLoading Test', $this->source()); + $this->assertSourceContains('PostLoading Test'); - $this->assertNotContains('Hello World', $this->source()); + $this->assertSourceNotContains('Hello World'); $this->byId('div1')->click(); $this->pause(800); @@ -16,6 +16,6 @@ class PostLoadingTestCase extends PradoGenericSelenium2Test $this->byId("{$base}MyButton")->click(); $this->pause(800); - $this->assertContains('Result is Hello World', $this->source()); + $this->assertSourceContains('Result is Hello World'); } } diff --git a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php index c3345d6a..4a9579f2 100755 --- a/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ReplaceContentTestCase.php @@ -6,7 +6,7 @@ class ReplaceContentTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url('active-controls/index.php?page=ReplaceContentTest'); - $this->assertContains('Callback Replace Content Test', $this->source()); + $this->assertSourceContains('Callback Replace Content Test'); $this->assertText("{$base}subpanel", 'Sub Panel'); $this->assertText("{$base}panel1", "Main Panel\nSub Panel"); @@ -48,7 +48,7 @@ class ReplaceContentTestCase extends PradoGenericSelenium2Test function testIE() { $this->url('active-controls/index.php?page=ReplaceContentTest'); - $this->assertContains('Callback Replace Content Test', $this->source()); + $this->assertSourceContains('Callback Replace Content Test'); $this->assertText("{$base}subpanel", 'Sub Panel'); $this->assertText("{$base}panel1", 'regexp:Main Panel\s*Sub Panel'); diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php index 559c80a6..0d7aa0a5 100755 --- a/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TextBoxCallbackTestCase.php @@ -6,7 +6,7 @@ class TextBoxCallbackTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ActiveTextBoxCallback"); - $this->assertContains("ActiveTextBox Callback Test", $this->source()); + $this->assertSourceContains("ActiveTextBox Callback Test"); $this->assertText("{$base}label1", "Label 1"); $this->type("{$base}textbox1", "hello!"); diff --git a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php index 2562a18b..a7bb2ef9 100755 --- a/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TextBoxGroupValidationTestCase.php @@ -6,7 +6,7 @@ class TextBoxGroupValidationTestCase extends PradoGenericSelenium2Test { $base="ctl0_Content_"; $this->url("active-controls/index.php?page=TextBoxValidationCallback"); - $this->assertContains('TextBox AutoPostBack With Group Validation', $this->source()); + $this->assertSourceContains('TextBox AutoPostBack With Group Validation'); $this->assertNotVisible("{$base}validator1"); $this->type("{$base}ZipCode", 'test'); diff --git a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php index 741c7a2d..c12f2083 100755 --- a/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/TimeTriggeredCallbackTestCase.php @@ -6,7 +6,7 @@ class TimeTriggeredCallbackTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=TimeTriggeredCallbackTest"); - $this->assertContains("TimeTriggeredCallback + ViewState Tests", $this->source()); + $this->assertSourceContains("TimeTriggeredCallback + ViewState Tests"); $this->assertText("{$base}label1", "ViewState Counter :"); diff --git a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php index 8b0428a9..421c259d 100755 --- a/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php +++ b/tests/FunctionalTests/active-controls/tests/ValueTriggerCallbackTestCase.php @@ -6,7 +6,7 @@ class ValueTriggerTestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url("active-controls/index.php?page=ValueTriggerCallbackTest"); - $this->assertContains("Value Trigger Callback Test", $this->source()); + $this->assertSourceContains("Value Trigger Callback Test"); $this->assertText("{$base}label1", 'Label 1'); diff --git a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php index 2b9a0166..e953bdab 100755 --- a/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php +++ b/tests/FunctionalTests/active-controlstests/ActiveRatingListTestCase.php @@ -26,7 +26,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListCheckBoxesTest"); - $this->assertContains("TActiveRatingList Check Boxes Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList Check Boxes Test Case"); $this->assertCheckBoxes("{$base}RatingList", array(2), 6); // Change the list and make sure the radio buttons get updated properly. @@ -44,7 +44,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListRatingTest"); - $this->assertContains("TActiveRatingList Rating Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList Rating Test Case"); // Check the list, make sure it starts out with 5 stars. $this->assertText("{$base}Status", "Rating: 5"); @@ -65,7 +65,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListSelectedIndexTest"); - $this->assertContains("TActiveRatingList SelectedIndex Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList SelectedIndex Test Case"); $this->assertText("{$base}Status", "SelectedIndex: 1"); // Click on 5 stars and make sure the SelectedIndex property updates. @@ -84,7 +84,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListAutoPostBackTest"); - $this->assertContains("TActiveRatingList AutoPostBack Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList AutoPostBack Test Case"); $this->assertText("{$base}Status", "AutoPostback=false"); // Make sure that it doesn't auto post when clicked. @@ -103,7 +103,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListAllowInputTest"); - $this->assertContains("TActiveRatingList AllowInput Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList AllowInput Test Case"); $this->assertText("{$base}Status", "AllowInput=false"); $this->assertCheckBoxes("{$base}RatingList", array(3), 6); @@ -119,7 +119,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListReadOnlyTest"); - $this->assertContains("TActiveRatingList ReadOnly Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList ReadOnly Test Case"); $this->assertText("{$base}Status", "ReadOnly=true"); $this->assertCheckBoxes("{$base}RatingList", array(0), 6); @@ -158,7 +158,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListEnabledTest"); - $this->assertContains("TActiveRatingList Enabled Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList Enabled Test Case"); $this->assertText("{$base}Status", "Enabled=false"); $this->assertCheckBoxes("{$base}RatingList", array(5), 6); @@ -197,7 +197,7 @@ class ActiveRatingListTestCase extends PradoGenericSelenium2Test $base='ctl0_Content_'; // Verify we're on the right page. $this->url("active-controls/index.php?page=ActiveRatingListHoverCaptionTest"); - $this->assertContains("TActiveRatingList Hover Caption Test Case", $this->source()); + $this->assertSourceContains("TActiveRatingList Hover Caption Test Case"); $this->assertText("{$base}Status", "CaptionID='Status'"); $this->assertElementPresent("//input[@id='{$base}RatingList_c0']/../../../td[contains(@class, 'rating_selected')]"); $this->assertElementPresent("//input[@id='{$base}RatingList_c1']/../../../td[contains(@class, 'rating_selected')]"); diff --git a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php index 5292affb..697fb84a 100755 --- a/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php +++ b/tests/FunctionalTests/features/protected/pages/I18N/BasicI18N.php @@ -33,12 +33,12 @@ class BasicI18NTestCase extends PradoGenericSelenium2Test function testI18N() { $this->assertEquals("Basic I18N Test", $this->title()); - $this->assertContains("Hello", $this->source()); + $this->assertSourceContains("Hello"); $this->assertContains("US$10,000.00", $this->source()); - $this->assertContains("2006年1月15日 上午12时00分00秒", $this->source()); - $this->assertContains("None", $this->source()); - $this->assertContains("One thing.", $this->source()); - $this->assertContains("Many things.", $this->source()); + $this->assertSourceContains("2006年1月15日 上午12时00分00秒"); + $this->assertSourceContains("None"); + $this->assertSourceContains("One thing."); + $this->assertSourceContains("Many things."); } } */
\ No newline at end of file diff --git a/tests/FunctionalTests/features/tests/MyTestCase.php b/tests/FunctionalTests/features/tests/MyTestCase.php index d748b6b0..870d2684 100755 --- a/tests/FunctionalTests/features/tests/MyTestCase.php +++ b/tests/FunctionalTests/features/tests/MyTestCase.php @@ -5,6 +5,6 @@ class MyTestCase extends PradoGenericSelenium2Test function test1() { $this->url('http://127.0.0.1'); - $this->assertNotContains('asd', $this->source()); + $this->assertSourceNotContains('asd'); } } diff --git a/tests/FunctionalTests/issues/tests/Issue504TestCase.php b/tests/FunctionalTests/issues/tests/Issue504TestCase.php index dff27339..ce3e346e 100755 --- a/tests/FunctionalTests/issues/tests/Issue504TestCase.php +++ b/tests/FunctionalTests/issues/tests/Issue504TestCase.php @@ -5,11 +5,12 @@ class Issue504TestCase extends PradoGenericSelenium2Test function test() { $this->url('issues/index.php?page=Issue504'); - $this->assertContains('Issue 504 Test', $this->source()); + $this->assertSourceContains('Issue 504 Test'); $base='ctl0_Content_'; $this->byID("{$base}textbox1")->click(); $this->keys(PHPUnit_Extensions_Selenium2TestCase_Keys::ENTER); + $this->pause(50); $this->assertText("{$base}label1", "buttonOkClick"); } diff --git a/tests/FunctionalTests/issues/tests/Issue516TestCase.php b/tests/FunctionalTests/issues/tests/Issue516TestCase.php index 363e9f84..2b221081 100644 --- a/tests/FunctionalTests/issues/tests/Issue516TestCase.php +++ b/tests/FunctionalTests/issues/tests/Issue516TestCase.php @@ -5,7 +5,7 @@ class Issue516TestCase extends PradoGenericSelenium2Test function test() { $this->url('issues/index.php?page=Issue516'); - $this->assertContains('Issue 516 Test', $this->source()); + $this->assertSourceContains('Issue 516 Test'); $base='ctl0_Content_'; $row1='DataGrid_ctl1_'; $row2='DataGrid_ctl2_'; diff --git a/tests/FunctionalTests/issues/tests/Issue524TestCase.php b/tests/FunctionalTests/issues/tests/Issue524TestCase.php index b7b022b2..7b3bb2aa 100755 --- a/tests/FunctionalTests/issues/tests/Issue524TestCase.php +++ b/tests/FunctionalTests/issues/tests/Issue524TestCase.php @@ -10,7 +10,7 @@ class Issue524TestCase extends PradoGenericSelenium2Test function test() { $this->url('issues/index.php?page=Issue524'); - $this->assertContains('Issue 524 Test', $this->source()); + $this->assertSourceContains('Issue 524 Test'); $base='ctl0_Content_'; $this->byID("{$base}buttonOk")->click(); 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(); diff --git a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php index 0c6945ba..90076347 100755 --- a/tests/FunctionalTests/tickets/tests/Issue120TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Issue120TestCase.php @@ -5,7 +5,7 @@ class Issue120TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Issue120'); - $this->assertContains('TActiveDropDownList PromptValue Test', $this->source()); + $this->assertSourceContains('TActiveDropDownList PromptValue Test'); $this->assertSelectedIndex("ctl0_Content_ddl1", 0); $this->assertSelectedValue("ctl0_Content_ddl1", 'PromptValue'); diff --git a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php index d71db0e1..819f38aa 100755 --- a/tests/FunctionalTests/tickets/tests/Issue216TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Issue216TestCase.php @@ -5,7 +5,7 @@ class Issue216TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Issue216'); - $this->assertContains('TTabPanel doesn\'t preserve active tab on callback request', $this->source()); + $this->assertSourceContains('TTabPanel doesn\'t preserve active tab on callback request'); $this->assertVisible('ctl0_Content_tab1'); diff --git a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php index 547ffb38..58bb6784 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket121TestCase.php @@ -12,6 +12,6 @@ class Ticket121TestCase extends PradoGenericSelenium2Test $this->type("ctl0\$Content\$FooTextBox", "content"); $this->byXPath("//input[@type='image' and @id='ctl0_Content_ctl0']")->click(); $this->assertNotVisible('ctl0_Content_ctl1'); - $this->assertContains("clicked at", $this->source()); + $this->assertSourceContains("clicked at"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php index c0bccaa9..77f70262 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket191TestCase.php @@ -7,6 +7,7 @@ class Ticket191TestCase extends PradoGenericSelenium2Test $this->url('tickets/index.php?page=Ticket191'); $this->type("ctl0\$Content\$TextBox2", "test"); $this->byName("ctl0\$Content\$ctl0")->click(); + $this->pause(50); $this->type("ctl0\$Content\$TextBox", "test"); $this->byName("ctl0\$Content\$ctl1")->click(); $this->assertNotVisible('ctl0_Content_ctl2'); diff --git a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php index 35274e6f..0c3b93b0 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket205TestCase.php @@ -13,6 +13,7 @@ class Ticket205TestCase extends PradoGenericSelenium2Test $this->type("{$base}textbox1", "test"); $this->byId("{$base}button1")->click(); + $this->pause(50); $this->assertEquals("error", $this->alertText()); $this->acceptAlert(); @@ -23,7 +24,6 @@ class Ticket205TestCase extends PradoGenericSelenium2Test $this->typeSpecial("{$base}textbox1", "Prado"); $this->byId("{$base}button1")->click(); - $validator=$this->byId("{$base}validator1"); - $this->assertFalse($validator->displayed()); + $this->assertNotVisible("${base}validator1"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php index b9a0f0c9..08286020 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket21TestCase.php @@ -7,8 +7,8 @@ class Ticket21TestCase extends PradoGenericSelenium2Test $this->url('tickets/index.php?page=Ticket21'); $this->assertEquals($this->title(), "Verifying Ticket 21"); $this->byId("ctl0_Content_button1")->click(); - $this->assertContains("Radio button clicks: 1", $this->source()); + $this->assertSourceContains("Radio button clicks: 1"); $this->byId("ctl0_Content_button1")->click(); - $this->assertContains("Radio button clicks: 1", $this->source()); + $this->assertSourceContains("Radio button clicks: 1"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php index 3b31b23d..c1b4b5db 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket220TestCase.php @@ -6,7 +6,7 @@ class Ticket220TestCase extends PradoGenericSelenium2Test { $base="ctl0_Content_"; $this->url('tickets/index.php?page=Ticket220'); - $this->assertContains('ClientScript Test', $this->source()); + $this->assertSourceContains('ClientScript Test'); $this->assertText("{$base}label1", "Label 1"); $this->byId("button1")->click(); diff --git a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php index 74ad6505..7cb8ce05 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket225TestCase.php @@ -6,7 +6,7 @@ class Ticket225TestCase extends PradoGenericSelenium2Test { $base="ctl0_Content_"; $this->url('tickets/index.php?page=Ticket225'); - $this->assertContains('RadioButton Group Tests', $this->source()); + $this->assertSourceContains('RadioButton Group Tests'); $this->assertText("{$base}label1", "Label 1"); $this->assertNotVisible("{$base}validator1"); @@ -16,7 +16,7 @@ class Ticket225TestCase extends PradoGenericSelenium2Test $this->byId("{$base}button2")->click(); $this->byId("{$base}button4")->click(); - $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3'); $this->assertNotVisible("{$base}validator1"); + $this->assertText("{$base}label1", 'ctl0$Content$button1 ctl0$Content$button2 ctl0$Content$button3'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php index e5595a13..1199131d 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket239TestCase.php @@ -7,47 +7,47 @@ class Ticket239TestCase extends PradoGenericSelenium2Test $this->url('tickets/index.php?page=Ticket239'); // view1 - $this->assertContains('view1 is activated', $this->source()); - $this->assertNotContains('view1 is deactivated', $this->source()); - $this->assertNotContains('view2 is activated', $this->source()); - $this->assertNotContains('view2 is deactivated', $this->source()); - $this->assertNotContains('view3 is activated', $this->source()); - $this->assertNotContains('view3 is deactivated', $this->source()); + $this->assertSourceContains('view1 is activated'); + $this->assertSourceNotContains('view1 is deactivated'); + $this->assertSourceNotContains('view2 is activated'); + $this->assertSourceNotContains('view2 is deactivated'); + $this->assertSourceNotContains('view3 is activated'); + $this->assertSourceNotContains('view3 is deactivated'); // goto view2 $this->byName('ctl0$Content$ctl1')->click(); - $this->assertNotContains('view1 is activated', $this->source()); - $this->assertContains('view1 is deactivated', $this->source()); - $this->assertContains('view2 is activated', $this->source()); - $this->assertNotContains('view2 is deactivated', $this->source()); - $this->assertNotContains('view3 is activated', $this->source()); - $this->assertNotContains('view3 is deactivated', $this->source()); + $this->assertSourceNotContains('view1 is activated'); + $this->assertSourceContains('view1 is deactivated'); + $this->assertSourceContains('view2 is activated'); + $this->assertSourceNotContains('view2 is deactivated'); + $this->assertSourceNotContains('view3 is activated'); + $this->assertSourceNotContains('view3 is deactivated'); // goto view3 $this->byName('ctl0$Content$ctl3')->click(); - $this->assertNotContains('view1 is activated', $this->source()); - $this->assertNotContains('view1 is deactivated', $this->source()); - $this->assertNotContains('view2 is activated', $this->source()); - $this->assertContains('view2 is deactivated', $this->source()); - $this->assertContains('view3 is activated', $this->source()); - $this->assertNotContains('view3 is deactivated', $this->source()); + $this->assertSourceNotContains('view1 is activated'); + $this->assertSourceNotContains('view1 is deactivated'); + $this->assertSourceNotContains('view2 is activated'); + $this->assertSourceContains('view2 is deactivated'); + $this->assertSourceContains('view3 is activated'); + $this->assertSourceNotContains('view3 is deactivated'); // goto view2 $this->byName('ctl0$Content$ctl4')->click(); - $this->assertNotContains('view1 is activated', $this->source()); - $this->assertNotContains('view1 is deactivated', $this->source()); - $this->assertContains('view2 is activated', $this->source()); - $this->assertNotContains('view2 is deactivated', $this->source()); - $this->assertNotContains('view3 is activated', $this->source()); - $this->assertContains('view3 is deactivated', $this->source()); + $this->assertSourceNotContains('view1 is activated'); + $this->assertSourceNotContains('view1 is deactivated'); + $this->assertSourceContains('view2 is activated'); + $this->assertSourceNotContains('view2 is deactivated'); + $this->assertSourceNotContains('view3 is activated'); + $this->assertSourceContains('view3 is deactivated'); // goto view1 $this->byName('ctl0$Content$ctl2')->click(); - $this->assertContains('view1 is activated', $this->source()); - $this->assertNotContains('view1 is deactivated', $this->source()); - $this->assertNotContains('view2 is activated', $this->source()); - $this->assertContains('view2 is deactivated', $this->source()); - $this->assertNotContains('view3 is activated', $this->source()); - $this->assertNotContains('view3 is deactivated', $this->source()); + $this->assertSourceContains('view1 is activated'); + $this->assertSourceNotContains('view1 is deactivated'); + $this->assertSourceNotContains('view2 is activated'); + $this->assertSourceContains('view2 is deactivated'); + $this->assertSourceNotContains('view3 is activated'); + $this->assertSourceNotContains('view3 is deactivated'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php index b4a32c19..c6f1ee4c 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket284TestCase.php @@ -5,7 +5,7 @@ class Ticket284TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Ticket284'); - $this->assertContains('Verifying Ticket 284', $this->source()); + $this->assertSourceContains('Verifying Ticket 284'); $this->byId('ctl0_Content_ctl1')->click(); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php index 04a451df..9aee012e 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket285TestCase.php @@ -5,7 +5,7 @@ class Ticket285TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Ticket285'); - $this->assertContains('350.00', $this->source()); - $this->assertContains('349.99', $this->source()); + $this->assertSourceContains('350.00'); + $this->assertSourceContains('349.99'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php index 92bf1eb9..8926887c 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket28TestCase.php @@ -6,8 +6,8 @@ class Ticket28TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Ticket28'); - $this->assertContains('Label 1', $this->source()); + $this->assertSourceContains('Label 1'); $this->byLinkText("Click Me")->click(); - $this->assertContains('Link Button 1 Clicked!', $this->source()); + $this->assertSourceContains('Link Button 1 Clicked!'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php index 7f9bc58c..c4486dbc 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket477TestCase.php @@ -11,8 +11,8 @@ class Ticket477TestCase extends PradoGenericSelenium2Test $this->assertNotVisible("{$base}validator2"); $this->byId("{$base}list1_c1")->click(); - $this->assertVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); + $this->assertVisible("{$base}validator1"); $this->byId("{$base}list2_c1")->click(); diff --git a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php index e4b72aaf..191ef21b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket488TestCase.php @@ -6,7 +6,7 @@ class Ticket488TestCase extends PradoGenericSelenium2Test { $base='ctl0_Content_'; $this->url('active-controls/index.php?page=CustomValidatorByPass'); - $this->assertContains('Custom Login', $this->source()); + $this->assertSourceContains('Custom Login'); $this->assertNotVisible('loginBox'); $this->byId("showLogin")->click(); $this->assertVisible("loginBox"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php index cf1433b6..89a2e721 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket54TestCase.php @@ -5,6 +5,6 @@ class Ticket54TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Ticket54'); - $this->assertContains("|A|a|B|b|C|", $this->source()); + $this->assertSourceContains("|A|a|B|b|C|"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php index 5fd47f86..2522786b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket586TestCase.php @@ -10,6 +10,7 @@ class Ticket586TestCase extends PradoGenericSelenium2Test $this->assertText("{$base}label1", "Status"); $this->byId("{$base}button1")->click(); + $this->pause(50); $this->assertText("{$base}label1", "Button 1 Clicked!"); $this->type("{$base}text1", "testing"); diff --git a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php index 8b5a0166..9657f28d 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket669TestCase.php @@ -7,7 +7,7 @@ class Ticket669TestCase extends PradoGenericSelenium2Test $this->url('tickets/index.php?page=Ticket669'); $this->assertEquals($this->title(), "Verifying Ticket 669"); - $this->assertContains('1 - Test without callback', $this->source()); + $this->assertSourceContains('1 - Test without callback'); $this->assertValue($base.'tb1', 'ActiveTextBox'); $this->assertValue($base.'tb2', 'TextBox in ActivePanel'); @@ -18,7 +18,7 @@ class Ticket669TestCase extends PradoGenericSelenium2Test $this->byId($base.'ctl1')->click(); $this->pause(800); - $this->assertContains('2 - Test callback with 2nd ActivePanel', $this->source()); + $this->assertSourceContains('2 - Test callback with 2nd ActivePanel'); $this->assertValue($base.'tb3', 'ActiveTextBox'); $this->assertValue($base.'tb4', 'TextBox in ActivePanel'); $this->assertValue($base.'tb5', 'TextBox in ActivePanel'); @@ -32,7 +32,7 @@ class Ticket669TestCase extends PradoGenericSelenium2Test $this->byId($base.'ctl2')->click(); $this->pause(800); - $this->assertContains('3 - Test callback without 2nd ActivePanel', $this->source()); + $this->assertSourceContains('3 - Test callback without 2nd ActivePanel'); $this->assertValue($base.'tb6', 'ActiveTextBox'); $this->assertValue($base.'tb7', 'TextBox in Panel'); diff --git a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php index d10529ce..ec6d7783 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket700TestCase.php @@ -6,66 +6,77 @@ class Ticket700TestCase extends PradoGenericSelenium2Test // page: Home $this->url('tickets/index700.php'); $this->byId('ctl0_Logout')->click(); + $this->pause(50); $this->byId('pageHome')->click(); - $this->assertEquals($this->title(), "Home"); - $this->assertContains('|Param1: Set at app config|', $this->source()); - $this->assertContains('|Param2: Set at root|', $this->source()); - $this->assertContains('|Param3: default 3|', $this->source()); - $this->assertContains('|Param4: default 4|', $this->source()); - $this->assertContains('|Param5: Set at root|', $this->source()); + $this->assertTitleEquals('Home'); + $this->assertSourceContains('|Param1: Set at app config|'); + $this->assertSourceContains('|Param2: Set at root|'); + $this->assertSourceContains('|Param3: default 3|'); + $this->assertSourceContains('|Param4: default 4|'); + $this->assertSourceContains('|Param5: Set at root|'); // page: admin.Home $this->byId('pageAdminHome')->click(); - $this->assertEquals($this->title(), 'UserLogin'); + $this->assertTitleEquals('UserLogin'); $this->type('ctl0_Main_Username','AdminUser'); $this->type('ctl0_Main_Password','demo'); $this->byId('ctl0_Main_LoginButton')->click(); + $this->pause(50); $this->byId('pageAdminHome')->click(); - $this->assertEquals($this->title(), 'admin.Home'); - $this->assertContains('|Param1: Set at app config|', $this->source()); - $this->assertContains('|Param2: Set at admin|', $this->source()); - $this->assertContains('|Param3: Set at admin|', $this->source()); - $this->assertContains('|Param4: Set at app config|', $this->source()); - $this->assertContains('|Param5: Set at app config|', $this->source()); + $this->assertTitleEquals('admin.Home'); + $this->assertSourceContains('|Param1: Set at app config|'); + $this->assertSourceContains('|Param2: Set at admin|'); + $this->assertSourceContains('|Param3: Set at admin|'); + $this->assertSourceContains('|Param4: Set at app config|'); + $this->assertSourceContains('|Param5: Set at app config|'); // page: admin.Home2 $this->byId('pageAdminHome2')->click(); - $this->assertEquals($this->title(), 'admin.Home2'); + $this->assertTitleEquals('admin.Home2'); $this->byId('ctl0_Logout')->click(); + $this->pause(50); $this->byId('pageAdminHome2')->click(); - $this->assertEquals($this->title(), 'admin.Home2'); + $this->assertTitleEquals('admin.Home2'); // page: admin.users.Home $this->byId('pageAdminUsersHome')->click(); - $this->assertEquals($this->title(), 'UserLogin'); + $this->assertTitleEquals('UserLogin'); $this->type('ctl0_Main_Username','NormalUser'); $this->type('ctl0_Main_Password','demo'); $this->byId('ctl0_Main_LoginButton')->click(); + $this->pause(50); $this->byId('pageAdminUsersHome')->click(); - $this->assertEquals($this->title(), 'UserLogin'); + $this->assertTitleEquals('UserLogin'); $this->type('ctl0_Main_Username','AdminUser'); $this->type('ctl0_Main_Password','demo'); $this->byId('ctl0_Main_LoginButton')->click(); $this->byId('pageAdminUsersHome')->click(); - $this->assertEquals($this->title(), 'admin.users.Home'); - $this->assertContains('|Param1: Set at admin|', $this->source()); - $this->assertContains('|Param2: Set at admin.users|', $this->source()); - $this->assertContains('|Param3: default 3|', $this->source()); - $this->assertContains('|Param4: Set at admin|', $this->source()); - $this->assertContains('|Param5: Set at app config|', $this->source()); + $this->assertTitleEquals('admin.users.Home'); + $this->assertSourceContains('|Param1: Set at admin|'); + $this->assertSourceContains('|Param2: Set at admin.users|'); + $this->assertSourceContains('|Param3: default 3|'); + $this->assertSourceContains('|Param4: Set at admin|'); + $this->assertSourceContains('|Param5: Set at app config|'); // page: admin.users.Home2 $this->byId('pageAdminUsersHome2')->click(); - $this->assertEquals($this->title(), 'admin.users.Home2'); + $this->assertTitleEquals('admin.users.Home2'); // page: content.Home $this->byId('pageContentHome')->click(); - $this->assertEquals($this->title(), 'content.Home'); - $this->assertContains('|Param1: Set at app config|', $this->source()); - $this->assertContains('|Param2: Set at root|', $this->source()); - $this->assertContains('|Param3: default 3|', $this->source()); - $this->assertContains('|Param4: default 4|', $this->source()); - $this->assertContains('|Param5: Set at app config|', $this->source()); + $this->assertTitleEquals('content.Home'); + $this->assertSourceContains('|Param1: Set at app config|'); + $this->assertSourceContains('|Param2: Set at root|'); + $this->assertSourceContains('|Param3: default 3|'); + $this->assertSourceContains('|Param4: default 4|'); + $this->assertSourceContains('|Param5: Set at app config|'); $this->byId('ctl0_Logout')->click(); } + + public function assertTitleEquals($title) + { + $this->pause(50); + $this->assertEquals($this->title(), $title); + } + }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php index 7c4a1d67..73ecaecc 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket719TestCase.php @@ -5,7 +5,7 @@ class Ticket719TestCase extends PradoGenericSelenium2Test function test() { $this->url("tickets/index.php?page=Ticket719"); - $this->assertContains("Verifying Ticket 719", $this->source()); + $this->assertSourceContains("Verifying Ticket 719"); $base="ctl0_Content_"; @@ -18,15 +18,15 @@ class Ticket719TestCase extends PradoGenericSelenium2Test $this->keys('f'); $this->pause(500); - $this->assertContains('Finland', $this->source()); + $this->assertSourceContains('Finland'); $this->keys('r'); $this->pause(500); - $this->assertContains('French', $this->source()); + $this->assertSourceContains('French'); $this->keys('a'); $this->pause(500); - $this->assertContains('France', $this->source()); + $this->assertSourceContains('France'); $this->byCssSelector("#${base}autocomplete_result ul li")->click(); $this->pause(800); diff --git a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php index 91fc9420..b1c576be 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket72TestCase.php @@ -8,7 +8,7 @@ class Ticket72TestCase extends PradoGenericSelenium2Test $this->type("ctl0\$Content\$K1", "abc"); $this->type("ctl0\$Content\$K2", "efg"); $this->byXPath("//input[@type='submit' and @value='Send']")->click(); - $this->assertContains("efg", $this->source()); - $this->assertNotContains("abcefg", $this->source()); + $this->assertSourceContains("efg"); + $this->assertSourceNotContains("abcefg"); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php index 690df8a1..367ee2fe 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket745TestCase.php @@ -10,7 +10,7 @@ class Ticket745TestCase extends PradoGenericSelenium2Test $this->select($base.'Wizard1_DropDownList1', 'Green'); $this->byId($base.'Wizard1_ctl4_ctl1')->click(); $this->pause(800); - $this->assertContains('Step 3 of 3', $this->source()); + $this->assertSourceContains('Step 3 of 3'); } }
\ No newline at end of file diff --git a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php index 361235fc..a34dd695 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket876TestCase.php @@ -15,7 +15,7 @@ class Ticket876TestCase extends PradoGenericSelenium2Test { $this->select($base.'Date_day', 22); $this->byId($base.'SendButton')->click(); - $this->assertContains('2008-10-22', $this->source());*/ + $this->assertSourceContains('2008-10-22');*/ } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php index 7f9c23f3..4eaf9c6b 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket886TestCase.php @@ -8,7 +8,7 @@ class Ticket886TestCase extends PradoGenericSelenium2Test $this->assertEquals($this->title(), "Verifying Ticket 886"); $base = 'ctl0_Content_'; $this->byId($base.'SendButton')->click(); - $this->assertContains(date('Y').'-01-01', $this->source()); + $this->assertSourceContains(date('Y').'-01-01'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php index e3bac037..f3a8c14d 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket897TestCase.php @@ -12,7 +12,7 @@ class Ticket897TestCase extends PradoGenericSelenium2Test $this->select($base.'Date_day', 22); $this->byId($base.'SendButton')->click(); - $this->assertContains(date('Y').'-10-22', $this->source()); + $this->assertSourceContains(date('Y').'-10-22'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php index fc0bcc01..53e8e048 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket900TestCase.php @@ -9,9 +9,12 @@ class Ticket900TestCase extends PradoGenericSelenium2Test $base = 'ctl0_Content_'; $this->byName('ctl0$Content$DataGrid$ctl1$ctl3')->click(); + $this->pause(50); $this->type($base.'DataGrid_ctl1_TextBox', ''); $this->byId($base.'DataGrid_ctl1_ctl3')->click(); + $this->pause(50); $this->byName('ctl0$Content$DataGrid$ctl1$ctl4')->click(); + $this->pause(50); $this->assertText($base.'CommandName', 'cancel'); } } diff --git a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php index f03f980e..ddc01d28 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket922TestCase.php @@ -10,6 +10,7 @@ class Ticket922TestCase extends PradoGenericSelenium2Test $this->type($base.'Text', 'two words'); $this->byName('ctl0$Content$ctl0')->click(); + $this->pause(50); $this->assertText($base.'Result','two words'); } diff --git a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php index 538860d4..fa08d396 100755 --- a/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php +++ b/tests/FunctionalTests/tickets/tests/Ticket93TestCase.php @@ -9,7 +9,7 @@ class Ticket93TestCase extends PradoGenericSelenium2Test function test() { $this->url('tickets/index.php?page=Ticket93'); - $this->assertContains("ValidationGroups without any inputs with grouping", $this->source()); + $this->assertSourceContains("ValidationGroups without any inputs with grouping"); } } diff --git a/tests/FunctionalTests/validators/tests/ButtonTestCase.php b/tests/FunctionalTests/validators/tests/ButtonTestCase.php index 90265156..7fc533a4 100755 --- a/tests/FunctionalTests/validators/tests/ButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ButtonTestCase.php @@ -20,13 +20,13 @@ class ButtonTestCase extends PradoGenericSelenium2Test // verify the first validation is passed $this->pause(500); - $this->assertNotContains('Button1 is clicked', $this->source()); + $this->assertSourceNotContains('Button1 is clicked'); $this->type("ctl0_Content_TextBox1", "test"); $this->byId("ctl0_Content_ctl1")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button1 is clicked and valid', $this->source()); + $this->assertSourceContains('Button1 is clicked and valid'); // verify the second validator shows the error $this->byId("ctl0_Content_ctl3")->click(); @@ -36,13 +36,13 @@ class ButtonTestCase extends PradoGenericSelenium2Test // verify the second validation is passed $this->pause(500); - $this->assertNotContains('Button2 is clicked', $this->source()); + $this->assertSourceNotContains('Button2 is clicked'); $this->type("ctl0_Content_TextBox2", "test"); $this->byId("ctl0_Content_ctl3")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button2 is clicked and valid', $this->source()); + $this->assertSourceContains('Button2 is clicked and valid'); // verify the third validator shows the error $this->byId("ctl0_Content_ctl5")->click(); @@ -51,13 +51,13 @@ class ButtonTestCase extends PradoGenericSelenium2Test $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->assertContains('Button3 is clicked', $this->source()); - $this->assertNotContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked'); + $this->assertSourceNotContains('Button3 is clicked and valid'); $this->type("ctl0_Content_TextBox3", "test"); $this->byId("ctl0_Content_ctl5")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php index 8e6e1583..2eaa3d4a 100755 --- a/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php +++ b/tests/FunctionalTests/validators/tests/CheckBoxTestCase.php @@ -20,14 +20,15 @@ class CheckBoxTestCase extends PradoGenericSelenium2Test // verify the first validation is passed $this->pause(500); - $this->assertNotContains('Button1 is clicked', $this->source()); + $this->assertSourceNotContains('Button1 is clicked'); $this->type("ctl0_Content_TextBox1", "test"); $this->byId("ctl0_Content_ctl1")->click(); + $this->pause(50); $this->byId("ctl0_Content_ctl1")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button1 is clicked and valid', $this->source()); + $this->assertSourceContains('Button1 is clicked and valid'); // verify the second validator shows the error $this->byId("ctl0_Content_ctl3")->click(); @@ -37,14 +38,15 @@ class CheckBoxTestCase extends PradoGenericSelenium2Test // verify the second validation is passed $this->pause(500); - $this->assertNotContains('Button2 is clicked', $this->source()); + $this->assertSourceNotContains('Button2 is clicked'); $this->type("ctl0_Content_TextBox2", "test"); $this->byId("ctl0_Content_ctl3")->click(); + $this->pause(50); $this->byId("ctl0_Content_ctl3")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button2 is clicked and valid', $this->source()); + $this->assertSourceContains('Button2 is clicked and valid'); // verify the third validator shows the error $this->byId("ctl0_Content_ctl5")->click(); @@ -53,13 +55,13 @@ class CheckBoxTestCase extends PradoGenericSelenium2Test $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->assertContains('Button3 is clicked', $this->source()); - $this->assertNotContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked'); + $this->assertSourceNotContains('Button3 is clicked and valid'); $this->type("ctl0_Content_TextBox3", "test"); $this->byId("ctl0_Content_ctl5")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php index f9652e76..1f1a1e12 100755 --- a/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CompareValidatorTestCase.php @@ -8,7 +8,7 @@ class CompareValidatorTestCase extends PradoGenericSelenium2Test $base = "ctl0_Content_"; $this->url("validators/index.php?page=CompareValidator"); - $this->assertContains("Prado CompareValidator Tests", $this->source()); + $this->assertSourceContains("Prado CompareValidator Tests"); $this->type("{$base}text1", "qwe"); $this->assertNotVisible("{$base}validator1"); diff --git a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php index 32e79a90..1629578b 100755 --- a/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php +++ b/tests/FunctionalTests/validators/tests/ConditionalValidationTestCase.php @@ -6,7 +6,7 @@ class ConditionalValidationTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=ConditionalValidation"); - $this->assertContains("Conditional Validation (clientside + server side)", $this->source()); + $this->assertSourceContains("Conditional Validation (clientside + server side)"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); @@ -21,6 +21,7 @@ class ConditionalValidationTestCase extends PradoGenericSelenium2Test $this->byId("{$base}check1")->click(); $this->byId("{$base}submit1")->click(); + $this->pause(50); $this->assertVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); diff --git a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php index ca48a453..1771e7df 100755 --- a/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/CustomValidatorTestCase.php @@ -7,7 +7,7 @@ class CustomValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=CustomValidator"); - $this->assertContains("Prado CustomValidator Tests", $this->source()); + $this->assertSourceContains("Prado CustomValidator Tests"); $this->assertNotVisible("{$base}validator1"); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); diff --git a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php index 3b5ebfcb..9f313572 100755 --- a/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/DataTypeValidatorTestCase.php @@ -9,7 +9,7 @@ class DataTypeValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=DataTypeValidator"); - $this->assertContains("Data Type Validator Tests", $this->source()); + $this->assertSourceContains("Data Type Validator Tests"); $this->byXPath("//input[@type='submit' and @value='submit!']")->click(); $this->pause(500); diff --git a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php index 953c2f16..c5a61d25 100755 --- a/tests/FunctionalTests/validators/tests/DatePickerTestCase.php +++ b/tests/FunctionalTests/validators/tests/DatePickerTestCase.php @@ -8,7 +8,7 @@ class DatePickerTestCase extends PradoGenericSelenium2Test $year2=2013; $base = "ctl0_Content_"; $this->url("validators/index.php?page=DatePicker"); - $this->assertContains("Date Picker validation Test", $this->source()); + $this->assertSourceContains("Date Picker validation Test"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->assertNotVisible("{$base}validator4"); diff --git a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php index 800e36ff..144d3008 100755 --- a/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/ImageButtonTestCase.php @@ -20,13 +20,13 @@ class ImageButtonTestCase extends PradoGenericSelenium2Test // verify the first validation is passed $this->pause(500); - $this->assertNotContains('Button1 is clicked', $this->source()); + $this->assertSourceNotContains('Button1 is clicked'); $this->type("ctl0_Content_TextBox1", "test"); $this->byId("ctl0_Content_ctl1")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button1 is clicked and valid', $this->source()); + $this->assertSourceContains('Button1 is clicked and valid'); // verify the second validator shows the error $this->byId("ctl0_Content_ctl3")->click(); @@ -36,13 +36,13 @@ class ImageButtonTestCase extends PradoGenericSelenium2Test // verify the second validation is passed $this->pause(500); - $this->assertNotContains('Button2 is clicked', $this->source()); + $this->assertSourceNotContains('Button2 is clicked'); $this->type("ctl0_Content_TextBox2", "test"); $this->byId("ctl0_Content_ctl3")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button2 is clicked and valid', $this->source()); + $this->assertSourceContains('Button2 is clicked and valid'); // verify the third validator shows the error $this->byId("ctl0_Content_ctl5")->click(); @@ -51,13 +51,13 @@ class ImageButtonTestCase extends PradoGenericSelenium2Test $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->assertContains('Button3 is clicked', $this->source()); - $this->assertNotContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked'); + $this->assertSourceNotContains('Button3 is clicked and valid'); $this->type("ctl0_Content_TextBox3", "test"); $this->byId("ctl0_Content_ctl5")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php index 394556e9..862c0c53 100755 --- a/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php +++ b/tests/FunctionalTests/validators/tests/LinkButtonTestCase.php @@ -19,13 +19,13 @@ class LinkButtonTestCase extends PradoGenericSelenium2Test // verify the first validation is passed $this->pause(500); - $this->assertNotContains('Button1 is clicked', $this->source()); + $this->assertSourceNotContains('Button1 is clicked'); $this->type("ctl0_Content_TextBox1", "test"); $this->byId("ctl0_Content_ctl1")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button1 is clicked and valid', $this->source()); + $this->assertSourceContains('Button1 is clicked and valid'); // verify the second validator shows the error $this->byId("ctl0_Content_ctl3")->click(); @@ -35,13 +35,13 @@ class LinkButtonTestCase extends PradoGenericSelenium2Test // verify the second validation is passed $this->pause(500); - $this->assertNotContains('Button2 is clicked', $this->source()); + $this->assertSourceNotContains('Button2 is clicked'); $this->type("ctl0_Content_TextBox2", "test"); $this->byId("ctl0_Content_ctl3")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button2 is clicked and valid', $this->source()); + $this->assertSourceContains('Button2 is clicked and valid'); // verify the third validator shows the error $this->byId("ctl0_Content_ctl5")->click(); @@ -50,13 +50,13 @@ class LinkButtonTestCase extends PradoGenericSelenium2Test $this->assertVisible('ctl0_Content_ctl4'); // verify the third validation is passed - $this->assertContains('Button3 is clicked', $this->source()); - $this->assertNotContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked'); + $this->assertSourceNotContains('Button3 is clicked and valid'); $this->type("ctl0_Content_TextBox3", "test"); $this->byId("ctl0_Content_ctl5")->click(); $this->assertNotVisible('ctl0_Content_ctl0'); $this->assertNotVisible('ctl0_Content_ctl2'); $this->assertNotVisible('ctl0_Content_ctl4'); - $this->assertContains('Button3 is clicked and valid', $this->source()); + $this->assertSourceContains('Button3 is clicked and valid'); } } diff --git a/tests/FunctionalTests/validators/tests/ListControlTestCase.php b/tests/FunctionalTests/validators/tests/ListControlTestCase.php index 55e370c5..52ed400e 100755 --- a/tests/FunctionalTests/validators/tests/ListControlTestCase.php +++ b/tests/FunctionalTests/validators/tests/ListControlTestCase.php @@ -9,7 +9,7 @@ class ListControlTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=ListControl"); - $this->assertContains("List Control Required Field Validation Test", $this->source()); + $this->assertSourceContains("List Control Required Field Validation Test"); $this->byXPath("//input[@type='submit' and @value='Submit!']")->click(); $this->assertVisible("{$base}validator1"); diff --git a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php index 485c6a24..4cbc1121 100755 --- a/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RangeValidatorTestCase.php @@ -7,7 +7,7 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RangeValidatorInteger"); - $this->assertContains("Prado RangeValidator Tests Integer", $this->source()); + $this->assertSourceContains("Prado RangeValidator Tests Integer"); //between 1 and 4 $this->type("{$base}text1", "ad"); @@ -47,7 +47,7 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RangeValidatorFloat"); - $this->assertContains("Prado RangeValidator Tests Float", $this->source()); + $this->assertSourceContains("Prado RangeValidator Tests Float"); //between 1 and 4 $this->type("{$base}text1", "ad"); @@ -86,7 +86,7 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RangeValidatorDate"); - $this->assertContains("Prado RangeValidator Tests Date", $this->source()); + $this->assertSourceContains("Prado RangeValidator Tests Date"); //between 22/1/2005 and 3/2/2005 $this->type("{$base}text1", "ad"); @@ -107,7 +107,6 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text2", "1/1/2005"); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); - $this->pause(250); $this->assertVisible("{$base}validator2"); $this->type("{$base}text2", "1/4/2005"); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); @@ -117,7 +116,6 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test $this->assertNotVisible("{$base}validator3"); $this->type("{$base}text3", "4/5/2005"); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); - $this->pause(250); $this->assertVisible("{$base}validator3"); $this->type("{$base}text3", "1/2/2005"); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); @@ -128,7 +126,7 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RangeValidatorString"); - $this->assertContains("Prado RangeValidator Tests String", $this->source()); + $this->assertSourceContains("Prado RangeValidator Tests String"); //between 'd' and 'y' $this->type("{$base}text1", "a"); @@ -140,7 +138,9 @@ class RangeValidatorTestCase extends PradoGenericSelenium2Test $this->assertVisible("{$base}validator1"); $this->type("{$base}text1", "f"); $this->assertNotVisible("{$base}validator1"); + $this->pause(50); $this->byXPath("//input[@type='submit' and @value='Test']")->click(); + $this->pause(50); $this->assertNotVisible("{$base}validator1"); diff --git a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php index ffa30126..8127af61 100755 --- a/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php +++ b/tests/FunctionalTests/validators/tests/RegExpValidatorTestCase.php @@ -7,7 +7,7 @@ class RegExpValidatorTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RegularExpressionValidator"); - $this->assertContains("Prado RegularExpressionValidator Tests", $this->source()); + $this->assertSourceContains("Prado RegularExpressionValidator Tests"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->type("{$base}text1", "1"); diff --git a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php index e868155c..184c4258 100755 --- a/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php +++ b/tests/FunctionalTests/validators/tests/RequiredFieldTestCase.php @@ -6,7 +6,7 @@ class RequiredFieldTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RequiredFieldValidator"); - $this->assertContains("RequiredFieldValidator Tests", $this->source()); + $this->assertSourceContains("RequiredFieldValidator Tests"); $this->assertNotVisible("{$base}validator1"); $this->assertNotVisible("{$base}validator2"); $this->byId("{$base}submit1")->click(); @@ -45,6 +45,7 @@ class RequiredFieldTestCase extends PradoGenericSelenium2Test $this->assertVisible("{$base}validator2"); $this->byId("{$base}check2")->click(); $this->byId("{$base}submit2")->click(); + $this->pause(50); $this->type("{$base}text1", "Hello"); $this->byId("{$base}check1")->click(); @@ -74,7 +75,7 @@ class RequiredFieldTestCase extends PradoGenericSelenium2Test { $base = "ctl0_Content_"; $this->url("validators/index.php?page=RequiredFieldValidator"); - $this->assertContains("InitialValue Test", $this->source()); + $this->assertSourceContains("InitialValue Test"); $this->assertNotVisible("{$base}validator9"); $this->byId("{$base}submit5")->click(); $this->pause(250); diff --git a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php index d4c44a34..9b999b01 100755 --- a/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php +++ b/tests/FunctionalTests/validators/tests/ValidationSummaryTestCase.php @@ -8,7 +8,7 @@ class ValidationSummaryTestCase extends PradoGenericSelenium2Test $base = "ctl0_Content_"; $this->url("validators/index.php?page=ValidationSummary"); - $this->assertContains("Validation Summary Test", $this->source()); + $this->assertSourceContains("Validation Summary Test"); //$this->assertText("{$base}summary1", ""); //$this->assertText("{$base}summary2", ""); diff --git a/tests/test_tools/PradoGenericSelenium2Test.php b/tests/test_tools/PradoGenericSelenium2Test.php index 23dfeb61..535d500d 100755 --- a/tests/test_tools/PradoGenericSelenium2Test.php +++ b/tests/test_tools/PradoGenericSelenium2Test.php @@ -22,6 +22,15 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase ), /* array( + 'name' => 'Safari on OSX', + 'browserName' => 'safari', + 'sessionStrategy' => 'shared', + 'host' => '127.0.0.1', + 'port' => 4444, + ), +*/ +/* + array( 'name' => 'Firefox on WindowsXP', 'browserName' => '*firefox', 'host' => '127.0.0.1', @@ -89,12 +98,24 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase protected function assertVisible($id) { - $this->assertTrue($this->getElement($id)->displayed()); + try{ + $this->assertTrue($this->getElement($id)->displayed()); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + //stale element reference. try second time. + $this->pause(50); + $this->assertTrue($this->getElement($id)->displayed()); + } } protected function assertNotVisible($id) { - $this->assertFalse($this->getElement($id)->displayed()); + try{ + $this->assertFalse($this->getElement($id)->displayed()); + } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) { + //stale element reference. try second time. + $this->pause(50); + $this->assertFalse($this->getElement($id)->displayed()); + } } protected function assertElementPresent($id) @@ -227,4 +248,27 @@ class PradoGenericSelenium2Test extends PHPUnit_Extensions_Selenium2TestCase usleep($msec*1000); } -}
\ No newline at end of file + public function assertSourceContains($text) + { + $found = strpos($this->source(), $text) !== false; + for($i=0;$i<10 && ! $found; $i++) { + $this->pause(20); + $found = strpos($this->source(), $text) !== false; + } + $this->assertTrue($found, "Failed asserting that page source contains $text"); + } + + public function assertSourceNotContains($text) + { + $found = strpos($this->source(), $text) !== false; + for($i=0;$i<10 && $found; $i++) { + $this->pause(20); + $found = strpos($this->source(), $text) !== false; + } + $this->assertFalse($found, "Failed asserting that page source does not contain $text"); + } + + + + +} |