CRM-12378 a new webtest helper function introduction which can help detect break...
[civicrm-core.git] / tests / phpunit / WebTest / Contact / RelationshipAddTest.php
index 6f63cc55d6a3ba4d3588171a1198fed6c02e2b4e..7039416d5c51dbf51478890a7ced5a43f6b7b242 100644 (file)
@@ -352,5 +352,22 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
     );
     $this->assertTrue($this->isTextPresent($params['label_a_b']));
   }
-}
 
+  function testAjaxCustomGroupLoad() {
+    $this->webtestLogin();
+
+    //create a New Individual
+    $firstName = substr(sha1(rand()), 0, 7);
+    $this->webtestAddContact($firstName, "Anderson", "$firstName@anderson.name");
+    $contactId = explode('cid=', $this->getLocation());
+
+    $triggerElement = array('name' => 'relationship_type_id', 'type' => 'select');
+    $customSets = array(
+      array('entity' => 'Relationship', 'subEntity' => 'Partner of', 'triggerElement' => $triggerElement),
+      array('entity' => 'Relationship', 'subEntity' => 'Spouse of', 'triggerElement' => $triggerElement)
+    );
+
+    $pageUrl = array('url' => 'contact/view/rel', 'args' => "cid={$contactId[1]}&action=add&reset=1");
+    $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl);
+  }
+}
\ No newline at end of file