Merge pull request #9566 from totten/master-19690-layout
[civicrm-core.git] / tests / phpunit / WebTest / Contact / MergeContactsTest.php
index 6dfc1678091f8612ffeadc88d1eedf0c2c6a01b0..f865e9beeb72293222545562cd232e82532bee2d 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.                                    |
  |                                                                    |
@@ -382,11 +382,12 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     // Select the contacts to be merged
     $this->waitForElementPresent('dupePairs_length');
-    $this->select("name=dupePairs_length", "value=100");
     $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']");
     $this->click("xpath=//a[text()='$firstName $lastName']/../../td[8]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
-    $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(overwrite)']", FALSE);
+    $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a");
+
+    $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(overwrite)']");
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[5]/td[4]/span[text()='(add)']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
 
@@ -594,6 +595,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contact/dedupefind", "reset=1&rgid=1&action=renew", "dupePairs");
 
     $this->waitForElementPresent('dupePairs_length');
+    $this->select("name=dupePairs_length", "value=100");
     $totalContacts = $this->getXpathCount("//table[@id='dupePairs']/tbody/tr");
     $this->click("//form[@id='DedupeFind']//a/span[contains(text(),' Batch Merge All Duplicates')]");
 
@@ -825,6 +827,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     // add relationship "Employer of"
     // click through to the relationship view screen
+    $this->waitForAjaxContent();
     $this->click("css=li#tab_rel a");
 
     // wait for add Relationship link
@@ -873,6 +876,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
 
     // add relationship "Employer of"
     // click through to the relationship view screen
+    $this->waitForAjaxContent();
     $this->click("css=li#tab_rel a");
 
     // wait for add Relationship link
@@ -914,6 +918,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // click through to the relationship view screen
+    $this->waitForAjaxContent();
     $this->click("css=li#tab_rel a");
 
     // wait for add Relationship link