Webtests fixes - CRM:18454
authorWeb Access <rohan.katkar@webaccessglobal.com>
Wed, 27 Apr 2016 13:20:55 +0000 (18:50 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Wed, 27 Apr 2016 13:20:55 +0000 (18:50 +0530)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contact/SearchBuilderTest.php
tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php
tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php

index e2da3a3c16bf7389954eb6c064321f7d3933fd41..4024dc65f3c802db077c96dec8d01c1a4cb4ac6b 100644 (file)
@@ -1548,7 +1548,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
     $this->type('duration_interval', $duration_interval);
     $this->select('duration_unit', "label={$duration_unit}");
-
+    $this->waitForElementPresent('period_type');
     $this->select('period_type', "value={$period_type}");
 
     $this->click('_qf_MembershipType_upload-bottom');
index 0321ac540f5ccb16696d9aeb4dba8defa752001a..65674caee4bb11cf8586e8f994b74669e6ff0903 100644 (file)
@@ -153,6 +153,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->waitForElementPresent("_qf_EventInfo_upload-bottom");
 
     $this->select("event_type_id", "value=1");
+    $this->waitForAjaxContent();
 
     // Attendee role s/b selected now.
     $this->select("default_role_id", "value=1");
@@ -188,6 +189,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->type("address_1_city", "San Francisco");
     $this->type("address_1_postal_code", "94117");
     $this->select('address_1_country_id', 'UNITED STATES');
+    $this->waitForAjaxContent();
     $this->select("address_1_state_province_id", "value=1004");
     $this->type("email_1_email", "info@civicrm.org");
 
@@ -246,7 +248,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->clickLink("_qf_Basic_refresh", "//div[@class='crm-search-results']/table[@class='selector row-highlight']/tbody/tr/", FALSE);
 
     // click through to the Contribution view screen
-    $this->click("xpath=//div[@class='crm-search-results']/table[@class='selector row-highlight']/tbody/tr/td[11]//span/a[text()='View']");
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr/td[11]//span/a[text()='View']");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     $this->click("css=li#tab_rel a");
@@ -304,7 +306,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->select2("event_type_id", "Conference");
     $this->click("_qf_Advanced_refresh");
     $this->waitForElementPresent("xpath=//div[@class='crm-content-block']//div[@id='search-status']");
-    $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Contacts");
+    $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Contacts");
   }
 
   public function testAdvanceSearchForLog() {
index c2723e417c0fd334819c7ce25955673f0a479ee5..50ea4b529e843086c8e95e3a304469e6b3623587 100644 (file)
@@ -463,6 +463,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
     $this->select("membership_type_id[0]", "label={$membershipTypes['member_of_contact']}");
 
     // select membership type
+    $this->waitForElementPresent("membership_type_id[1]");
     $this->select("membership_type_id[1]", "label={$membershipTypes['membership_type']}");
 
     // fill in Source
@@ -532,7 +533,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh");
     $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE);
     $this->clickLink('_qf_Search_refresh');
-    $this->assertElementContainsText("xpath=//div[@class='crm-content-block']//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result");
+    $this->assertElementContainsText("xpath=//div[@id='search-status']/table/tbody/tr[1]/td[1]", "2 Result");
 
     $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']");
     $this->multiselect2("membership_status_id", array("New", "Grace"));
index 25506f605af224a17c1615c1812d818937c566d2..97f227fc380366f338ec13920b90a633f9c45de1 100644 (file)
@@ -70,8 +70,11 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase {
     $this->assertTrue($this->isTextPresent("2 Contacts"), 'Looking for 2 results with email like ' . $emailString);
 
     // Click "check all" box and act on "Add to group" action
+    $this->waitForAjaxContent();
     $this->click('toggleSelect');
+    $this->waitForAjaxContent();
     $this->waitForText("xpath=//input[@value='ts_sel']/following-sibling::label/span", '2');
+    $this->waitForAjaxContent();
     $this->select("task", "label=Group - add contacts");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index 7ba6e8b0ce11aacb948025a9f6af2527aea1c191..adeca9dbcf5557d786e87c074dd530d38f835545 100644 (file)
@@ -77,13 +77,14 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
 
-    $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 100);
+    $this->type("xpath=//div[@class='crm-section other_amount-section']//div/input", 100);
 
     $streetAddress = "100 Main Street";
     $this->type("street_address-1", $streetAddress);
     $this->type("city-1", "San Francisco");
     $this->type("postal_code-1", "94117");
     $this->select("country-1", "value=1228");
+    $this->waitForElementPresent("state_province-1");
     $this->select("state_province-1", "value=1001");
 
     $this->assertTrue($this->isTextPresent("Payment Method"));
@@ -160,13 +161,14 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
 
-    $this->type("xpath=//div[@class='crm-section other_amount-section']//div[2]/input", 100);
+    $this->type("xpath=//div[@class='crm-section other_amount-section']//div/input", 100);
 
     $streetAddress = "100 Main Street";
     $this->type("street_address-1", $streetAddress);
     $this->type("city-1", "San Francisco");
     $this->type("postal_code-1", "94117");
     $this->select("country-1", "value=1228");
+    $this->waitForElementPresent("state_province-1");
     $this->select("state_province-1", "value=1001");
 
     $this->assertTrue($this->isTextPresent("Payment Method"));