webtest fix
authoryashodha <yashodha.chaku@webaccess.co.in>
Fri, 22 Mar 2013 06:58:34 +0000 (12:28 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Fri, 22 Mar 2013 06:58:34 +0000 (12:28 +0530)
tests/phpunit/WebTest/Contact/AddCmsUserTest.php

index fef67fe104d235e69c7a57775862705189883937..bd6baf23e43f1789b4eff880aad998bfe6b2a835 100644 (file)
@@ -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');
   }
 }