Merge pull request #8215 from colemanw/CRM-17985
[civicrm-core.git] / tests / phpunit / WebTest / Member / EditMembershipTest.php
index 0c18242eb7510bdb5928b886e7fdfb3cd357b669..52c9681c8d69896cc925c81c94b24c56ae29d234 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -78,13 +78,14 @@ class WebTest_Member_EditMembershipTest extends CiviSeleniumTestCase {
 
     // Assign the created Financial Account $financialAccountTitle to $financialType
     $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']");
-    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']");
-    $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']");
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]");
+    $this->click("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]");
     $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']");
     $this->select('account_relationship', "label=Sales Tax Account is");
+    $this->waitForAjaxContent();
     $this->select('financial_account_id', "label=" . $financialAccountTitle);
     $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']");
-    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']");
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]");
 
     // add membership type
     $membershipTypes = $this->webtestAddMembershipType('rolling', 1, 'year', 'no', 100, $financialType['name']);