From 6e677443736832def9c1b6a250b756d589871ca4 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 12 Nov 2015 20:12:08 +0530 Subject: [PATCH] Webtests 4.7 beta1 fixes --- .../Contact/AdvancedSearchedRelatedContactTest.php | 6 +++--- .../phpunit/WebTest/Contribute/OnlineContributionTest.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 3 ++- tests/phpunit/WebTest/Generic/CheckDashboardTest.php | 6 +++--- tests/phpunit/WebTest/Member/InheritedMembershipTest.php | 8 ++++---- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 8a980f1cad..7fe677b176 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -198,14 +198,14 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes /** * @param bool $discount * @param bool $priceSet - * @param int $processorId + * @param int|array $processorIDs */ - public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorName) { + public function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorIDs) { // Go to Fees tab $this->click("link=Fees"); $this->waitForElementPresent("_qf_Fee_upload-bottom"); $this->click("CIVICRM_QFID_1_is_monetary"); - $this->select2('payment_processor', $processorName, TRUE); + $this->select2('payment_processor', $processorIDs, TRUE); $this->select("financial_type_id", "value=4"); if ($priceSet) { // get one - TBD diff --git a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php index a87ffe6d2b..59f086fff5 100644 --- a/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OnlineContributionTest.php @@ -312,7 +312,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase { //View Contribution Record and verify data $expected = array( - 'From' => "{$email}", + 'From' => "{$firstName} {$lastName}", 'Financial Type' => 'Donation', $amountLabel => $amountValue, 'Contribution Status' => 'Completed', diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 5cad373435..6281320415 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -913,7 +913,8 @@ WHERE ceft.entity_id = %1 AND ceft.entity_table = 'civicrm_contribution'"; $this->waitForElementPresent('_qf_Fee_upload-bottom'); $this->click('CIVICRM_QFID_1_is_monetary'); $processorName = 'Test Processor'; - $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']"); + $this->select2('payment_processor', $processorName, TRUE); + $this->select('financial_type_id', 'label=Event Fee'); $this->type("label[1]", 'Junior Stars'); $this->type("value[1]", '500.00'); diff --git a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php index 4286be0bb6..cf5dc02acb 100644 --- a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php +++ b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php @@ -86,8 +86,8 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { $this->waitForTextPresent("$widgetTitle"); // click Full Screen icon and test full screen container - $this->waitForElementPresent("css=li#widget-2 a.fullscreen-icon"); - $this->click("css=li#widget-2 a.fullscreen-icon"); + $this->waitForElementPresent("css=li#widget-3 a.fa-expand"); + $this->click("css=li#widget-3 a.fa-expand"); $this->waitForElementPresent("ui-id-1"); $this->waitForTextPresent("$widgetTitle"); // Because it tends to cause problems, all uses of sleep() must be justified in comments @@ -134,7 +134,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { $this->WebtestAddActivity(); $widgetTitle = "Activities"; $widgetEnabledSelector = "contact-activity-selector-dashlet_wrapper"; - $widgetConfigureID = "2-0"; + $widgetConfigureID = "3-0"; // now add the widget $this->open($this->sboxPath . "civicrm"); diff --git a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php index 856cdc7612..826746a54f 100644 --- a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php +++ b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php @@ -357,12 +357,12 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { // click through to the activity view screen $this->click('css=li#tab_activity a'); - $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity crm-ajax-table dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity crm-ajax-table dataTable no-footer']/tbody/tr/td[8]/span/a"); // check number of activity for contact $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_activity']/a/em")); - $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity crm-ajax-table dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']@href")); + $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity crm-ajax-table dataTable no-footer']/tbody/tr/td[8]/span/a@href")); $expectedMembershipActivityId = $url['queryString']['id']; // verify membership id with membership activity id @@ -390,9 +390,9 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { // click through to the activity view screen after edit $this->click('css=li#tab_activity a'); - $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity crm-ajax-table dataTable no-footer']/tbody/tr/td[8]/span/a"); $this->assertEquals(1, $this->getText("xpath=//li[@id='tab_activity']/a/em")); - $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr/td[8]/span/a[text()='View']@href")); + $url = $this->parseURL($this->getAttribute("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a@href")); $actualMembershipActivityId1 = $url['queryString']['id']; // verify membership id and membership activity id with previous one -- 2.25.1