Webtests fixes
[civicrm-core.git] / tests / phpunit / WebTest / Contact / AddViaProfileTest.php
index 31f9901546998f3bf95d4f53cbbc8c146d9df71b..f6064013459d272620f9ece3288e91a862157fbf 100644 (file)
@@ -35,33 +35,11 @@ class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase {
     parent::setUp();
   }
 
+  /**
+   * Add a contact via profile
+   */
   public function testAddViaCreateProfile() {
-    $this->webtestLogin();
-
-    $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_next');
-
-    $firstName = 'Jo' . substr(sha1(rand()), 0, 4);
-    $lastName = 'Ad' . substr(sha1(rand()), 0, 7);
-
-    //contact details section
-    //fill in first name
-    $this->type("first_name", $firstName);
-
-    //fill in last name
-    $this->type("last_name", $lastName);
-
-    //address section
-    $this->type("street_address-1", "902C El Camino Way SW");
-    $this->type("city-1", "Dumfries");
-    $this->type("postal_code-1", "1234");
-    $this->assertSelected('country-1', "UNITED STATES");
-    $this->select("state_province-1", "value=1019");
-
-    // Clicking save.
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertElementContainsText('css=.msg-text', "Your information has been saved.");
+    $this->webtestAddViaCreateProfile();
   }
 
 }