Webtest Fixes
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Tue, 16 Dec 2014 13:21:56 +0000 (18:51 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Tue, 16 Dec 2014 13:21:56 +0000 (18:51 +0530)
tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php
tests/phpunit/WebTest/Campaign/OnlineContributionTest.php
tests/phpunit/WebTest/Case/AddCaseTest.php
tests/phpunit/WebTest/Case/AddCaseTypeTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php
tests/phpunit/WebTest/Report/RolePermissionReportTest.php

index b3ad43088bb9029b6b3742fdf33b35138e9ddff8..2d86dd8312a3ea1c38f399f63e176d1176482cda 100755 (executable)
@@ -78,7 +78,7 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase {
     //Create role
     $role = 'role' . substr(sha1(rand()), 0, 7);
     $this->open($this->sboxPath . "admin/people/permissions/roles");
-    $this->waitForElementPresent("edit-add");
+    $this->waitForElementPresent("edit-submit");
     $this->type("edit-name", $role);
     $this->click("edit-add");
     $this->waitForPageToLoad($this->getTimeoutMsec());
index cfe5bd4e4a77cb4d7e42597302782c06b1d83e40..6b4ad40cf47901eb58bb6ae26a40831b5983c3fc 100644 (file)
@@ -297,12 +297,11 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
     //Find Contribution
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
-    $this->type("sort_name", "$firstName $lastName");
+    $this->type("sort_name", "$lastName $firstName");
     $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
     $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom", FALSE);
-
     //View Contribution Record
-    $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[10]/td[2]", preg_quote($campaignTitle));
+    $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody/tr[11]/td[2]", preg_quote($campaignTitle));
   }
 
 }
index 4a73b1d08a3e0112b36d65685c4c1963578be641..9b226b867054558c3712672540c7b26f5d30a0c5 100644 (file)
@@ -168,7 +168,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
   function _testVerifyCaseSummary($validateStrings, $activityTypes) {
     $this->assertStringsPresent($validateStrings);
     foreach ($activityTypes as $aType) {
-      $this->assertText("add_activity_type_id", $aType);
+      $this->assertElementPresent("xpath=//div[@class='case-control-panel']/div/p/select", $aType);
     }
     $this->assertElementPresent("link=Assign to Another Client", "Assign to Another Client link is missing.");
     $this->assertElementPresent("xpath=//a[text()=' Print Report']", "Print Case Summary button is missing.");
index 443eb7b839d0e7193f8087782a64a4b61b5fd7a8..b97957f6637da5cc2ae5555c89d8852f13e1e58a 100644 (file)
@@ -100,7 +100,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "Case opened successfully.");
 
     foreach ($activityTypes as $aType) {
-      $this->assertText("add_activity_type_id", $aType);
+      $this->assertElementPresent("xpath=//div[@class='case-control-panel']/div/p/select", $aType);
     }
 
     $this->click("xpath=//div[contains(text(), 'Roles')]");
index 5ce5c1938bb68ddccb5d515e0be5261e386f07b8..85f01aced65cac35816bc1100ab256cd1e29b9b0 100644 (file)
@@ -100,15 +100,14 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->type('subject', $noteSubject);
     $this->type('note', $noteText);
     $this->click("_qf_Note_upload-top");
-    $this->waitForElementPresent("xpath=//div[@id='notes']//a[text()='Edit']");
-    $this->click("xpath=//div[@id='notes']//a[text()='Edit']");
-
+    $this->waitForElementPresent("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[1]/a[2][text()='Edit']");
+    $this->click("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[1]/a[2][text()='Edit']");
     $this->waitForElementPresent("_qf_Note_upload-top");
     $this->type('subject', $noteSubject . "_edited");
     $this->type('note', $noteText . "_edited");
     $this->clickLink("_qf_Note_upload-top", "xpath=//div[@class='crm-results-block']/div[@id='notes']/div/table/tbody/tr//td/span[2]/ul/li[2]/a[text()='Delete']", FALSE);
 
-    $this->click("xpath=//div[@class='crm-results-block']/div[@id='notes']/div/table/tbody/tr//td/span[2]/ul/li[2]/a[text()='Delete']");
+    $this->click("xpath=//div[@id='notes']/div/table/tbody/tr/td[7]/span[2]/ul/li[2]/a[text()='Delete']");
     // Check confirmation alert.
     $this->waitForText("xpath=//form[@id='Note']/div[@class='view-content']/div[@class='status']", "Are you sure you want to delete the note ''?");
     $this->click("xpath=//input[@id='_qf_Note_next']");
@@ -123,8 +122,9 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->select("relationship_type_id", "label=Employee of");
     $this->select2('related_contact_id', 'Default', TRUE);
     $this->click('_qf_Relationship_upload-bottom');
-    $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
-    $this->click("xpath=//div[@class='crm-contact-relationship-current']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
+    $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
+
+    $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div/table/tbody/tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
     $this->waitForText("xpath=//div[@class='crm-confirm-dialog ui-dialog-content ui-widget-content modal-dialog crm-ajax-container']", 'Are you sure you want to disable this relationship?');
     $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Yes']");
     $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-past']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[2]/a[text()='Delete']");
@@ -164,8 +164,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=//div[@class='view-content']/table[@class='caseSelector']/tbody/tr[2]/td[9]//span//a[text()='Manage']");
-    $this->click("xpath=//div[@class='view-content']/table[@class='caseSelector']/tbody/tr[2]/td[9]//span//a[text()='Manage']");
+    $this->waitForElementPresent("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/a[1][text()='Manage']");
+    $this->click("xpath=//form[@id='Search']/div[2]/div/table/tbody/tr[2]/td[9]/span[1]/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");
index 7156faef3acf12b0ccfb05407175fab193a382c0..7ef4a566fe5c5109a18650b5f805c6aa7775365b 100644 (file)
@@ -76,7 +76,7 @@ class WebTest_Report_RolePermissionReportTest extends CiviSeleniumTestCase {
 
     // change report setting to for a particular role
     $this->openCiviPage('report/instance/1', 'reset=1');
-    $this->click("css=div.crm-report_setting-accordion div.crm-accordion-header");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul/li[6]/a");
     $this->waitForElementPresent("_qf_Summary_submit_save");
     $this->select("permission", "value=access CiviCRM");
     $this->select("grouprole-f", "value=$role1");