From e0f528d0dfd6f2470f0b3c4e06eed595bff36f30 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Thu, 26 Feb 2015 18:39:39 +0530 Subject: [PATCH] Fixed broken webtest --- .../phpunit/WebTest/Contribute/StandaloneAddTest.php | 4 ++-- tests/phpunit/WebTest/Event/AddParticipationTest.php | 4 ++-- tests/phpunit/WebTest/Event/AddPricesetTest.php | 4 +--- tests/phpunit/WebTest/Member/EditMembershipTest.php | 11 ++++------- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 0dd96e6c2d..fca11c9b13 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -198,7 +198,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->select("financial_type_id", "label={$financialType['name']}"); $this->clickLink("_qf_Search_refresh"); $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result"); - $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[2]", "Financial Type IN {$financialType['name']}"); + $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); $this->openCiviPage("contact/search/advanced", "reset=1", "_qf_Advanced_refresh-top"); $this->clickAjaxLink('CiviContribute', "financial_type_id"); @@ -207,7 +207,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->select("financial_type_id", "label={$financialType['name']}"); $this->clickLink("_qf_Advanced_refresh-top"); $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[1]", "2 Contacts"); - $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[2]", "Financial Type IN {$financialType['name']}"); + $this->assertElementContainsText("xpath=//div[@id='search-status']//table/tbody/tr[1]/td[2]", "Financial Type ID In {$financialType['name']}"); } /** diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 1c26be908e..5ac33ac5bf 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -95,7 +95,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen - $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); + $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( array( @@ -284,7 +284,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//*[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen - $this->clickAjaxLink("xpath=//*[@id='Search']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); + $this->clickAjaxLink("xpath=//*[@id='Search']/table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_ParticipantView_cancel-bottom'); $this->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index 87ef980854..d49f3936e8 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -216,7 +216,6 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $validStrings = array(); $fields = array( 'Full Conference' => 'Text', - 'Meal Choice' => 'Select', 'Pre-conference Meetup?' => 'Radio', 'Evening Sessions' => 'CheckBox', ); @@ -263,7 +262,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $this->click('link=Fees'); $this->waitForElementPresent('_qf_Fee_upload_done-bottom'); $this->click('CIVICRM_QFID_1_is_monetary'); - $this->click("xpath=//tbale[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']"); + $this->click("xpath=//table[@id='paymentProcessor']/tbody/tr[1]/td[2]/label[text()='$processorName']"); $this->select('financial_type_id', 'label=Event Fee'); $this->select('price_set_id', 'label=' . $setTitle); @@ -376,7 +375,6 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { $validStrings = array(); $fields = array( 'Full Conference' => 'Text', - 'Meal Choice' => 'Select', 'Pre-conference Meetup?' => 'Radio', 'Evening Sessions' => 'CheckBox', ); diff --git a/tests/phpunit/WebTest/Member/EditMembershipTest.php b/tests/phpunit/WebTest/Member/EditMembershipTest.php index c22174a794..2893075ddb 100644 --- a/tests/phpunit/WebTest/Member/EditMembershipTest.php +++ b/tests/phpunit/WebTest/Member/EditMembershipTest.php @@ -91,16 +91,13 @@ class WebTest_Member_EditMembershipTest extends CiviSeleniumTestCase { $this->openCiviPage('activity/search', 'reset=1', "_qf_Search_refresh"); $this->type("sort_name", $contactName); - $this->click('activity_type_id[35]'); - $this->click('activity_type_id[36]'); + $this->select('activity_type_id', 'value=35'); + $this->select('activity_type_id', 'value=36'); $this->clickLink("_qf_Search_refresh"); - $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[2]/td[2][text()='Change Membership Status']")); - $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[2]/td[3][text()='Status changed from New to Current']")); + $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[2]/td[2][text()='Change Membership Type']")); + $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[2]/td[3][text()='Type changed from {$membershipTypes['membership_type']} to General']")); $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[2]/td[5]/a[text()='{$contactName}']")); - $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[3]/td[2][text()='Change Membership Type']")); - $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[3]/td[3][text()='Type changed from {$membershipTypes['membership_type']} to General']")); - $this->assertTrue($this->isElementPresent("xpath=//div[@class='crm-search-results']/table/tbody/tr[3]/td[5]/a[text()='{$contactName}']")); } } -- 2.25.1