Webtest Fix 4.5.0
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 16 Sep 2014 13:29:22 +0000 (18:59 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 16 Sep 2014 13:29:22 +0000 (18:59 +0530)
tests/phpunit/WebTest/Campaign/ActivityTest.php
tests/phpunit/WebTest/Event/AdditionalPaymentTest.php
tests/phpunit/WebTest/Event/ParticipantCountTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php

index e314cdad044e69e79068208fd364a703ad1b4b8b..9860078323addfd52bcd9bb35cf2a83e3b98ef92 100644 (file)
@@ -199,9 +199,10 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase {
     // click through to the Activity view screen
     $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody//tr[1]/td[8]/span/a[text()='View']");
     $this->waitForElementPresent('_qf_Activity_cancel-bottom');
+    $this->waitForElementPresent("xpath=id('Activity')/div[2]/table[1]/tbody/tr[5]/td[2]/span");
 
     // verify Activity created
-    $this->waitForText("xpath=id('Activity')/div[2]/table[1]/tbody/tr[5]/td[2]/span", $campaignTitle);
+    $this->verifyText("xpath=id('Activity')/div[2]/table[1]/tbody/tr[5]/td[2]/span", $campaignTitle);
   }
 }
 
index bccd4c51a94eb5107d14ed32055ee240016f13d3..268b87e5b3ea3e97f648e0bf684ea45fa5c34719 100644 (file)
@@ -158,7 +158,6 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
 
     $this->open($location);
     $this->waitForElementPresent("xpath=id('AdditionalPayment')");
-    $this->assertElementContainsText("xpath=id('AdditionalPayment')/h3", 'New Event Payment');
 
     // verify balance
     $text = $this->getText("xpath=id('AdditionalPayment')/div[2]//table/tbody/tr[3]/td[2]");
index 945e1e59dfaf659cbe5075c8c5ecf2d5355ce3c7..1d35f1a5efeb302e336e5240fe6013ff5f8cb703 100644 (file)
@@ -188,7 +188,8 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
       else {
         $this->_testAddMultipleChoiceOptions($field['options']);
       }
-      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom', FALSE);
+      $this->waitForText("crm-notification-container", "Price Field '$label' has been saved.");
     }
 
     // create event.
@@ -447,7 +448,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->click('_qf_Custom_refresh-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $tableHeaders = array('Contact Id', 'Participant Id', 'Name');
+    $tableHeaders = array('Contact ID', 'Participant Id', 'Name');
     $tableHeaders = array_merge($tableHeaders, array_keys(current($priceFieldOptionCounts)));
 
     $tdnum = 2;
index c52c9c805466f8d1bb1390df660921d62b3abc4f..915da97e50e5c66ae473e9ebf5c7da40404a3f10 100644 (file)
@@ -63,8 +63,9 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     // Justification for this instance: FIXME
     sleep(3);
     $this->select("group_id", "label=Case Resources");
-    $this->clickLink("_qf_GroupContact_next", "xpath=//form[@id='GroupContact']//div[@class='view-content view-contact-groups']//div[@class='dataTables_wrapper']/table/tbody/tr/td[4]/a", FALSE);
-    $this->click("xpath=//form[@id='GroupContact']//div[@class='view-content view-contact-groups']//div[@class='dataTables_wrapper']/table/tbody/tr/td[4]/a");
+    $this->click("_qf_GroupContact_next");
+    $this->waitForElementPresent("xpath=//form[@id='GroupContact']//div[@class='view-content view-contact-groups']//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/a");
+    $this->click("xpath=//form[@id='GroupContact']//div[@class='view-content view-contact-groups']//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/a");
 
     // Check confirmation alert.
     $this->waitForText("xpath=//div[@class='crm-confirm-dialog ui-dialog-content ui-widget-content modal-dialog']", "Remove $firstName $lastName from Case Resources?");
@@ -77,11 +78,11 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     // Sleep should never be used for wait for anything to load from the server
     // Justification for this instance: FIXME
     sleep(3);
-    $this->click("xpath=//div[@id='tagtree']/ul//li/label[text()='Company']/../input");
+    $this->click("xpath=//div[@id='tagtree']/ul//li/span/label[text()='Company']");
     $this->waitForTextPresent("Saved");
-    $this->click("xpath=//div[@id='tagtree']/ul//li/label[text()='Government Entity']/../input");
+    $this->click("xpath=//div[@id='tagtree']/ul//li/span/label[text()='Government Entity']");
     $this->waitForTextPresent("Saved");
-    $this->click("xpath=//div[@id='tagtree']/ul//li/label[text()='Company']/../input");
+    $this->click("xpath=//div[@id='tagtree']/ul//li/span/label[text()='Company']");
     $this->waitForTextPresent("Saved");
 
     //add new note
@@ -109,7 +110,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
 
     $this->click("xpath=//div[@class='crm-results-block']/div[@id='notes']/div/table/tbody/tr//td/span[2]/ul/li[2]/a[text()='Delete']");
     // Check confirmation alert.
-    $this->waitForText("xpath=//form[@id='Note']/div[@class='view-content']/fieldset/div[@class='status']", "Are you sure you want to delete the note ''?");
+    $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']");
     $this->waitForText('crm-notification-container', "Selected Note has been deleted successfully.");
 
@@ -122,12 +123,12 @@ 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[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[1]/a[text()='Disable']");
-    $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//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']", 'Are you sure you want to disable this record?');
-    $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Disable']");
-    $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-past_wrapper']//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[2]/a[text()='Delete']");
-    $this->click("xpath=//div[@id='crm-contact-relationship-selector-past_wrapper']//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[2]/a[text()='Delete']");
+    $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->waitForText("xpath=//div[@class='crm-confirm-dialog ui-dialog-content ui-widget-content modal-dialog']", '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']");
+    $this->click("xpath=//div[@class='crm-contact-relationship-past']/div//table/tbody//tr/td[9]/span[2][text()='more']/ul/li[2]/a[text()='Delete']");
     $this->waitForText("xpath=//form[@id='Relationship']/div[@class='status']", "Are you sure you want to delete this Relationship?");
     $this->click("_qf_Relationship_next-bottom");
     $this->waitForElementPresent("link=Add Relationship");
@@ -146,13 +147,13 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->select("other_activity", "label=Interview");
     $this->waitForElementPresent("_qf_Activity_cancel-bottom");
     $this->click('_qf_Activity_upload-bottom');
-    $this->waitForElementPresent("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[8]/span/a[2]");
-    $this->click("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[8]/span/a[2]");
+    $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
+    $this->click("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[8]/span/a[2]");
     $this->waitForElementPresent("_qf_Activity_cancel-bottom");
     $this->select("status_id","value=2");
     $this->click('_qf_Activity_upload-bottom');
     $this->waitForText("crm-notification-container", "Activity has been saved.");
-    $this->waitForElementPresent("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[7][text()='Completed']");
+    $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[7][text()='Completed']");
 
     //add a case
     $this->click("xpath=//li[@id='tab_case']/a");