Webtest Fix
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Mon, 22 Sep 2014 13:29:38 +0000 (18:59 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Mon, 22 Sep 2014 13:29:38 +0000 (18:59 +0530)
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contribute/StandaloneAddTest.php
tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php

index d3053109c2bcbc48e5782410991e8c4f4ccb1435..74e6c266a44e2e0fa3db58c69aad14fb3dcbaee5 100644 (file)
@@ -112,6 +112,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->click('_qf_Advanced_refresh');
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
+    $this->waitForElementPresent('search-status');
     $this->assertElementContainsText('search-status', '1 Contact');
 
     $this->click('css=div.crm-advanced_search_form-accordion div.crm-accordion-header');
@@ -120,6 +121,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->click('_qf_Advanced_refresh');
     $this->waitForPageToLoad(2 * $this->getTimeoutMsec());
 
+    $this->waitForElementPresent('search-status');
     $this->assertElementContainsText('search-status', '2 Contact');
 
     $this->select("task", "label=Add Contacts to Group");
@@ -298,6 +300,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->select2("event_type_id", "Conference");
     $this->click("_qf_Advanced_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent('search-status');
     $this->assertElementContainsText('search-status', '2 Contacts');
   }
 
index c539717886cf0689785f50435008db6f4fd628c3..a3d92c8ba000054a44579324e9440db93ea3bda6 100644 (file)
@@ -163,22 +163,21 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase {
     }
 
     // go to first soft creditor contact view page
-    $this->click("css=table.crm-soft-credit-listing tbody tr td a");
+    $this->clickLink("css=table.crm-soft-credit-listing tbody tr td a");
 
     // go to contribution tab
     $this->waitForElementPresent("css=li#tab_contribute a");
     $this->click("css=li#tab_contribute a");
     $this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)");
-
+    $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[1]/a", preg_quote($contact['display_name']));
     // verify soft credit details
     $expected = array(
-      1 => $contact['display_name'],
-      2 => 'Donation',
-      1 => '100.00',
+      4 => 'Donation',
+      2 => '100.00',
       6 => 'Completed',
     );
     foreach ($expected as $value => $label) {
-      $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[1]/td[$value]", preg_quote($label));
+      $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", preg_quote($label));
     }
   }
 
index c92b57d6d0f6d17c6b3a0b4f5d2d5827ac6d12df..1f178178737ab216b4f7e99a467f594c607645c1 100644 (file)
@@ -49,7 +49,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $lastName   = "Smith_" . substr(sha1(rand()), 0, 7);
     $Name1      = $lastName . ', ' . $firstName1;
     $this->webtestAddContact($firstName1, $lastName, "$firstName1.$lastName@example.com");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Add membership for this individual
     $this->_addMembership($memTypeParams);
@@ -72,7 +71,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $firstName2 = "John_" . substr(sha1(rand()), 0, 7);
     $Name2 = $lastName . ', ' . $firstName2;
     $this->webtestAddContact($firstName2, $lastName, "$firstName2.$lastName@example.com");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Add membership for this individual
     $this->_addMembership($memTypeParams);
@@ -101,15 +99,14 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
 
     $this->type('sort_name', $lastName);
     $this->click('_qf_Search_refresh');
-    $this->waitForElementPresent('Go');
 
     // Batch Update Via Profile
+    $this->waitForElementPresent("xpath=//div[@id='search-status']/table/tbody/tr[2]/td[2]/input");
     $this->click("xpath=//div[@id='search-status']/table/tbody/tr[2]/td[2]/input");
     //$this->click('CIVICRM_QFID_ts_all_10');
     $this->select('task', "label=Batch Update Members Via Profile");
-    $this->click('Go');
     $this->waitForElementPresent('_qf_PickProfile_back-bottom');
-
+    $this->waitForElementPresent('uf_group_id');
     $this->select('uf_group_id', "label={$profileTitle}");
     $this->click('_qf_PickProfile_next-bottom');
 
@@ -123,10 +120,10 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->click('_qf_Batch_next-bottom');
     $this->waitForElementPresent('_qf_Result_done');
     $this->click('_qf_Result_done');
-    $this->waitForElementPresent('Go');
 
     // View Membership
-    $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name1}']/../../td[11]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name1}']/../../td[11]/span[1]/a[1][text()='View']");
+    $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name1}']/../../td[11]/span[1]/a[1][text()='View']");
     $this->waitForElementPresent('_qf_MembershipView_cancel-bottom');
 
     // Verify End date
@@ -138,7 +135,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->webtestVerifyTabularData($verifyData);
 
     $this->click('_qf_MembershipView_cancel-bottom');
-    $this->waitForElementPresent('Go');
 
     // View Membership
     $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[3]/a[text()='{$Name2}']/../../td[11]/span/a[text()='View']");
@@ -184,7 +180,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
 
     // Clicking save.
     $this->click("_qf_Membership_upload");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // page was loaded
     $this->waitForTextPresent($sourceText);
@@ -217,7 +212,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
 
     // Clicking save and new
     $this->click('_qf_Field_next_new-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[0]}' has been saved to '{$profileTitle}'.");
 
     // Add membership status field to profile - CRM-8618
@@ -227,7 +221,6 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->click('label');
     // Clicking save
     $this->click('_qf_Field_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Membership Status' has been saved to '{$profileTitle}'.");
   }
 
@@ -270,8 +263,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
 
     //clicking save
-    $this->click('_qf_Field_next');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->click('_qf_Field_done-bottom');
 
     //Is custom field created
     $this->waitForText('crm-notification-container', "Custom field '$textFieldLabel' has been saved.");