From 03b0e225a5957b9d9195e501dbf168101f7fb02e Mon Sep 17 00:00:00 2001 From: Web Access Date: Mon, 23 Nov 2015 18:55:33 +0530 Subject: [PATCH] Webtests Fix --- CRM/Event/Form/Registration/Confirm.php | 2 +- tests/phpunit/WebTest/Campaign/ActivityTest.php | 1 + tests/phpunit/WebTest/Contact/MergeContactsTest.php | 6 +++--- tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php | 3 +-- tests/phpunit/WebTest/Event/PCPAddTest.php | 2 +- tests/phpunit/WebTest/Report/AddTest.php | 1 + 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 8656e539b3..161296c2bc 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -1047,7 +1047,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { // process soft credit / pcp pages if (!empty($params['pcp_made_through_id'])) { - CRM_Contribute_Form_Contribution_Confirm::formatSoftCreditParams($params, $form); + CRM_Contribute_BAO_ContributionSoft::formatSoftCreditParams($params, $form); CRM_Contribute_BAO_ContributionSoft::processSoftContribution($params, $contribution); } diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index 75f9c716c3..93ab85c857 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -203,6 +203,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); // verify Activity created + $this->waitForAjaxContent(); $this->verifyText("xpath=//form[@id='Activity']/div[2]/table/tbody/tr[5]/td[2]/span", $campaignTitle); } diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index fd0f6811c9..b18c687f75 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -856,7 +856,6 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { //check the status message $this->waitForText('crm-notification-container', "Relationship created."); - $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[text()='View']"); $this->waitForAjaxContent(); $this->click("xpath=//a[text()='$sortName']"); @@ -887,6 +886,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select('relationship_type_id', "value=5_b_a"); //fill in the individual + $this->waitForElementPresent('related_contact_id'); $this->select2('related_contact_id', $sortNameOther, TRUE, FALSE); $this->waitForElementPresent("_qf_Relationship_upload"); @@ -919,10 +919,10 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->click("css=li#tab_rel a"); // wait for add Relationship link - $this->waitForElementPresent("xpath=//a[text()='$sortName']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr//td//a[text()='$sortName']"); // go to duplicate organization's related contact // to check if membership is added to that contact - $this->click("xpath=//a[text()='$sortName']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr//td//a[text()='$sortName']"); $this->waitForPageToLoad($this->getTimeoutMsec()); // Check if Membership for the individual is created diff --git a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php index ccfd0ec551..249460f38e 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php +++ b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php @@ -52,8 +52,7 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase { $cids[] = $this->urlArg('cid'); // update email of new contact - $this->waitForElementPresent("xpath=//div[@class='crm-actions-ribbon']/ul[@id='actions']//li/a/span[text()=' Edit']"); - $this->click("xpath=//div[@class='crm-actions-ribbon']/ul[@id='actions']//li/a/span[text()=' Edit']"); + $this->click("xpath=//ul[@id='actions']/li[2]/a"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->type("email_1_email", $emailString . $i . 'webtest'); $this->click("_qf_Contact_upload_view"); diff --git a/tests/phpunit/WebTest/Event/PCPAddTest.php b/tests/phpunit/WebTest/Event/PCPAddTest.php index b89624faff..7876c27d27 100644 --- a/tests/phpunit/WebTest/Event/PCPAddTest.php +++ b/tests/phpunit/WebTest/Event/PCPAddTest.php @@ -257,7 +257,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase { } $this->click('intro_text'); - $this->fillRichTextField("intro_text", $registerIntro); + $this->fillRichTextField('intro_text', $registerIntro, 'CKEditor', TRUE); // enable confirmation email $this->click("CIVICRM_QFID_1_is_email_confirm"); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 8e7852a2a9..20c849c7e9 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -174,6 +174,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->assertContains($reportDescription, $this->getValue("description"), "Report Description expected $reportDescription"); // Is correct email Subject? + $this->waitForElementPresent("mainTabContainer"); $this->click("xpath=//div[@id='mainTabContainer']/ul/li[5]/a"); $this->waitForAjaxContent(); $this->assertContains($emaiSubject, $this->getValue("email_subject"), "Email Subject expected $emaiSubject"); -- 2.25.1