-- webtest fixes and improvement
authorRavish Nair <ravish@ravish.(none)>
Thu, 28 Mar 2013 13:24:16 +0000 (18:54 +0530)
committerRavish Nair <ravish@ravish.(none)>
Thu, 28 Mar 2013 13:24:16 +0000 (18:54 +0530)
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php

index 8015d746b1d02a916a34a5f5b957e75100f00e78..9c53597e2d588896b1e571c5045c0804446fc97a 100644 (file)
@@ -534,8 +534,8 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Interview_cancel_interview');
 
     $this->type("field_{$id1}_phone-Primary-1", 9876543210);
-    $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[2]/../label[text()='$label1']");
-    $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[5]/input[6]/../label[text()='$label2']");
+    $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[2]/../label[text()='$label1']");
+    $this->click("//table[@id='voterRecords']/tbody//tr[@id='row_{$id1}']/td[7]/input[6]/../label[text()='$label2']");
     $this->select("field_{$id1}_result", $optionLabel1);
     $this->click("interview_voter_button_{$id1}");
     // Because it tends to cause problems, all uses of sleep() must be justified in comments
index 6f069c3aaa50897e5ca105fb004d00719a5391cc..2425293b9d8f6f58021c79b9c871217ffc317e20 100644 (file)
@@ -206,7 +206,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
 
     $this->click("xpath=//div[@id='activities']//table[@id='activities-selector']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/a[text()='Scheduled']");
 
-    $this->waitForElementPresent("css=div#changeStatusDialog");
+    $this->waitForElementPresent("xpath=//html/body/div[7]");
     $this->waitForElementPresent('activity_change_status');
 
     // change activity status
index 8826cecd2dbba28df5e957d8324a12e719fdeda0..e82a3868569784c5693292b606c1d25604710647 100644 (file)
@@ -101,7 +101,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
@@ -119,7 +119,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->type("email_1_email", $email2);
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
@@ -263,7 +263,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is status message correct?
-    $this->assertTrue($this->isTextPresent("Activity '$subject' has been saved."), "Status message didn't show up after saving!");
+    $this->waitForText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!");
   }
 
   function testMergeTest() {
@@ -322,7 +322,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
@@ -411,7 +411,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     // Clicking save.
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
@@ -520,7 +520,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");
@@ -629,7 +629,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->click("_qf_Contact_refresh_dedupe");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact."));
+    $this->waitForText('crm-notification-container', "One matching contact was found. You can View or Edit the existing contact.");
     $this->click("_qf_Contact_upload_duplicate");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Contact Saved");