From f78f974584a8b3cff5adb9dae15d1477d8a2971d Mon Sep 17 00:00:00 2001 From: Rohan Katkar Date: Thu, 11 Dec 2014 18:54:46 +0530 Subject: [PATCH] Webtest Fix --- .../WebTest/Campaign/PetitionUsageScenarioTest.php | 4 ++-- tests/phpunit/WebTest/Event/AddRecurringEventTest.php | 2 +- tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php | 9 +++------ .../WebTest/Member/OfflineMembershipRenewTest.php | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php index e4fb42d8d0..8b5255ebce 100644 --- a/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/PetitionUsageScenarioTest.php @@ -160,8 +160,8 @@ class WebTest_Campaign_PetitionUsageScenarioTest extends CiviSeleniumTestCase { $this->type("petition_title", $title); $this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[2]/td/a[text()='Search']"); - $this->waitForElementPresent("xpath=//table['petitions dataTable no-footer']/tbody/tr/td[10]/span[2][text()='more']"); - $this->click("xpath=//table['petitions dataTable no-footer']/tbody/tr/td[10]/span[2][text()='more']/ul/li[3]/a[text()='Signatures']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[10]/span[2][text()='more']/ul/li[3]/a[text()='Signatures']"); $this->waitForPageToLoad($this->getTimeoutMsec()); // verify tabular data diff --git a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php index f42703489c..ae4d7bb09e 100644 --- a/tests/phpunit/WebTest/Event/AddRecurringEventTest.php +++ b/tests/phpunit/WebTest/Event/AddRecurringEventTest.php @@ -98,7 +98,7 @@ class WebTest_Event_AddRecurringEventTest extends CiviSeleniumTestCase { $countOfEvents = $this->getXpathCount("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr"); if ($countOfEvents) { for ($i = 0; $i <= $countOfEvents; $i++) { - $this->verifyText("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr/td/a", 'CiviCon'); + $this->verifyText("xpath=//div[@id='option11_wrapper']/table[@id='option11']/tbody/tr/td[1]/a", 'CiviCon'); } } } diff --git a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php index 20074d2e99..41907e4e86 100644 --- a/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php +++ b/tests/phpunit/WebTest/Generic/GeneralClickAroundTest.php @@ -210,14 +210,11 @@ class WebTest_Generic_GeneralClickAroundTest extends CiviSeleniumTestCase { $this->click("css=ul#civicrm-menu li.crm-Reports"); $this->clickLink("css=ul#civicrm-menu li.crm-Contact_Reports a"); - $this->clickLink("xpath=//div[@id='Contact']/table/tbody/tr/td/a"); + $this->clickLink("xpath=//div[@id='Contact']/table/tbody/tr/td[1]/a"); $this->assertTextPresent("Constituent Summary"); - $this->click("//div[contains(text(), 'Report Criteria')]"); - $this->waitForVisible("//h3[contains(text(), 'Display Columns')]"); - $this->click("//form[@id='Summary']/div[2]//div[@id='id_default']/div/div/div"); - $this->waitForVisible("//label[contains(text(), 'Most Important Issue')]"); - $this->assertTextPresent("Set Filters"); + $this->click("xpath=//div[@id='mainTabContainer']/ul/li[3]/a"); + $this->waitForElementPresent("xpath=//div[@id='report-tab-set-filters']"); $this->assertTextPresent("Contact Name"); $this->assertTextPresent("Contact Source"); $this->assertTextPresent("Country"); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index c4e56352cc..abc614f2d3 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -200,7 +200,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { // page was loaded $this->waitForTextPresent($sourceText); - $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span[1]/a[1][text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody/tr/td[9]/span[1]/a[1][text()='View']"); // click through to the membership view screen $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span[1]/a[1][text()='View']"); -- 2.25.1