From: Web Access Date: Fri, 9 Jan 2015 13:09:34 +0000 (+0530) Subject: Webtests Fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4a058f26697ba9232365c9813f28ccc538e21722;p=civicrm-core.git Webtests Fixes --- diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 7bc484bcd4..ba7bcfb8d1 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -1832,8 +1832,8 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->openCiviPage("admin/financial/financialAccount", "reset=1"); } - $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']"); - $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); + $this->waitForElementPresent("xpath=//table/tbody//tr/td[1]/div[text()='{$editfinancialAccount}']/../../td[9]/span/a[text()='Edit']"); + $this->clickLink("xpath=//table/tbody//tr/td[1]/div[text()='{$editfinancialAccount}']/../../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); // Change Financial Account Name if ($financialAccountTitle) { @@ -1904,7 +1904,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { * Delete Financial Account */ public function _testDeleteFinancialAccount($financialAccountTitle) { - $this->click("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']"); + $this->click("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Delete']"); $this->waitForElementPresent('_qf_FinancialAccount_next-botttom'); $this->click('_qf_FinancialAccount_next-botttom'); $this->waitForElementPresent('link=Add Financial Account'); @@ -1944,9 +1944,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->openCiviPage("admin/financial/financialType", "reset=1"); if ($option == 'Delete') { - $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span[2]"); + $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span[2]"); $this->waitForElementPresent("css=span.btn-slide-active"); - $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span[2]/ul/li[2]/a"); + $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span[2]/ul/li[2]/a"); $this->waitForElementPresent("_qf_FinancialType_next"); $this->click("_qf_FinancialType_next"); $this->waitForElementPresent("newFinancialType"); @@ -1957,7 +1957,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->click("link=Add Financial Type"); } else { - $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[oldname]']/../td[7]/span/a[text()='Edit']"); + $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[oldname]']/../../td[7]/span/a[text()='Edit']"); } $this->waitForElementPresent("name"); $this->type('name', $financialType['name']); diff --git a/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php b/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php index d94181b053..9f6e4c3185 100644 --- a/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php +++ b/tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php @@ -65,7 +65,7 @@ class WebTest_Admin_Form_ScheduleReminderTest extends CiviSeleniumTestCase { $this->click('_qf_ScheduleReminders_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->click("//div[@id='reminder']//div[@id='option11_wrapper']/table/tbody//tr/td[1][text()='{$title}']/../td[7]/span/a[text()='Edit']"); + $this->click("xpath=//div[@id='reminder']/div/table/tbody//tr/td[1]/div[text()='{$title}']/../../td[7]/span/a[text()='Edit']"); $this->waitForElementPresent('_qf_ScheduleReminders_cancel-bottom'); $this->assertEquals($title, $this->getValue('id=title')); diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index 6133c2f106..01e310ef02 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -406,7 +406,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$textFieldLabel' has been saved."); - $textFieldId = explode('&id=', $this->getAttribute("xpath=//table[@id='options']/tbody//tr/td[1]/span[text()='$textFieldLabel']/../../td[8]/span/a[1][text()='Edit Field']/@href")); + $textFieldId = explode('&id=', $this->getAttribute("xpath=//table[@id='options']/tbody//tr/td[1]/div[text()='$textFieldLabel']/../../td[8]/span/a[1][text()='Edit Field']/@href")); $textFieldId = $textFieldId[1]; return array($radioOptionLabel1, "custom_{$textFieldId}_-1"); diff --git a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php index 988209b178..b2e6811df7 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php @@ -127,8 +127,8 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase { $this->waitForElementPresent('title'); $this->type('title', $editCaseTypeLabel); - $this->select2("xpath=//tr[@class='addRow']/td/span/div/a", 'Sibling of', FALSE, TRUE); - $this->click("xpath=//*[@id='crm-main-content-wrapper']/div/div/form/div/div[3]/table/tbody/tr[4]/td[2]/input[@type='checkbox']"); + $this->select2("xpath=//div[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tfoot/tr/td/span/div/a",'Sibling of', FALSE, TRUE); + $this->click("xpath=//*[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tbody/tr[4]/td[2]/input[@type='checkbox']"); $this->click("xpath=//a[text()='Standard Timeline']"); $this->select2("xpath=//tr[@class='addRow']/td[contains(text(),'Add activity:')]/span/div/a", 'SMS', FALSE, TRUE); diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTest.php index b9eb423494..6c2cb67358 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTest.php @@ -68,9 +68,9 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase { $isDefault ); - $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']"); + $this->waitForElementPresent("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Edit']"); - $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); + $this->clickLink("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); //Varify Data after Adding new Financial Account $verifyData = array( 'name' => $financialAccountTitle, @@ -117,8 +117,8 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase { if ($orgNameEdit) { $orgName = $orgNameEdit; } - $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']"); - $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); + $this->waitForElementPresent("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Edit']"); + $this->clickLink("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom', FALSE); $verifyData = array( 'name' => $financialAccountTitle, @@ -136,7 +136,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase { $verifySelectFieldData = array('financial_account_type_id' => $financialAccountType); $this->_assertSelectVerify($verifySelectFieldData); $this->click('_qf_FinancialAccount_cancel-botttom'); - $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Delete']"); + $this->waitForElementPresent("xpath=//table/tbody//tr/td[1]/div[text()='{$financialAccountTitle}']/../../td[9]/span/a[text()='Delete']"); //Delete Financial Account $this->_testDeleteFinancialAccount($financialAccountTitle); diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php index 7e0f209275..2a7f5102e7 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php @@ -65,7 +65,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { ); $this->waitForElementPresent('newFinancialType'); - $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']"); + $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']"); $this->waitForElementPresent('newfinancialTypeAccount'); foreach ($expected as $value => $label) { @@ -73,8 +73,8 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { } $this->openCiviPage('admin/financial/financialType', 'reset=1', 'newFinancialType'); - $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']); - $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']"); + $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']); + $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']"); $this->waitForElementPresent('newfinancialTypeAccount'); $this->click("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']"); $this->waitForElementPresent('_qf_FinancialTypeAccount_next'); diff --git a/tests/phpunit/WebTest/Import/AddressImportTest.php b/tests/phpunit/WebTest/Import/AddressImportTest.php index 96067f6dbe..9cca856ead 100644 --- a/tests/phpunit/WebTest/Import/AddressImportTest.php +++ b/tests/phpunit/WebTest/Import/AddressImportTest.php @@ -142,8 +142,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForText('crm-notification-container', "Custom field '{$customField}' has been saved."); - $this->waitForElementPresent("xpath=//span[text()='$customField']"); - $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customField), 'Missing text: ' . $customField); + $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField']/../../td[8]/span/a@href")); $customFieldId = $customFieldId[1]; // create custom field - Integer @@ -157,8 +157,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText('crm-notification-container', "Custom field '{$customField1}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']"); - $customFieldId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customField1), 'Missing text: ' . $customField1); + $customFieldId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField1']/../../td[8]/span/a@href")); $customFieldId1 = $customFieldId1[1]; // create custom field - Number @@ -172,8 +172,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText('crm-notification-container', "Custom field '{$customField2}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField2']"); - $customFieldId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField2']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customField2), 'Missing text: ' . $customField2); + $customFieldId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField2']/../../td[8]/span/a@href")); $customFieldId2 = $customFieldId2[1]; // create custom field - "alphanumeric select" @@ -223,8 +223,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText('crm-notification-container', "Custom field '{$customField9}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField9']"); - $customFieldId9 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField9']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customField9), 'Missing text: ' . $customField9); + $customFieldId9 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField9']/../../td[8]/span/a@href")); $customFieldId9 = $customFieldId9[1]; // create custom field - Date @@ -239,8 +239,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText('crm-notification-container', "Custom field '{$customField10}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']"); - $customFieldId10 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customField9), 'Missing text: ' . $customField9); + $customFieldId10 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField10']/../../td[8]/span/a@href")); $customFieldId10 = $customFieldId10[1]; return array( @@ -307,8 +307,8 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText('crm-notification-container', "Custom field '{$customFieldName}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customFieldName']"); - $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customFieldName']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($customFieldName), 'Missing text: ' . $customFieldName); + $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customFieldName']/../../td[8]/span/a@href")); $customFieldId = $customFieldId[1]; return $customFieldId; } diff --git a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php index 2a71a658bc..e5f715d8cc 100644 --- a/tests/phpunit/WebTest/Import/ContactCustomDataTest.php +++ b/tests/phpunit/WebTest/Import/ContactCustomDataTest.php @@ -57,7 +57,7 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText("crm-notification-container", "The rule '{$newRuleTitle}' has been saved."); - $rgId = explode('&rgid=', $this->getAttribute("xpath=//div[@id='browseValues_Individual']//table/tbody//tr/td[text()='{$newRuleTitle}']/../td[3]/span/a[text()='Use Rule']@href")); + $rgId = explode('&rgid=', $this->getAttribute("xpath=//div[@id='browseValues_Individual']/div/div/table/tbody//tr/td[text()='{$newRuleTitle}']/../td[3]/span/a[1][text()='Use Rule']@href")); $rgId = explode('&', $rgId[1]); // Add Contact @@ -185,7 +185,7 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase { $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td"); $this->waitForText('crm-notification-container', "Custom field '{$customField}' has been saved."); - $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href")); + $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$customField']/../../td[8]/span/a@href")); $customFieldId = $customFieldId[1]; return array("custom_{$customFieldId}", $customField, $customGroupTitle); diff --git a/tests/phpunit/WebTest/Import/CustomDataTest.php b/tests/phpunit/WebTest/Import/CustomDataTest.php index 95b6a608c0..3a76a82b59 100644 --- a/tests/phpunit/WebTest/Import/CustomDataTest.php +++ b/tests/phpunit/WebTest/Import/CustomDataTest.php @@ -211,8 +211,8 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Custom field '{$dateFieldLabel}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$dateFieldLabel']"); - $dateFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$dateFieldLabel']/../../td[8]/span/a@href")); + $this->assertTrue($this->isTextPresent($dateFieldLabel), 'Missing text: ' . $dateFieldLabel); + $dateFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$dateFieldLabel']/../../td[8]/span/a@href")); $dateFieldId = $dateFieldId[1]; // create another custom field - Integer Radio @@ -252,8 +252,8 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { //Is custom field created $this->waitForText("crm-notification-container", "Custom field '$radioFieldLabel' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$radioFieldLabel']/parent::td/parent::tr/td[8]/span/a"); - $radioFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$radioFieldLabel']/../../td[8]/span/a@href")); + $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$radioFieldLabel']/parent::td/parent::tr/td[8]/span/a"); + $radioFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$radioFieldLabel']/../../td[8]/span/a@href")); $radioFieldId = $radioFieldId[1]; // create another custom field - multiselect @@ -291,8 +291,8 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_done-bottom'); $this->waitForElementPresent('newCustomField'); $this->waitForText("crm-notification-container", "Custom field '{$multiSelectLabel}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$multiSelectLabel']/parent::td/parent::tr/"); - $multiSelectFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$multiSelectLabel']/parent::td/parent::tr/td[8]/span/a@href")); + $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$multiSelectLabel']/parent::td/parent::tr/"); + $multiSelectFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$multiSelectLabel']/parent::td/parent::tr/td[8]/span/a@href")); $multiSelectFieldId = $multiSelectFieldId[1]; // create another custom field - contact reference @@ -317,8 +317,8 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase { $this->waitForElementPresent('newCustomField'); $this->waitForText("crm-notification-container", "Custom field '{$contactReferenceLabel}' has been saved."); - $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$contactReferenceLabel']/parent::td/parent::tr/"); - $contactReferenceFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$contactReferenceLabel']/parent::td/parent::tr/td[8]/span/a@href")); + $this->waitForElementPresent("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$contactReferenceLabel']/parent::td/parent::tr/"); + $contactReferenceFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/div[text()='$contactReferenceLabel']/parent::td/parent::tr/td[8]/span/a@href")); $contactReferenceFieldId = $contactReferenceFieldId[1]; $customDataParams = array( diff --git a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php index be0068e19e..6bfa287917 100644 --- a/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php +++ b/tests/phpunit/WebTest/Pledge/AddCancelPaymentTest.php @@ -101,6 +101,7 @@ class WebTest_Pledge_AddCancelPaymentTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Contribution_upload-bottom"); $this->select('contribution_status_id', 'value=3'); $this->click("_qf_Contribution_upload-bottom"); + $this->waitForAjaxContent(); $this->waitForElementPresent("_qf_ContributionView_cancel-bottom"); $this->click("_qf_ContributionView_cancel-bottom"); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 3c4ac58bf7..6c99eaf30d 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -105,6 +105,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { // Fill Email Subject $this->click("xpath=//div[@id='mainTabContainer']/ul/li[5]/a"); + $this->waitForAjaxContent(); $this->type("email_subject", $emaiSubject); // Fill Email To @@ -173,6 +174,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { // Is correct email Subject? $this->click("xpath=//div[@id='mainTabContainer']/ul/li[5]/a"); + $this->waitForAjaxContent(); $this->assertContains($emaiSubject, $this->getValue("email_subject"), "Email Subject expected $emaiSubject"); // Is correct email to? diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index a8355a3b49..36c84cfd06 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -266,6 +266,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { //disable the logging $this->openCiviPage('admin/setting/misc', 'reset=1'); + $this->waitForElementPresent("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='No']"); $this->click("xpath=//tr[@class='crm-miscellaneous-form-block-logging']/td[2]/label[text()='No']"); $this->click("_qf_Miscellaneous_next-top"); $this->waitForTextPresent("Changes Saved");