From 61ae30d9b5c8e0f62c3c03ee5e8f82b2041e03f7 Mon Sep 17 00:00:00 2001 From: yashodha Date: Fri, 22 Mar 2013 12:28:34 +0530 Subject: [PATCH] webtest fix --- .../WebTest/Contact/AddCmsUserTest.php | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AddCmsUserTest.php b/tests/phpunit/WebTest/Contact/AddCmsUserTest.php index fef67fe104..bd6baf23e4 100644 --- a/tests/phpunit/WebTest/Contact/AddCmsUserTest.php +++ b/tests/phpunit/WebTest/Contact/AddCmsUserTest.php @@ -35,32 +35,32 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { $this->webtestLogin('admin'); - $this->open($this->sboxPath . "admin/people/create"); + $this->open($this->sboxPath . 'admin/people/create'); - $this->waitForElementPresent("edit-submit"); + $this->waitForElementPresent('edit-submit'); - $name = "TestUserAuthenticated" . substr(sha1(rand()), 0, 4); - $this->type("edit-name", $name); + $name = 'TestUserAuthenticated' . substr(sha1(rand()), 0, 4); + $this->type('edit-name', $name); $emailId = substr(sha1(rand()), 0, 7) . '@web.com'; - $this->type("edit-mail", $emailId); - $this->type("edit-pass-pass1", "Test12345"); - $this->type("edit-pass-pass2", "Test12345"); + $this->type('edit-mail', $emailId); + $this->type('edit-pass-pass1', 'Test12345'); + $this->type('edit-pass-pass2', 'Test12345'); //Add profile Details $firstName = 'Ma' . substr(sha1(rand()), 0, 4); $lastName = 'An' . substr(sha1(rand()), 0, 7); - - $this->type("first_name", $firstName); - $this->type("last_name", $lastName); + $this->waitForElementPresent('first_name'); + $this->type('first_name', $firstName); + $this->type('last_name', $lastName); //Address Details - $this->type("street_address-1", "902C El Camino Way SW"); - $this->type("city-1", "Dumfries"); - $this->type("postal_code-1", "1234"); - $this->select("state_province-1", "value=1019"); + $this->type('street_address-1', '902C El Camino Way SW'); + $this->type('city-1', 'Dumfries'); + $this->type('postal_code-1', '1234'); + $this->select('state_province-1', 'value=1019'); - $this->click("edit-submit"); + $this->click('edit-submit'); $this->waitForPageToLoad($this->getTimeoutMsec()); } @@ -68,8 +68,8 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { // Make sure Drupal account settings allow visitors to register for account w/o admin approval // login as admin $this->webtestLogin('admin'); - $this->open($this->sboxPath . "admin/config/people/accounts"); - $this->waitForElementPresent("edit-submit"); + $this->open($this->sboxPath . 'admin/config/people/accounts'); + $this->waitForElementPresent('edit-submit'); $this->click('edit-user-register-1'); $this->check('edit-user-email-verification'); @@ -78,28 +78,28 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { // logout $this->webtestLogout(); - $this->open($this->sboxPath . "user/register"); + $this->open($this->sboxPath . 'user/register'); - $this->waitForElementPresent("edit-submit"); - $name = "TestUserAnonymous" . substr(sha1(rand()), 0, 7); - $this->type("edit-name", $name); + $this->waitForElementPresent('edit-submit'); + $name = 'TestUserAnonymous' . substr(sha1(rand()), 0, 7); + $this->type('edit-name', $name); $emailId = substr(sha1(rand()), 0, 7) . '@web.com'; - $this->type("edit-mail", $emailId); + $this->type('edit-mail', $emailId); //Add profile Details $firstName = 'Ma' . substr(sha1(rand()), 0, 4); $lastName = 'An' . substr(sha1(rand()), 0, 7); - $this->type("first_name", $firstName); - $this->type("last_name", $lastName); + $this->type('first_name', $firstName); + $this->type('last_name', $lastName); //Address Details - $this->type("street_address-1", "902C El Camino Way SW"); - $this->type("city-1", "Dumfries"); - $this->type("postal_code-1", "1234"); - $this->assertTrue($this->isTextPresent("United States")); - $this->select("state_province-1", "value=1019"); + $this->type('street_address-1', '902C El Camino Way SW'); + $this->type('city-1', 'Dumfries'); + $this->type('postal_code-1', '1234'); + $this->assertTrue($this->isTextPresent('United States')); + $this->select('state_province-1', 'value=1019'); - $this->click("edit-submit"); + $this->click('edit-submit'); $this->waitForPageToLoad($this->getTimeoutMsec()); // In case the site is set up to login immediately upon registration @@ -107,16 +107,16 @@ class WebTest_Contact_AddCmsUserTest extends CiviSeleniumTestCase { $this->webtestLogin(); - $this->openCiviPage("contact/search", "reset=1", "_qf_Basic_refresh"); - $this->type("sort_name", $emailId); - $this->click("_qf_Basic_refresh"); + $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); + $this->type('sort_name', $emailId); + $this->click('_qf_Basic_refresh'); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->assertElementContainsText('css=.crm-search-results', $emailId); $this->assertElementContainsText('css=.crm-search-results', $lastName . ', ' . $firstName); - $this->assertElementContainsText('css=.crm-search-results', "902C El Camino Way SW"); - $this->assertElementContainsText('css=.crm-search-results', "Dumfries"); - $this->assertElementContainsText('css=.crm-search-results', "1234"); + $this->assertElementContainsText('css=.crm-search-results', '902C El Camino Way SW'); + $this->assertElementContainsText('css=.crm-search-results', 'Dumfries'); + $this->assertElementContainsText('css=.crm-search-results', '1234'); } } -- 2.25.1