From da2fd2e89f564a5d3f2600a046d8d3eadb7d673c Mon Sep 17 00:00:00 2001 From: monishdeb Date: Tue, 13 Aug 2013 18:21:07 +0530 Subject: [PATCH] Webtest Fixes --- tests/phpunit/CiviTest/CiviSeleniumTestCase.php | 4 ++-- tests/phpunit/WebTest/Contact/MergeContactsTest.php | 10 +++++----- .../phpunit/WebTest/Contact/SearchbyDateFilterTest.php | 2 +- tests/phpunit/WebTest/Generic/CheckDashboardTest.php | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index d49ce50b8a..f1b3e80721 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -1329,10 +1329,10 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { // Is status message correct? $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!"); - $this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[8]/span/a[text()='View']"); // click through to the Activity view screen - $this->click("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[9]/span/a[text()='View']"); + $this->click("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[8]/span/a[text()='View']"); $this->waitForElementPresent('_qf_Activity_cancel-bottom'); // parse URL to grab the activity id diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 73ac5246d6..7b6a952dba 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -335,8 +335,8 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']"); $this->click("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']"); $this->waitForElementPresent('_qf_Merge_cancel-bottom'); - $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']"); - $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(add)']"); + $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(overwrite)']"); + $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[4]/td[4]/span[text()='(add)']"); $this->waitForElementPresent('_qf_Merge_cancel-bottom'); $this->check("move_location_email_1"); @@ -424,9 +424,9 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//table[@class='pagerDisplay']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']"); $this->click("xpath=//table[@class='pagerDisplay']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']/../../td[4]/a[text()='merge']"); $this->waitForElementPresent('_qf_Merge_cancel-bottom'); - $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']"); - $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(add)']"); - $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[4]/td[4]/span[text()='(overwrite)']"); + $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(overwrite)']"); + $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[4]/td[4]/span[text()='(add)']"); + $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[5]/td[4]/span[text()='(overwrite)']"); $this->select('location_email_1_locTypeId', 'value=3'); $this->select('location_phone_1_locTypeId', 'value=1'); $this->assertFalse($this->isElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']")); diff --git a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php index 82e57abf88..146d6459b2 100644 --- a/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php +++ b/tests/phpunit/WebTest/Contact/SearchbyDateFilterTest.php @@ -222,7 +222,7 @@ class WebTest_Contact_SearchbyDateFilterTest extends CiviSeleniumTestCase { 'activity' => array( 'headerLocator' => 'div#activity', - 'bodyLocator' => 'input#activity_contact_name', + 'bodyLocator' => 'select#activity_date_relative', 'title' => 'Activities', 'fields' => array( diff --git a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php index 22bc41c8a5..09737aacb2 100644 --- a/tests/phpunit/WebTest/Generic/CheckDashboardTest.php +++ b/tests/phpunit/WebTest/Generic/CheckDashboardTest.php @@ -136,7 +136,7 @@ class WebTest_Generic_CheckDashboardTest extends CiviSeleniumTestCase { } else { // click 'Delete Activity' link - $this->click("//table[@id='contact-activity-selector-dashlet']/tbody/tr[1]/td[9]/span//a[text()='Delete']"); + $this->click("//table[@id='contact-activity-selector-dashlet']/tbody/tr[1]/td[8]/span//a[text()='Delete']"); } $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Activity_next-bottom"); -- 2.25.1