Webtests Fixes
authorWeb Access <rohan.katkar@webaccessglobal.com>
Fri, 20 Nov 2015 12:55:45 +0000 (18:25 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Fri, 20 Nov 2015 12:55:45 +0000 (18:25 +0530)
tests/phpunit/WebTest/Activity/ContactContextAddTest.php
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php

index af0c8011538d7efebc843c3289aa725399c1f014..fce3cfb269259b92326e581633c3bfee539fd1c0 100644 (file)
@@ -118,7 +118,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
 
     // click through to the Activity view screen
-    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
+    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr//td/div[text()='$subject']/../../td[8]/span[1]/a[1][text()='View']");
     $this->waitForElementPresent('_qf_Activity_cancel-bottom');
 
     // verify Activity created
index 734aef7def216cf9fceb2c8f86be5d4a8614af9c..611388bfdf2ca69a4e39a2911284ff6562f0685f 100644 (file)
@@ -442,6 +442,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->type("max_number_of_contacts", 100);
 
     // release frequency
+    $this->waitForElementPresent('release_frequency');
     $this->type("release_frequency", 2);
 
     $this->click("_qf_Main_upload-bottom");
@@ -556,7 +557,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     // Because it tends to cause problems, all uses of sleep() must be justified in comments
     // Sleep should never be used for wait for anything to load from the server
     // Justification for this instance: FIXME
-    sleep(3);
+    $this->waitForAjaxContent();
     // Survey Report
     $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit');
 
index 228ea1973dd2999cba4b6992492dc8c0eeacb37f..fd0f6811c9f0663500bea0d9356ebb775d98b0b0 100644 (file)
@@ -838,6 +838,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->select('relationship_type_id', "value=5_b_a");
 
     //fill in the individual
+    $this->waitForElementPresent('related_contact_id');
     $this->select2('related_contact_id', $sortName, TRUE, FALSE);
 
     $this->waitForElementPresent("_qf_Relationship_upload");
index 866ce8a7c6dd4b7d0c8750296506ba605eb3ef28..c6e9fb5665f005527f9bde6bdb0c966dcbbbc758 100644 (file)
@@ -114,11 +114,12 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[2]/td[2]/table[@class='nestedSelector']/tbody/tr[3]/td[8]/a[text()='View Payment']");
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']/tbody/tr[2]/td[2]/table[@class='nestedSelector']/tbody/tr[3]/td[8]/a");
-    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']");
-    $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']");
-    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']");
-    $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Delete']");
-
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[2]");
+    $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]");
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[text()='Delete']");
+    $this->waitForAjaxContent();
+    $this->click("xpath=//div[@class='ui-dialog-buttonset']//button/span[text()='Delete']");
+    $this->waitForAjaxContent();
     $this->waitForElementPresent("xpath=//li[@id='tab_pledge']/a");
     $this->click("xpath=//li[@id='tab_pledge']/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']");
@@ -126,12 +127,15 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
     $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]");
 
+    $this->waitForAjaxContent();
     $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]", "Pending");
     $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td");
 
     // verify that payment owed amount is correct (250.00)
+    $this->waitForAjaxContent();
     $this->verifyText("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td", "250.00");
     // verify that Total Paid and Balance sums are correct
+    $this->waitForAjaxContent();
     $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[3]", "470.00");
     $this->verifyText("xpath=//div[@class='view-content' and contains(., 'view pledge payments')]/table[@class='selector row-highlight']//tbody/tr[1]/td[4]", "1,930.00");