From: Web Access Date: Tue, 12 May 2015 14:10:46 +0000 (+0530) Subject: Webtest Fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=05e39ac3461c954ed449aa68f36d3115e0006eb4;p=civicrm-core.git Webtest Fix --- diff --git a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php index 935696720c..a845942b75 100644 --- a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php @@ -117,11 +117,10 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText('crm-notification-container', $subject); - $this->waitForElementPresent( - "xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']//tbody//tr[2]/td[8]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); // click through to the Activity view screen - $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']//tbody//tr[2]/td[8]/span/a[text()='View']"); + $this->click("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); $this->waitForElementPresent('_qf_Activity_cancel-bottom'); // verify Activity created diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index 2d01e2d7b5..26f2de9ec5 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -195,10 +195,10 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { // Is status message correct? $this->waitForText('crm-notification-container', $subject); - $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[1]/td[8]/span/a[1][text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); // click through to the Activity view screen - $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr[2]/td[8]/span/a[text()='View']"); + $this->click("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']"); $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]"); // verify Activity created diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 011e388453..ba277039b2 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -92,10 +92,10 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type("sort_name", $sortName); $this->select("contact_type", "value=Individual"); - $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/"); + $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/"); // click through to the Relationship view screen - $this->click("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/td[11]/span/a[text()='View']"); + $this->click("xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/td[11]/span/a[text()='View']"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("css=li#tab_participant a"); diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index 5d190d87bc..23f1d3c7f0 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -337,8 +337,8 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//table[@class='crm-contact-relationship-selector-current dataTable no-footer']/tbody/tr/td[9]/span/a[1][text()='View']"); - $this->click("xpath=//table[@class='crm-contact-relationship-selector-current dataTable no-footer']/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]/a[1]"); + $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]/a[1]"); $this->webtestVerifyTabularData( array( diff --git a/tests/phpunit/WebTest/Contact/TagAddTest.php b/tests/phpunit/WebTest/Contact/TagAddTest.php index 0bcf025bc2..92bcba58c5 100644 --- a/tests/phpunit/WebTest/Contact/TagAddTest.php +++ b/tests/phpunit/WebTest/Contact/TagAddTest.php @@ -63,7 +63,7 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("The tag '$tagName' has been saved.")); // sort by ID desc - $this->click("xpath=//table//tr/th[text()=\"ID\"]"); + $this->click("xpath=//div[@id='cat']/div/table/thead/tr/th[2]/div[text()='ID']"); $this->waitForElementPresent("css=table.display tbody tr td"); // verify text @@ -101,7 +101,7 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("The tag '$tagSetName' has been saved.")); // sort by ID desc - $this->click("xpath=//table//tr/th[text()=\"ID\"]"); + $this->click("xpath=//div[@id='cat']/div/table/thead/tr/th[2]/div[text()='ID']"); $this->waitForElementPresent("css=table.display tbody tr td"); // verify text diff --git a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php index 82a1dee04b..d09acb8230 100644 --- a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php +++ b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php @@ -144,7 +144,7 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "The tag '$tagSetName' has been saved."); // sort by ID desc - $this->click("xpath=//table//tr/th[text()=\"ID\"]"); + $this->click("xpath=//div[@id='cat']/div/table/thead/tr/th[2]/div[text()='ID']"); $this->waitForElementPresent("css=table.display tbody tr td"); // verify text diff --git a/tests/phpunit/WebTest/Report/LoggingReportTest.php b/tests/phpunit/WebTest/Report/LoggingReportTest.php index 7b6e0d357a..903cd4299b 100644 --- a/tests/phpunit/WebTest/Report/LoggingReportTest.php +++ b/tests/phpunit/WebTest/Report/LoggingReportTest.php @@ -151,12 +151,13 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr//td//span/a[text()='Edit']"); $this->waitForElementPresent("_qf_Activity_cancel-bottom"); $this->select("status_id", "value=2"); + $this->waitForAjaxContent(); $this->click('_qf_Activity_upload-bottom'); $this->waitForText("crm-notification-container", "Activity has been saved."); - $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[7][text()='Completed']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/div"); + $this->verifyText("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/div", 'Completed'); //add a case - $this->waitForAjaxContent(); $this->click("xpath=//li[@id='tab_case']/a"); $this->waitForElementPresent("xpath=//form[@id='Search']//div/div//div[@class='action-link']/a"); $this->click("xpath=//form[@id='Search']//div/div//div[@class='action-link']/a"); @@ -164,8 +165,8 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase { $this->type('activity_subject', "subject" . rand()); $this->select('case_type_id', 'value=1'); $this->click('_qf_Case_upload-bottom'); - $this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[9]//span/a[text()='Manage']"); - $this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[9]//span/a[text()='Manage']"); + $this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[9]//span/a[1][text()='Manage']"); + $this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[9]//span/a[1][text()='Manage']"); $this->waitForElementPresent("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a"); $this->click("xpath=//form[@id='CaseView']/div[2]/table/tbody/tr/td[4]/a"); $this->waitForElementPresent("_qf_Activity_cancel-bottom");