summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/quickstart/ActiveControls
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/quickstart/ActiveControls')
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php32
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php69
-rwxr-xr-xtests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php12
3 files changed, 56 insertions, 57 deletions
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
index 03861440..9d816978 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveButtonTestCase.php
@@ -1,36 +1,36 @@
<?php
//$Id: ActiveButtonTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $
-class QuickstartActiveButtonTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveButtonTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&amp;notheme=true&amp;lang=en");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveButton.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveButton Samples (AJAX)');
+ $this->assertContains('TActiveButton Samples (AJAX)', $this->source());
// a click button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
- $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
$this->pause(800);
- $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
+ $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked\"]");
// a command button
- $this->verifyElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
- $this->click("//input[@type='submit' and @value='click me']", "");
+ $this->assertElementNotPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+ $this->byXPath("//input[@type='submit' and @value='click me']")->click();
$this->pause(800);
- $this->verifyElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
+ $this->assertElementPresent("//input[@type='submit' and @value=\"Name: test, Param: value using callback\"]");
// a button causing validation
- $this->verifyNotVisible('ctl0_body_ctl2');
- $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->assertNotVisible('ctl0_body_ctl2');
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
$this->pause(800);
- $this->verifyVisible('ctl0_body_ctl2');
+ $this->assertVisible('ctl0_body_ctl2');
$this->type("ctl0\$body\$TextBox", "test");
- $this->click("//input[@type='submit' and @value='submit']", "");
+ $this->byXPath("//input[@type='submit' and @value='submit']")->click();
$this->pause(800);
- $this->verifyNotVisible('ctl0_body_ctl2');
- $this->verifyElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", "");
+ $this->assertNotVisible('ctl0_body_ctl2');
+ $this->assertElementPresent("//input[@type='submit' and @value=\"I'm clicked using callback\"]", "");
}
}
diff --git a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
index 257917ec..9e537abd 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCheckBoxTestCase.php
@@ -1,58 +1,57 @@
<?php
//$Id: ActiveCheckBoxTestCase.php 3187 2012-07-12 11:21:01Z ctrlaltca $
-class QuickstartActiveCheckBoxTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveCheckBoxTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->setSpeed(500);
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&amp;notheme=true&amp;lang=en", "");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCheckBox.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveCheckBox Samples (AJAX)');
+ $this->assertContains('TActiveCheckBox Samples (AJAX)', $this->source());
// an auto postback checkbox
- $this->verifyTextNotPresent("ctl0_body_ctl0 clicked using callback");
- $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertNotContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click();
$this->pause(800);
- $this->assertChecked("//input[@name='ctl0\$body\$ctl0']");
- $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
- $this->click("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected());
+ $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->byXPath("//input[@name='ctl0\$body\$ctl0']")->click();
$this->pause(800);
- $this->verifyTextPresent("ctl0_body_ctl0 clicked using callback");
- $this->assertNotChecked("//input[@name='ctl0\$body\$ctl0']");
+ $this->assertContains("ctl0_body_ctl0 clicked using callback", $this->source());
+ $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$ctl0']")->selected());
// a checkbox causing validation on a textbox
- $this->verifyNotVisible('ctl0_body_ctl1');
- $this->click("//input[@name='ctl0\$body\$ctl2']");
- $this->verifyVisible('ctl0_body_ctl1');
- $this->click("//input[@name='ctl0\$body\$ctl2']", "");
- $this->verifyVisible('ctl0_body_ctl3');
+ $this->assertNotVisible('ctl0_body_ctl1');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertVisible('ctl0_body_ctl1');
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
+ $this->assertVisible('ctl0_body_ctl3');
$this->type("ctl0\$body\$TextBox", "test");
- $this->click("//input[@name='ctl0\$body\$ctl2']", "");
+ $this->byXPath("//input[@name='ctl0\$body\$ctl2']")->click();
$this->pause(800);
- $this->verifyNotVisible('ctl0_body_ctl1');
- $this->assertTextPresent("ctl0_body_ctl2 clicked using callback");
+ $this->assertNotVisible('ctl0_body_ctl1');
+ $this->assertContains("ctl0_body_ctl2 clicked using callback", $this->source());
// a checkbox validated by a required field validator
- $this->assertNotChecked("//input[@name='ctl0\$body\$CheckBox']");
- $this->verifyNotVisible('ctl0_body_ctl4');
- $this->click("//input[@type='submit' and @value='Submit']", "");
- $this->verifyVisible('ctl0_body_ctl4');
- $this->click("//input[@name='ctl0\$body\$CheckBox']", "");
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox']");
- $this->click("//input[@type='submit' and @value='Submit']", "");
- $this->verifyNotVisible('ctl0_body_ctl4');
- $this->assertTextPresent("ctl0_body_CheckBox clicked");
+ $this->assertFalse($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected());
+ $this->assertNotVisible('ctl0_body_ctl4');
+ $this->byXPath("//input[@type='submit' and @value='Submit']")->click();
+ $this->assertVisible('ctl0_body_ctl4');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->click();
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox']")->selected());
+ $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());
// a checkbox validated by a required field validator using AutoPostBack
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
- $this->verifyNotVisible('ctl0_body_ctl5');
- $this->click("//input[@name='ctl0\$body\$CheckBox2']", "");
- $this->verifyVisible('ctl0_body_ctl5');
- $this->assertChecked("//input[@name='ctl0\$body\$CheckBox2']");
- $this->setSpeed(0);
+ $this->assertTrue($this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->selected());
+ $this->assertNotVisible('ctl0_body_ctl5');
+ $this->byXPath("//input[@name='ctl0\$body\$CheckBox2']")->click();
+ $this->assertVisible('ctl0_body_ctl5');
+ $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 967842b0..7cb29382 100755
--- a/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php
+++ b/tests/FunctionalTests/quickstart/ActiveControls/ActiveCustomValidatorTestCase.php
@@ -1,19 +1,19 @@
<?php
//$Id: ActiveButtonTestCase.php 1405 2006-09-10 01:03:56Z wei $
-class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest
+class QuickstartActiveCustomValidatorTestCase extends PradoGenericSelenium2Test
{
function test ()
{
- $this->open("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&amp;notheme=true&amp;lang=en");
+ $this->url("../../demos/quickstart/index.php?page=ActiveControls.Samples.TActiveCustomValidator.Home&amp;notheme=true&amp;lang=en");
- $this->verifyTitle("PRADO QuickStart Sample", "");
+ $this->assertEquals("PRADO QuickStart Sample", $this->title());
- $this->assertTextPresent('TActiveCustomValidator Samples (AJAX)');
+ $this->assertContains('TActiveCustomValidator Samples (AJAX)', $this->source());
$base = 'ctl0_body_';
$this->assertNotVisible($base.'validator1');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->pause(800);
$this->assertVisible($base.'validator1');
@@ -25,7 +25,7 @@ class QuickstartActiveCustomValidatorTestCase extends PradoGenericSeleniumTest
$this->pause(800);
$this->assertVisible($base.'validator1');
- $this->click($base.'button1');
+ $this->byId($base.'button1')->click();
$this->pause(800);
$this->assertNotVisible($base.'validator1');
}