Merge pull request #9566 from totten/master-19690-layout
[civicrm-core.git] / tests / phpunit / WebTest / Contact / AddViaProfileTest.php
index 31f9901546998f3bf95d4f53cbbc8c146d9df71b..0846d1283b4fb72b281dbf9296f0b52017fe03f8 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2017                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -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();
   }
 
 }