Start migrating to use clickLink method
authorColeman Watts <coleman@civicrm.org>
Wed, 20 Mar 2013 21:12:50 +0000 (14:12 -0700)
committerColeman Watts <coleman@civicrm.org>
Wed, 20 Mar 2013 21:12:50 +0000 (14:12 -0700)
61 files changed:
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php
tests/phpunit/WebTest/Campaign/OnlineContributionTest.php
tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Case/AddCaseTest.php
tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php
tests/phpunit/WebTest/Case/CaseDashboardTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php
tests/phpunit/WebTest/Contact/InlineFieldsEditTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Contact/SearchBuilderTest.php
tests/phpunit/WebTest/Contact/SearchTest.php
tests/phpunit/WebTest/Contact/SignatureTest.php
tests/phpunit/WebTest/Contact/TaskActionSendMassMailing.php
tests/phpunit/WebTest/Contact/TaskActionSendSMS.php
tests/phpunit/WebTest/Contribute/AddBatchesTest.php
tests/phpunit/WebTest/Contribute/AddPricesetTest.php
tests/phpunit/WebTest/Contribute/ContactContextAddTest.php
tests/phpunit/WebTest/Contribute/ContributionPageAddTest.php
tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/OnlineMultiplePaymentProcessorTest.php
tests/phpunit/WebTest/Contribute/PCPAddTest.php
tests/phpunit/WebTest/Contribute/UpdatePendingContributionTest.php
tests/phpunit/WebTest/Contribute/VerifySSLContributionTest.php
tests/phpunit/WebTest/Event/AddEventTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/EventListingTest.php
tests/phpunit/WebTest/Event/EventWaitListTest.php
tests/phpunit/WebTest/Event/MultipleEventRegistrationbyCartTest.php
tests/phpunit/WebTest/Event/MultiprofileEventTest.php
tests/phpunit/WebTest/Event/PCPAddTest.php
tests/phpunit/WebTest/Event/ParticipantCountTest.php
tests/phpunit/WebTest/Event/PricesetMaxCountTest.php
tests/phpunit/WebTest/Financial/FinancialAccountTest.php
tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php
tests/phpunit/WebTest/Financial/FinancialBatchExport.php
tests/phpunit/WebTest/Grant/ContactContextAddTest.php
tests/phpunit/WebTest/Grant/CustomFieldsetTest.php
tests/phpunit/WebTest/Grant/StandaloneAddTest.php
tests/phpunit/WebTest/Import/ImportCiviSeleniumTestCase.php
tests/phpunit/WebTest/Mailing/MailingTest.php
tests/phpunit/WebTest/Member/ContactContextAddTest.php
tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php
tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php
tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipGCTest.php
tests/phpunit/WebTest/Member/OnlineAutoRenewMembershipTest.php
tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php
tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php
tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php
tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php
tests/phpunit/WebTest/Pledge/ContactContextAddTest.php
tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php
tests/phpunit/WebTest/Pledge/StandaloneAddTest.php
tests/phpunit/WebTest/Profile/BatchUpdateTest.php
tests/phpunit/WebTest/Profile/SearchTest.php
tests/phpunit/WebTest/Report/LoggingReportTest.php

index 874a7badfa13edeee852642d5be2aef8a65d5715..642ecaf513e9eaedd9a62d62af196b34e0cd62cd 100644 (file)
@@ -952,9 +952,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
           $this->click('is_separate_payment');
         }
       }
-      $this->click('_qf_MembershipBlock_next');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_MembershipBlock_next-bottom');
+      $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom');
       $text = "'MembershipBlock' information has been saved.";
       $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text);
     }
@@ -1228,8 +1226,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     }
 
     // Clicking save.
-    $this->click('_qf_Edit_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink('_qf_Edit_upload-bottom');
 
     // Is status message correct?
     $this->assertElementContainsText('crm-notification-container', "$groupName");
@@ -1511,10 +1508,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     }
 
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']");
-    $this->click("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('_qf_FinancialAccount_cancel-botttom');
+    $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$editfinancialAccount}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
 
     // Change Financial Account Name
     if ($financialAccountTitle) {
index 235c895b4343d4fa004f57ec3cc97a8120e00725..1e1a354cb6c4cb9ce8a3a6c83ad75a5eea1692ed 100644 (file)
@@ -82,11 +82,7 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase {
 
     //Opening Edit Page of the created Campaign
     $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']");
-    $this->click("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    //Checking for Proper description present
-    $this->waitForElementPresent("//textarea[@id='description']");
+    $this->clickLink("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']", "//textarea[@id='description']");
     $fetchedVaue = $this->getValue('description');
     $this->assertEquals($campaignDescription, $fetchedVaue);
   }
index 7459e0237b0319a3c23271a91edb558c27bd4609..c485c4f144199529ae568e41017156e766fc0e72 100644 (file)
@@ -284,10 +284,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->clickLink("_qf_Confirm_next-bottom", NULL);
 
index ca54af6e164c6d7c7c81837a58eb804ed673943e..3aed99ea4ad17aaece5b8fb3235a5744e5d81b7c 100644 (file)
@@ -253,11 +253,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase
     // verify event input on info page
     // start at Manage Events listing
     $this->openCiviPage("event/manage", "reset=1");
-    $this->click("link=$eventTitle");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // Look for Register button
-    $this->waitForElementPresent("link=Register Now");
+    $this->clickLink("link=$eventTitle", "link=Register Now");
 
     // Check for correct event info strings
     $this->assertStringsPresent($eventInfoStrings);
index 36860850439c3eb4276db4613999a4f860a25cb1..7e51c9936ad7b9c12b7b6a0eff618618d1efc477 100644 (file)
@@ -287,14 +287,8 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->click("xpath=id('mark_x_$id[1]')");
 
     $this->waitForElementPresent("Go");
-    $this->click("Go");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("_qf_Release_done-bottom");
-    $this->click("_qf_Release_done-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // wait for Access Keys div to appear at bottom of page - since this page may take a while
-    $this->waitForElementPresent('access');
+    $this->clickLink("Go", "_qf_Release_done-bottom");
+    $this->clickLink("_qf_Release_done-bottom", 'access');
     $this->assertElementContainsText("crm-notification-container", "released");
 
     // check whether contact is available for reserving again
@@ -415,9 +409,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->select('visibility', "value=Public Pages and Listings");
     $this->check('is_searchable');
     $this->check('in_selector');
-    $this->click('_qf_Field_next_new-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_cancel-bottom');
+    $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_cancel-bottom');
     
     // Custom Data Fields
     $this->select('field_name[0]', "value=Contact");
@@ -497,10 +489,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->click("Go");
     $this->waitForElementPresent('_qf_Reserve_done_reserve-bottom');
 
-    $this->click('_qf_Reserve_done_reserve-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // wait for Access Keys div to appear at bottom of page - since this page may take a while
-    $this->waitForElementPresent('access');
+    $this->clickLink('_qf_Reserve_done_reserve-bottom', 'access');
     $this->assertElementContainsText("crm-notification-container", "2");
 
     $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit');
index 9233a8acce79a12af97f4ef02be5fad700878d90..0901c74418304e54e876b1879a0b706e5cec3309 100644 (file)
@@ -74,11 +74,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $today = date('F jS, Y', strtotime('now'));
     // echo 'Today is ' . $today;
     $this->type('duration', "20");
-    $this->click('_qf_Case_upload-bottom');
-
-    // We should be at manage case screen
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_CaseView_cancel-bottom');
+    $this->clickLink('_qf_Case_upload-bottom', '_qf_CaseView_cancel-bottom');
 
     // Is status message correct?
     $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!");
index e984c7651c88761589eb751b4f4bdc4ec44c1820..4e6ad2ae1c180fb5eeb73b1070d3646822aa3e20 100644 (file)
@@ -54,18 +54,14 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Edit_next");
     $this->type("first_name", $testUserFirstName);
     $this->type("last_name", $testUserLastName);
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("profilewrap4");
+    $this->clickLink("_qf_Edit_next", "profilewrap4");
     // Is status message correct?
     $this->assertElementContainsText('crm-container', "Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
 
     $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
 
     // Try submitting the form without creating or selecting a contact (test for CRM-7971)
-    $this->click("_qf_Case_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=span.crm-error");
+    $this->clickLink("_qf_Case_upload-bottom", "css=span.crm-error");
     $this->assertElementContainsText('Case', "Please select a contact or create new contact", "Expected form rule error for submit without selecting contact did not show up after clicking Save.");
 
     // Adding contact with randomized first name (so we can then select that contact when creating case)
@@ -100,11 +96,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase {
     $today = date('F jS, Y', strtotime('now'));
     // echo 'Today is ' . $today;
     $this->type("duration", "20");
-    $this->click("_qf_Case_upload-bottom");
-
-    // We should be at manage case screen
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_CaseView_cancel-bottom");
+    $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom");
 
     // Is status message correct?
     $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!");
index 847d089bbf0734968e199fb5e5104390964081cb..baa52f8eb5119538080ec5ff3285505e2f84f81c 100644 (file)
@@ -76,16 +76,12 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
     $testUserLastName = "Testuserlast";
     $this->type("first_name", $testUserFirstName);
     $this->type("last_name", $testUserLastName);
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("profilewrap4");
+    $this->clickLink("_qf_Edit_next", "profilewrap4");
 
     $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom');
 
     // Try submitting the form without creating or selecting a contact (test for CRM-7971)
-    $this->click("_qf_Case_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=span.crm-error");
+    $this->clickLink("_qf_Case_upload-bottom", "css=span.crm-error");
 
     // Adding contact with randomized first name (so we can then select that contact when creating case)
     // We're using pop-up New Contact dialog
@@ -131,11 +127,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase {
     $this->type("{$cusId_1}", $custFname);
     $this->type("{$cusId_2}", $custMname);
     $this->type("{$cusId_3}", $custLname);
-    $this->click("_qf_Case_upload-bottom");
-
-    // We should be at manage case screen
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_CaseView_cancel-bottom");
+    $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom");
 
     // Is status message correct?
     $this->assertTextPresent("Case opened successfully.", "Save successful status message didn't show up after saving!");
index 7b28b73e046e623cd2683ff03726d711e11aa0b9..f7d704aca069fad366f4bbcba34095fb5815cc97 100644 (file)
@@ -53,9 +53,7 @@ class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase {
     // The header text of the table changes too
     $this->assertElementContainsText('crm-container', "Summary of Case Involvement");
 
-    $this->click("name=allupcoming value=1");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=a.button");
+    $this->clickLink("name=allupcoming value=1", "css=a.button");
 
     $this->assertTrue($this->isChecked("name=allupcoming value=1"), 'Selection of All Cases failed.');
     $this->assertElementContainsText('crm-container', "Summary of All Cases");
@@ -64,30 +62,22 @@ class WebTest_Case_CaseDashboardTest extends CiviSeleniumTestCase {
     $this->openCiviPage('case', 'reset=1', 'css=a.button');
 
     // Click on find my cases and check if right radio is checked
-    $this->click("name=find_my_cases");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=input.form-submit");
+    $this->clickLink("name=find_my_cases", "css=input.form-submit");
     $this->assertTrue($this->isChecked("name=case_owner value=2"), 'Find my cases button not properly setting search form value to my cases.');
 
     // Go back to dashboard
     $this->openCivipage('case', 'reset=1', 'css=a.button');
 
     // Click on a drilldown cell and check if right radio is checked
-    $this->click("css=a.crm-case-summary-drilldown");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=input.form-submit");
+    $this->clickLink("css=a.crm-case-summary-drilldown", "css=input.form-submit");
     $this->assertTrue($this->isChecked("name=case_owner value=1"), 'Drilldown on dashboard summary cells not properly setting search form value to all cases.');
 
     // Go back to dashboard and reset to my cases
     $this->openCiviPage('case', 'reset=1', 'css=a.button');
-    $this->click("name=allupcoming value=0");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=a.button");
+    $this->clickLink("name=allupcoming value=0", "css=a.button");
 
     // Click on a drilldown cell and check if right radio is checked
-    $this->click("css=a.crm-case-summary-drilldown");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("css=input.form-submit");
+    $this->clickLink("css=a.crm-case-summary-drilldown", "css=input.form-submit");
     $this->assertTrue($this->isChecked("name=case_owner value=2"), 'Drilldown on dashboard summary cells not properly setting search form value to my cases.');
   }
 }
index cb6d589012361e2c1410b5ad8fe9e0e4ddd43b62..674ac270bd67cd6acef0c803066c64dcb83b132e 100644 (file)
@@ -88,9 +88,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
     $this->type("sort_name", $sortName);
     $this->select("contact_type", "value=Individual");
-    $this->click("_qf_Basic_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/");
+    $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/");
 
     // click through to the Relationship view screen
     $this->click("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/td[11]/span/a[text()='View']");
@@ -219,9 +217,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh');
     $this->type("sort_name", $ContactName);
     $this->select("contact_type", "value=Individual");
-    $this->click("_qf_Basic_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/");
+    $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/");
 
     // click through to the Contribution view screen
     $this->click("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/td[11]/span/a[text()='View']");
index ef49d038f0b2d61298eed0d1f9798231abf5f81b..49d8f39c4b9217229020ebbabe79fa790f0b052b 100644 (file)
@@ -62,11 +62,7 @@ class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTes
     $this->click('demographics');
     $this->waitForElementPresent('CIVICRM_QFID_1_is_deceased');
     $this->click('CIVICRM_QFID_1_is_deceased');
-    $this->click('_qf_Advanced_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Remove contacts from group
-    $this->waitForElementPresent('Go');
+    $this->clickLink('_qf_Advanced_refresh', 'Go');
     $this->assertElementContainsText('search-status', '2 Contacts');
     $this->click("toggleSelect");
     $this->waitForTextPresent('2 Selected records only');
index 8b7fcf5e43645d4fac398662e32ec70a4a572fb2..f4d4a4297bfefdb9e8cb94a16e3898e0d6d7dbe1 100644 (file)
@@ -142,9 +142,7 @@ class WebTest_Contact_InlineFieldsEditTest extends CiviSeleniumTestCase {
     $this->type('organization_name', $orgName);
     $this->type('street_address-1', 'Test Org Street');
     $this->type('city-1', 'Test Org City');
-    $this->click('_qf_Edit_next');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('selected_shared_address-2');
+    $this->clickLink('_qf_Edit_next', 'selected_shared_address-2');
     $this->waitForTextPresent('Test Org Street');
     $this->inlineEdit('address-block-2', array(
       'address_2_location_type_id' => array('Work'),
index 771bacbca924488b190412962cf7775584529964..eaf96427137d58bf7224a64aaa0144fa575cf9dd 100644 (file)
@@ -138,9 +138,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->click("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
 
-    $this->click("css=div.crm-contact-merge-form-block div.action-link a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Merge_cancel-bottom');
+    $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", '_qf_Merge_cancel-bottom');
 
     // Move the activities, groups, etc to the main contact and merge using Merge and Goto Next Pair
     $this->check('move_prefix_id');
@@ -148,9 +146,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->check('move_rel_table_activities');
     $this->check('move_rel_table_groups');
     $this->check('move_rel_table_tags');
-    $this->click('_qf_Merge_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Merge_cancel-bottom');
+    $this->clickLink('_qf_Merge_next-bottom', '_qf_Merge_cancel-bottom');
     $this->assertTrue($this->isTextPresent('Contacts Merged'), "Contacts Merged text was not found after merge.");
 
     // Check that we are viewing the next Merge Pair (our 2nd contact, since the merge list is ordered by contact_id)
@@ -342,9 +338,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']");
     $this->click("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
-    $this->click("css=div.crm-contact-merge-form-block div.action-link a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']");
+    $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']");
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(add)']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
 
@@ -433,9 +427,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//table[@class='pagerDisplay']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']");
     $this->click("xpath=//table[@class='pagerDisplay']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']/../../td[4]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
-    $this->click("css=div.crm-contact-merge-form-block div.action-link a");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']");
+    $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[2]/td[4]/span[text()='(overwrite)']");
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(add)']");
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[4]/td[4]/span[text()='(overwrite)']");
     $this->select('location_email_1_locTypeId', 'value=3');
@@ -594,9 +586,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
       $this->waitForElementPresent("css=div.ac_results-inner li");
 
       // Visit contact summary page.
-      $this->click("css=div.ac_results-inner li");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('civicrm-footer');
+      $this->clickLink("css=div.ac_results-inner li", 'civicrm-footer');
     }
   }
 
index c9c2bac270c60df738d135f1b5d7e4238038fe7b..0802fc1ef43e290ce5675359046abd584fc109ea 100644 (file)
@@ -386,9 +386,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase {
       $this->webtestNewDialogContact($firstName, 'Contributor', $firstName . '@example.com');
       $this->select('financial_type_id', $financialType);
       $this->type('total_amount', 100 * $i);
-      $this->click('_qf_Contribution_upload_new');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Contribution_upload_new');
+      $this->clickLink('_qf_Contribution_upload_new', '_qf_Contribution_upload_new');
     }
     $this->openCiviPage("contact/search/builder", "reset=1", "_qf_Builder_refresh");
       
index 6b0bd3f47da45b1b92cd9b3be231738d6d28521e..61fad92512d1fba96fcc1501e97f23dbf15f415a 100644 (file)
@@ -78,14 +78,10 @@ class WebTest_Contact_SearchTest extends CiviSeleniumTestCase {
     $this->type("css=input#sort_name_navigation", 'ada');
     $this->typeKeys("css=input#sort_name_navigation", 'ada');
 
-    $this->click("_qf_Basic_refresh");
+    $this->clickLink("_qf_Basic_refresh");
 
-    // wait for result list
-    $this->waitForPageToLoad($this->getTimeoutMsec());
     // make sure we're on search results page
     $this->waitForElementPresent("alpha-filter");
-    // wait for bottom of page to load (access is in footer)
-    $this->waitForElementPresent("access");
 
     // Is contact present in search result?
     $this->assertElementContainsText('css=.crm-search-results > table.row-highlight', $sortName);
index 577a2d0282580eff2aaa1753e3acce46ce86c365..a4943857a4e56ffad62c0c835bcd98eae59a5683 100644 (file)
@@ -68,9 +68,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase {
 
     // Go for Ckeck Your Editor, Click on Send Mail
     $this->click("//a[@id='crm-contact-actions-link']/span");
-    $this->click('link=Send an Email');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('subject');
+    $this->clickLink('link=Send an Email', 'subject');
 
     $this->click('subject');
     $subject = 'Subject_' . substr(sha1(rand()), 0, 8);
@@ -126,9 +124,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase {
 
     // Go for Ckeck Your Editor, Click on Send Mail
     $this->click("//a[@id='crm-contact-actions-link']/span");
-    $this->click('link=Send an Email');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('subject');
+    $this->clickLink('link=Send an Email', 'subject');
 
     $this->click('subject');
     $subject = 'Subject_' . substr(sha1(rand()), 0, 7);
@@ -183,14 +179,10 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase {
 
     $this->type('activity_subject', $subject);
 
-    $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('Search');
+    $this->clickLink('_qf_Search_refresh', 'Search');
 
     // View your Activity
-    $this->click("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_ActivityView_next-bottom');
+    $this->clickLink("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']", '_qf_ActivityView_next-bottom');
 
     // Is signature correct? in Activity
     $this->assertTextPresent($signature);
index d6f4ee6d48e80ed915fcdbf6e701ad65ac2a5332..2362f4887d5b4b4dd0c0325c6ac40d145c7560fa 100644 (file)
@@ -35,37 +35,17 @@ class WebTest_Contact_TaskActionSendMassMailing extends CiviSeleniumTestCase {
   function testSelectedContacts() {
     $this->webtestLogin();
 
-    $this->openCiviPage('group/add', 'reset=1', "_qf_Edit_upload");
-
-    // make group name
+    // make group
     $groupName = 'group_' . substr(sha1(rand()), 0, 7);
-
-    // fill group name
-    $this->type("title", $groupName);
-
-    // fill description
-    $this->type("description", "New mailing group for Webtest");
-
-    // enable Mailing List
-    $this->click("group_type[2]");
-
-    // select Visibility as Public Pages
-    $this->select("visibility", "value=Public Pages");
-
-    // Clicking save.
-    $this->click("_qf_Edit_upload");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->WebtestAddGroup($groupName);
 
     // Use class names for menu items since li array can change based on which components are enabled
     $this->click("css=ul#civicrm-menu li.crm-Search");
-    $this->click("css=ul#civicrm-menu li.crm-Advanced_Search a");
+    $this->clickLink("css=ul#civicrm-menu li.crm-Advanced_Search a", "email");
 
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("email");
     $this->click("_qf_Advanced_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-
     // Click "check all" box and act on "Add to group" action
     $this->click("//form[@id='Advanced']/div[3]/div/div[2]/table/thead/tr/th[1]/input");
     $this->select("task", "label=Schedule/Send a Mass Mailing");
index de62e62bad1f1637020655977c8a661958bd0e6a..8e1a36074cfb43a187f50a886eed58785026f1b2 100644 (file)
@@ -97,25 +97,16 @@ class WebTest_Contact_TaskActionSendSMS extends CiviSeleniumTestCase {
 
     // Do an advanced search
     $this->click("css=ul#civicrm-menu li.crm-Search");
-    $this->click("css=ul#civicrm-menu li.crm-Advanced_Search a");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("email");
+    $this->clickLink("css=ul#civicrm-menu li.crm-Advanced_Search a", "email");
 
     $this->select("crmasmSelect1", "label=$smsGroupName");
 
-    $this->click("_qf_Advanced_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('CIVICRM_QFID_ts_all_12');
+    $this->clickLink("_qf_Advanced_refresh", 'CIVICRM_QFID_ts_all_12');
     $this->click('CIVICRM_QFID_ts_all_12');
 
     // Perform a task action
     $this->select("task", "label=Send SMS to Contacts");
-    $this->click("Go");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('activity_subject');
+    $this->clickLink("Go", 'activity_subject');
     $this->type('activity_subject', "Send SMS to Contacts of {$smsGroupName}");
     $this->type('text_message', "Test SMS to Contacts of {$smsGroupName}");
     $this->click("_qf_SMS_upload-bottom");
index baab533d6d6564d3ad9dc61bbfe135a32d8246f0..b56f1edb360c7a95d2d1250187b582eacebe46f7 100644 (file)
@@ -134,13 +134,8 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
     if ($type == "Contribution") {
       $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
       $this->type("sort_name", "{$data['first_name']} {$data['last_name']}");
-      $this->click("_qf_Search_refresh");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-
-      $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-      $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+      $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
       $expected = array(
         'From'                => "{$data['first_name']} {$data['last_name']}",
         'Financial Type'      => $data['financial_type'],
@@ -154,11 +149,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
       
       // select contact
       $this->type("sort_name", "{$data['first_name']} {$data['last_name']}");
-      $this->click("_qf_Search_refresh");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      
-      //View Membership
-      $this->waitForElementPresent("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
       $this->click("xpath=//div[@id='memberSearch']//table/tbody/tr[1]/td[11]/span/a[text()='View']");
       $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
       $expected = array(
@@ -184,9 +175,7 @@ class WebTest_Contribute_AddBatchesTest extends CiviSeleniumTestCase {
   
   function _verifyData($data, $type) {
     $this->waitForElementPresent("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']");
-    $this->click("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Entry_upload");
+    $this->clickLink("xpath=//div[@id='crm-batch-selector_wrapper']//table//tbody/tr[1]/td[7]/span/a[text()='Enter records']", "_qf_Entry_upload");
     $this->click("_qf_Entry_upload");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     foreach ($data as $value) {
index 88da4c392d4f11554b11fbe0431a84f50859a7dc..8a171f079034179ebdf0b43103fe9c89b76c5f6f 100644 (file)
@@ -84,10 +84,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
   }
 
   function _testAddPriceFields(&$fields, &$validateString, $financialType, $dateSpecificFields = FALSE) {
@@ -163,9 +160,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
         break;
       }
       $this->select('financial_type_id', "label={$financialType}");
-      $this->click('_qf_Field_next_new-bottom');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
     }
   }
   
@@ -230,11 +225,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage("admin/price", "reset=1");
 
     // Use the price set id ($sid) to pick the correct row
-    $this->click("css=tr#row_{$sid} a[title='View and Edit Price Fields']");
-    
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // Look for Register button
-    $this->waitForElementPresent('Link=Add Price Field');
+    $this->clickLink("css=tr#row_{$sid} a[title='View and Edit Price Fields']", 'Link=Add Price Field');
     // Check for expected price set field strings
     $this->assertStringsPresent($validateStrings);
   }
@@ -438,10 +429,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->select('billing_country_id-5', 'value=1228');
     $this->select('billing_state_province_id-5', 'value=1004');
     $this->type('billing_postal_code-5', '94129');
-    $this->click('_qf_Main_upload-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Main_upload-bottom', '_qf_Confirm_next-bottom');
 
     $this->click('_qf_Confirm_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -455,14 +443,8 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low');
 
     $this->type('sort_name', "$firstName $lastName");
-    $this->click('_qf_Search_refresh');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     // View Contribution Record and test for expected values
     $expected = array(
@@ -566,10 +548,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->select('billing_country_id-5', 'value=1228');
     $this->select('billing_state_province_id-5', 'value=1004');
     $this->type('billing_postal_code-5', '94129');
-    $this->click('_qf_Main_upload-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Main_upload-bottom', '_qf_Confirm_next-bottom');
 
     $this->click('_qf_Confirm_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -581,14 +560,8 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/search", "reset=1", 'contribution_date_low');
 
     $this->type('sort_name', "$firstName $lastName");
-    $this->click('_qf_Search_refresh');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
 
     // View Contribution Record and test for expected values
     $expected = array(
@@ -677,11 +650,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->webtestFillDate('thankyou_date');
 
     // Clicking save.
-    $this->click('_qf_Contribution_upload');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Is status message correct?
-    $this->waitForElementPresent("xpath=//div[@id='Contributions']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->clickLink('_qf_Contribution_upload', "xpath=//div[@id='Contributions']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
     $this->assertTrue($this->isTextPresent('The contribution record has been saved.'), "Status message didn't show up after saving!");
 
     //click through to the Contribution view screen
index ef66abe8a55056f7c5f7142ce24d7da9fc23bcbf..6869140ced41914286a65e8e655ec89e6faad98c 100644 (file)
@@ -145,9 +145,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->webtestFillDate('fulfilled_date');
 
     // Clicking save.
-    $this->click("_qf_Contribution_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('civicrm-footer');
+    $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer');
     // Is status message correct?
     $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved");
     
index 130ce7798c9af562b974e30cc285613a85fd4247..e6155873092545ea4581a22ca923bd691ff9690a 100644 (file)
@@ -157,9 +157,7 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->type('first_name', $firstName);
     $this->type('last_name', $lastName);
 
-    $this->click('_qf_Main_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Main_upload-bottom', '_qf_Confirm_next-bottom');
 
     $this->click('_qf_Confirm_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -172,15 +170,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
 
     $this->type('sort_name', "$firstName $lastName");
     $this->select('financial_type_id',"label=Member Dues");
-    $this->click('_qf_Search_refresh');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    //View Contribution for membership fee
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
     $expected = array(
       'From' => "{$firstName} {$lastName}",
       'Financial Type' => 'Member Dues',
@@ -196,14 +187,9 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     $this->click("xpath=id('Search')/x:div[2]/x:div/x:div[1]");
     $this->waitForElementPresent("financial_type_id");
     $this->select('financial_type_id',"label=Donation");
-    $this->click('_qf_Search_refresh');
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
 
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
     $expected = array(
       'From' => "{$firstName} {$lastName}",
       'Financial Type' => 'Donation',
@@ -216,14 +202,8 @@ class WebTest_Contribute_ContributionPageAddTest extends CiviSeleniumTestCase {
     //Find Member
     $this->openCiviPage("member/search", "reset=1", 'member_source');
     $this->type('sort_name', "$firstName $lastName");
-    $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    //visit the Member View link
-    $this->waitForElementPresent("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_MembershipView_cancel-bottom');
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_MembershipView_cancel-bottom');
 
     //View Membership Record
     $expected = array(
index e2549418b5b72b60e382e38683044fa61e5c90b9..7859f78fe747c8e5506f72b376cac787cf09e88d 100644 (file)
@@ -123,9 +123,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Edit_next");
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("profilewrap4");
+    $this->clickLink("_qf_Edit_next", "profilewrap4");
 
     // Is status message correct?
     $this->assertTextPresent("Thank you. Your information has been saved.", "Save successful status message didn't show up after saving profile to update testUserName!");
@@ -454,9 +452,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Edit_next");
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("profilewrap4");
+    $this->clickLink("_qf_Edit_next", "profilewrap4");
 
     $urlElements = $this->parseURL();
     print_r($urlElements);
@@ -588,11 +584,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select("onbehalf_state_province-3", "label=Alabama");
 
     $this->waitForElementPresent("_qf_Main_upload-bottom");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -643,10 +635,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -659,14 +648,8 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     //Find Contribution
     $this->openCiviPage("contribute/search", "reset=1");
     $this->type("sort_name", $orgName);
-    $this->click("_qf_Search_refresh");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     // verify contrb created
     $expected = array(
@@ -879,21 +862,15 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //Find Contribution
     $this->openCiviPage("contribute/search", "reset=1");
     $this->type("sort_name", $orgName1);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     // verify contrb created
     $expected = array(
@@ -1042,9 +1019,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select('field_name[0]', 'value=Membership');
     $this->select('field_name[1]', 'label=Campaign');
     $this->click('field_name[1]');
-    $this->click('_qf_Field_next_new-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_cancel-bottom');
+    $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_cancel-bottom');
 
     $this->select('field_name[0]', 'value=Membership');
     $this->select('field_name[1]', "label=$fieldTitle :: $groupTitle");
@@ -1232,21 +1207,15 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select("credit_card_exp_date[M]", "value=1");
     $this->select("credit_card_exp_date[Y]", "value=2020");
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     //Find Membership for organization
     $this->openCiviPage("member/search", "reset=1");
     $this->type("sort_name", $orgName1);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='memberSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_MembershipView_cancel-bottom");
 
     //verify contrb created
     $expected = array(
@@ -1326,9 +1295,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->waitForElementPresent("_qf_Edit_next");
     $this->type("first_name", $firstName);
     $this->type("last_name", $lastName);
-    $this->click("_qf_Edit_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("profilewrap4");
+    $this->clickLink("_qf_Edit_next", "profilewrap4");
 
     $urlElements = $this->parseURL();
     $cid = $urlElements['queryString']['id'];
@@ -1465,10 +1432,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase {
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
index 63b9d6414875048af25cf7cba8c359eec2f1e209..fa13a747e44fcbda3bed8cc088961c9f4da039ea 100644 (file)
@@ -129,10 +129,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -146,14 +143,8 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     //View Contribution Record and verify data
     $expected = array(
index 74802aac0c972165655f2389e6c0b3dc69af9c79..b14fddf333242f84ff87a00446e40d09f38c56d8 100644 (file)
@@ -104,11 +104,7 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -176,10 +172,7 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium
     $xpath = "xpath=//label[text() = '{$payLaterText}']/preceding-sibling::input[1]";
     $this->click($xpath);
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     
     $payLaterInstructionsText = "Pay later instructions $hash";
     $this->assertTrue($this->isTextPresent($payLaterInstructionsText));
@@ -194,14 +187,8 @@ class WebTest_Contribute_OnlineMultiplePaymentProcessorTest extends CiviSelenium
 
     $this->type('sort_name', "$firstName $lastName");
     $this->check('contribution_test');
-    $this->click('_qf_Search_refresh');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_ContributionView_cancel-bottom');
+    $this->clickLink('_qf_Search_refresh', "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", '_qf_ContributionView_cancel-bottom');
     $expected = array(
       'From'            => "{$firstName} {$lastName}",
       'Financial Type'  => 'Donation',
index d21749d6d8da777679e4c134d0cde586dc2a029e..ec854e7b611794ffab1496cb374f92386f3acefd 100755 (executable)
@@ -110,9 +110,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
     $this->webtestAddCreditCardDetails();
     $this->webtestAddBillingDetails($firstName, $middleName, $lastName);
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
 
     $this->waitForElementPresent("thankyou_footer");
@@ -167,9 +165,7 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
 
     $this->webtestAddCreditCardDetails();
     $this->webtestAddBillingDetails($donorFirstName, $middleName, $donorLastName);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
 
     $this->waitForElementPresent("thankyou_footer");
@@ -182,14 +178,8 @@ class WebTest_Contribute_PCPAddTest extends CiviSeleniumTestCase {
 
     $this->select('contribution_pcp_made_through_id', "label={$pcpTitle}");
 
-    $this->click("_qf_Search_refresh");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     // View Contribution Record and test for expected values
     $expected = array(
index 8c81f556ee6dc69e90b10d8dbe1c389a21c5ea1c..eb9400a3ba5ff10523dac9ff2669a1e0fca7e973 100644 (file)
@@ -252,10 +252,7 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->select("country-1", "value=1228");
     $this->select("state_province-1", "value=1001");
 
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -267,14 +264,8 @@ class WebTest_Contribute_UpdatePendingContributionTest extends CiviSeleniumTestC
     $this->openCiviPage("contribute/search", "reset=1", "contribution_date_low");
 
     $this->type("sort_name", "$lastName, $firstName");
-    $this->click("_qf_Search_refresh");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[2]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
     // View Contribution Record and test for expected values
     $expected = array(
       'From' => "{$firstName} {$lastName}",
index 45735c2bc2d6de31d5643cfbe3e43c2c0a08ae24..a2c360bcb40528b63ed32b5537ee6aeaa7dc9bdd 100644 (file)
@@ -118,9 +118,7 @@ class WebTest_Contribute_VerifySSLContributionTest extends CiviSeleniumTestCase
     }
 
     // submit contribution
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     // confirm contribution
     $this->click("_qf_Confirm_next-bottom");
index abee5ed6bdaf7a863ae307519db50bbc4d2f0972..8a07f2cfd1469194e8662e1510efd95725ff18b3 100644 (file)
@@ -422,9 +422,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
       $this->type("discount_name_1", $discount1);
       $this->webtestFillDate("discount_start_date_1", "-3 week");
       $this->webtestFillDate("discount_end_date_1", "-2 week");
-      $this->click("_qf_Fee_submit");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent("discounted_value_1_1");      
+      $this->clickLink("_qf_Fee_submit", "discounted_value_1_1");      
       $this->type("discounted_value_1_1","225.00");
       $this->type("discounted_value_2_1","300.00");
 
@@ -436,9 +434,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
         $this->type("discount_name_2", $discount2);
         $this->webtestFillDate("discount_start_date_2", "-1 week");
         $this->webtestFillDate("discount_end_date_2", "+1 week");
-        $this->click("_qf_Fee_submit");
-        $this->waitForPageToLoad($this->getTimeoutMsec());
-        $this->waitForElementPresent("discounted_value_2_1");
+        $this->clickLink("_qf_Fee_submit", "discounted_value_2_1");
         $this->type("discounted_value_1_2","225.00");
         $this->type("discounted_value_2_2","300.00");
     }
index 67bd75aa26460879069465488ca1dc534678fca2..8f9044eb067afceebebbe74136ffa269de07cd73 100644 (file)
@@ -79,10 +79,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
   }
 
   function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) {
@@ -163,9 +160,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
         default:
           break;
       }
-      $this->click('_qf_Field_next_new-bottom');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
     }
   }
 
@@ -175,11 +170,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage('admin/price', 'reset=1');
 
     // Use the price set id ($sid) to pick the correct row
-    $this->click("css=tr#row_{$sid} a[title='Preview Price Set']");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // Look for Register button
-    $this->waitForElementPresent('_qf_Preview_cancel-bottom');
+    $this->clickLink("css=tr#row_{$sid} a[title='Preview Price Set']", '_qf_Preview_cancel-bottom');
 
     // Check for expected price set field strings
     $this->assertStringsPresent($validateStrings);
@@ -310,9 +301,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->select('billing_state_province_id-5', 'value=1004');
     $this->type('billing_postal_code-5', '94129');
 
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Register_upload-bottom', '_qf_Confirm_next-bottom');
     $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information');
     $this->assertStringsPresent($confirmStrings);
     $this->click('_qf_Confirm_next-bottom');
@@ -327,11 +316,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->openCiviPage('event/search', 'reset=1', '_qf_Search_refresh');
 
     $this->type('sort_name', "$email");
-    $this->click('_qf_Search_refresh');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='View']");
+    $this->clickLink('_qf_Search_refresh', "xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='View']");
     $this->click("xpath=id('participantSearch')/table/tbody/tr/td[11]/span/a[text()='View']");
     $this->waitForElementPresent('_qf_ParticipantView_cancel-bottom');
 
index a560e664d0ca23d55294e04be827f5370c444f51..b5a0ffce8cb43657f57ed47aae8d41eb6c1b0ed9 100644 (file)
@@ -145,11 +145,7 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
 
     $this->type("max_participants", "6");
     $this->click("is_public");
-    $this->click("_qf_EventInfo_upload-bottom");
-
-    // Wait for Location tab form to load
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Location_upload_done-bottom");
+    $this->clickLink("_qf_EventInfo_upload-bottom", "_qf_Location_upload_done-bottom");
 
     $this->click("_qf_Location_upload_done-bottom");
 
index eeab2e8cd95d8b7abde40bebdcae3bb593d986b0..760b350119bd1d3413489c0a19abb880e4c20aae 100644 (file)
@@ -154,11 +154,7 @@ class WebTest_Event_EventWaitListTest extends CiviSeleniumTestCase {
     // verify event input on info page
     // start at Manage Events listing
     $this->openCiviPage("event/manage", "reset=1");
-    $this->click("link=$eventTitle");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Look for Register button
-    $this->waitForElementPresent("link=Register Now");
+    $this->clickLink("link=$eventTitle", "link=Register Now");
 
     // Check for correct event info strings
     $this->assertStringsPresent($eventInfoStrings);
index 840a91f222a160ec38d62b1367a68b5bbcd2352a..239a09301fd2bcf23d17e51a6de97fbbe17a5b3c 100755 (executable)
@@ -290,9 +290,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
       $this->type("discount_name_1", "Early-bird" . substr(sha1(rand()), 0, 7));
       $this->webtestFillDate("discount_start_date_1", "-1 week");
       $this->webtestFillDate("discount_end_date_1", "+2 week");
-      $this->click("_qf_Fee_submit");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent("discounted_value_2_1");
+      $this->clickLink("_qf_Fee_submit", "discounted_value_2_1");
       $this->type("discounted_value_1_1","225.00");
       $this->type("discounted_value_2_1","300.00");
       $this->click("xpath=//fieldset[@id='discount']/fieldset/table/tbody/tr[2]/td[3]/input");
@@ -333,11 +331,7 @@ class WebTest_Event_MultipleEventRegistrationbyCartTest extends CiviSeleniumTest
     // verify event input on info page
     // start at Manage Events listing
     $this->openCiviPage("event/manage", "reset=1");
-    $this->click("link=$eventTitle");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    
-    // Look for Add to Cart button
-    $this->waitForElementPresent("link=Add to Cart");
+    $this->clickLink("link=$eventTitle", "link=Add to Cart");
     $this->click("link=Add to Cart");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertTrue($this->isTextPresent("$eventTitle has been added to your cart"));
index 6cc9a3231ecad2bb9ee346ac65ca63a919840d53..919c6cc2c4ae16099e12fb6a301cab982fa74051 100644 (file)
@@ -89,12 +89,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find Main Participant
     $this->openCiviPage("event/search", "reset=1");
     $this->type("sort_name", $firstName);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $firstName . " " . $lastName;
     $status = 'Registered';
@@ -106,12 +102,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find additional  Participant
     $this->openCiviPage("event/search", "reset=1");
     $this->type("sort_name", $participantfname);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $participantfname . " " . $participantlname;
     $status = 'Registered';
@@ -201,12 +193,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find Main Participant
     $this->openCiviPage("event/search", "reset=1");
     $this->type("sort_name", $firstName);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $firstName . " " . $lastName;
     $status = 'Registered';
@@ -218,12 +206,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find additional  Participant
     $this->openCiviPage("event/search", "reset=1");
     $this->type("sort_name", $participantfname);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $participantfname . " " . $participantlname;
     $status = 'Registered';
@@ -247,12 +231,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find Main Participant
     $this->openCiviPage('event/search', "reset=1");
     $this->type("sort_name", $firstName2);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $firstName2 . " " . $lastName2;
     $status = 'Registered';
@@ -264,12 +244,8 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     // Find additional  Participant
     $this->openCiviPage("event/search", "reset=1");
     $this->type("sort_name", $participantfname2);
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ParticipantView_cancel-top");
 
     $name = $participantfname2 . " " . $participantlname2;
     $status = 'Registered';
@@ -687,9 +663,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     $this->type("nick_name", "Nick1");
     $this->type("url-1", "http://www.part.com");
 
-    $this->click("_qf_Participant_1_next-Array");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Participant_1_next-Array", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
   }
@@ -755,9 +729,7 @@ class WebTest_Event_MultiprofileEventTest extends CiviSeleniumTestCase {
     $this->type("current_employer", "ABCD");
     $this->type("job_title", "BATCHER");
 
-    $this->click("_qf_Participant_1_next-Array");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Participant_1_next-Array", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
   }
   
index 5e83bb3805f888da5e4b01795f3dd22c7eb0b8f1..340e8486c367b0dd276e4525f310575b3c033c06 100644 (file)
@@ -436,10 +436,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase {
     $this->click("_qf_Search_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$sortName}']/../../td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//table[@class='selector']/tbody/tr/td[8]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='participantSearch']/table/tbody//tr/td[@class='crm-participant-sort_name']/a[text()='{$sortName}']/../../td[11]/span/a[text()='View']", "xpath=//table[@class='selector']/tbody/tr/td[8]/span/a[text()='View']");
     $this->click("xpath=//table[@class='selector']/tbody/tr/td[8]/span/a[text()='View']");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index 91d4c7fed47294070427c302c55cf90c514557aa..475b7f85874e0e85c583be075dab60dd67fe2ca6 100644 (file)
@@ -184,9 +184,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
       else {
         $this->_testAddMultipleChoiceOptions($field['options']);
       }
-      $this->click('_qf_Field_next_new-bottom');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
     }
 
     // create event.
@@ -303,10 +301,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->type('help_pre', 'This is test priceset.');
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
   }
 
   function _testAddMultipleChoiceOptions($options) {
@@ -411,9 +406,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase {
     $this->select('billing_state_province_id-5', 'value=1004');
     $this->type('billing_postal_code-5', '94129');
 
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Confirm_next-bottom');
+    $this->clickLink('_qf_Register_upload-bottom', '_qf_Confirm_next-bottom');
     $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information');
     $this->assertStringsPresent($confirmStrings);
     $this->click('_qf_Confirm_next-bottom');
index c979bc1660a2c28da201460ab17ac1f243980cf9..fbf33a8749f42605da18460692a8da584127a9fb 100644 (file)
@@ -1020,10 +1020,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type('help_pre', 'This is test priceset.');
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
   }
 
   function _testAddPriceFields($fields) {
index 99af6fbb28feb03c8c4512d427122ef058d251b1..e8891f6794251bd58f26503651cb13add24f8ac1 100644 (file)
@@ -65,9 +65,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
         
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
         
-    $this->click("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_FinancialAccount_cancel-botttom');
+    $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
     //Varify Data after Adding new Financial Account
     $verifyData = array('name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
@@ -111,9 +109,7 @@ class WebTest_Financial_FinancialAccountTest extends CiviSeleniumTestCase {
       $orgName = $orgNameEdit;
     }
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-    $this->click("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_FinancialAccount_cancel-botttom');
+    $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
        
     $verifyData = array( 'name' => $financialAccountTitle,
       'description' => $financialAccountDescription,
index 8d74cd370a3977f8dfb6ee045ff55da4549c63f8..20221e77658f743912cb112cb7da5d90867a681b 100644 (file)
@@ -68,9 +68,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     
     $this->waitForElementPresent("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
         
-    $this->click("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_FinancialAccount_cancel-botttom');
+    $this->clickLink("xpath=//table/tbody//tr/td[1][text()='{$financialAccountTitle}']/../td[9]/span/a[text()='Edit']", '_qf_FinancialAccount_cancel-botttom');
         
     //Varify Data after Adding new Financial Account
     $verifyData = array( 
@@ -146,9 +144,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     $this->click('_qf_FinancialTypeAccount_next');
     $this->waitForElementPresent("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='Accounts Receivable']/../td[7]/span/a[text()='Edit']");
     $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='Accounts Receivable']/../td[2]", preg_quote('Accounts Receivable Account is'));
-    $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='Accounts Receivable']/../td[7]/span/a[text()='Delete']"); 
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_FinancialTypeAccount_next-botttom');
+    $this->clickLink("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='Accounts Receivable']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom');
     $this->click('_qf_FinancialTypeAccount_next-botttom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertElementContainsText('crm-notification-container', 'Selected financial type account has been deleted.', 'Missing text: ' . 'Selected financial type account has been deleted.');
index a3d83c5b9dbc694f8c29e28a4408d840bcedba5a..d323a3d94ae09069bf2d3414c1d7449f05b12700 100644 (file)
@@ -111,9 +111,7 @@ class WebTest_Financial_FinancialBatchExport extends CiviSeleniumTestCase {
     $this->openCiviPage("dashboard", "reset=1");\r
     $this->waitForPageToLoad($this->getTimeoutMsec());\r
 \r
-    $this->click("xpath=//div[@id='recently-viewed']/ul/li[1]/a");\r
-    $this->waitForPageToLoad($this->getTimeoutMsec());\r
-    $this->waitForElementPresent("_qf_Activity_cancel-bottom");\r
+    $this->clickLink("xpath=//div[@id='recently-viewed']/ul/li[1]/a", "_qf_Activity_cancel-bottom");\r
     $this->webtestVerifyTabularData(\r
       array(\r
         'Current Attachment(s)' => 'Financial_Transactions_'\r
index ff426cab7e95c21f071e211b5318fa982126412c..7022adec4dd6013bcb6a5758575726303b99ff5e 100644 (file)
@@ -109,17 +109,10 @@ class WebTest_Grant_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->type('note', "Grant Note for $firstName");
 
     // Clicking save.
-    $this->click('_qf_Grant_upload');
-
-    // wait for page to load
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // verify if grant is created with presence of view link
-    $this->waitForElementPresent("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->clickLink('_qf_Grant_upload', "xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
 
     // click through to the Grant view screen
-    $this->click("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
-    $this->waitForElementPresent('_qf_GrantView_cancel-bottom');
+    $this->clickLink("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']", '_qf_GrantView_cancel-bottom');
 
     $gDate = date('F jS, Y', strtotime('now'));
 
index e13a93db1646c8a081f473f7cb4ecb765e19aefa..04f860fc0c08b16b6ffa251405577fb4468a8c04 100644 (file)
@@ -95,11 +95,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase {
     $this->assertElementContainsText($grantFieldSet, $grantField);
     $this->type('id=amount_total', '100.00');
     $this->type("css=div#$grantFieldSet input.form-text", '99.99');
-    $this->click('id=_qf_Grant_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Verify grant is created with presence of view link
-    $this->waitForElementPresent("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->clickLink('id=_qf_Grant_upload-bottom', "xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
 
     // Click through to the Grant view screen
     $this->click("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
index f7b3d6ff5f6aab6a797fc6063326c587396bd3bb..dc88af99133b78de87c20b9ce5668dd73abb44f8 100644 (file)
@@ -90,11 +90,7 @@ class WebTest_Grant_StandaloneAddTest extends CiviSeleniumTestCase {
     $this->type("note", "Grant Note");
 
     // Clicking save.
-    $this->click("_qf_Grant_upload");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // verify if Grant is created
-    $this->waitForElementPresent("xpath=//div[@id='Grants']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
+    $this->clickLink("_qf_Grant_upload", "xpath=//div[@id='Grants']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
 
     //click through to the Grant view screen
     $this->click("xpath=//div[@id='Grants']//table/tbody/tr[1]/td[8]/span/a[text()='View']");
index 68ab6a87b24b977ad3984eaf1dd1b941ece06146..284cd6944354fda8bfc3083e6d9ed9df5bb7095f 100644 (file)
@@ -142,11 +142,7 @@ class ImportCiviSeleniumTestCase extends CiviSeleniumTestCase {
     $this->_checkImportMapperData($headers, $rows, $existingMapping, isset($other['checkMapperHeaders']) ? $other['checkMapperHeaders'] : array());
 
     // Submit form.
-    $this->click('_qf_Preview_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Visit summary page.
-    $this->waitForElementPresent("_qf_Summary_next");
+    $this->clickLink('_qf_Preview_next-bottom', "_qf_Summary_next");
 
     // Check success message.
     $this->assertTrue($this->isTextPresent("Import has completed successfully. The information below summarizes the results."));
index f605b8c53954f3c2f8d8b9717e8b00d232fdc791..a10584d1dcb3c93bfd7504b8880d200c7aa982a6 100644 (file)
@@ -74,9 +74,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     $this->click("css=li#tab_group a");
     $this->waitForElementPresent("_qf_GroupContact_next");
     $this->select("group_id", "$groupName");
-    $this->click("_qf_GroupContact_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_GroupContact_next");
+    $this->clickLink("_qf_GroupContact_next", "_qf_GroupContact_next");
 
     // configure default mail-box
     $this->setupDefaultMailbox();
@@ -341,9 +339,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     $this->click("css=li#tab_group a");
     $this->waitForElementPresent("_qf_GroupContact_next");
     $this->select("group_id", "$groupName");
-    $this->click("_qf_GroupContact_next");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_GroupContact_next");
+    $this->clickLink("_qf_GroupContact_next", "_qf_GroupContact_next");
 
     // configure default mail-box
     $this->openCiviPage("admin/mailSettings", "action=update&id=1&reset=1", '_qf_MailSettings_cancel-bottom');
index 743f940c67de9daa0c14a6d6e25352cc626ba9d0..88d714891bcac020d34267de03f74e06ca26b2ef 100644 (file)
@@ -128,10 +128,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase {
       'Source' => $sourceText,
     );
     $this->webtestVerifyTabularData($verifyData);
-    $this->click("_qf_MembershipView_cancel-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[7]");
+    $this->clickLink("_qf_MembershipView_cancel-bottom", "xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[7]");
     $this->click("xpath=//div[@id='memberships']/div/table/tbody//tr/td[1][text()='{$memTypeParams['membership_type']}']/../td[9]/span/a[2][text()='Edit']");
     $this->waitForElementPresent("_qf_Membership_cancel-bottom");
 
index d575758744bd909fc7a03f1028bce98806d918e6..1bc3dd55c919727e3f3cc6ab2a47ae31042ffc1a 100755 (executable)
@@ -83,9 +83,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
 
     $this->_testDefaultSenarios("National_Membership_{$title}-section", 2);
     $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -97,9 +95,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
     $this->_testDefaultSenarios("National_Membership_{$title}-section", 4);
     $this->_testDefaultSenarios("Second_Membership_{$title}-section", 2);
     $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -111,9 +107,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
 
     $this->_testDefaultSenarios("National_Membership_{$title}-section", 3);
     $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -124,9 +118,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
 
     $this->_testDefaultSenarios("National_Membership_{$title}-section", 1);
     $this->contactInfoFill($firstName, $lastName, $email, $contactParams, $streetAddress);
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Main_upload-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Main_upload-bottom");
     $this->assertTrue($this->isTextPresent("You already have a lifetime membership and cannot select a membership with a shorter term."));
   }
 
@@ -176,10 +168,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
     $this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now."));
   }
 
@@ -265,9 +254,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
           break;
       }
       $this->select("financial_type_id", "label={$contributionType}");
-      $this->click('_qf_Field_next_new-bottom');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
       $this->assertTrue($this->isTextPresent("Price Field '{$label}' has been saved."));
     }
     return array($memTypeTitle1, $memTypeTitle2, $memTypeTitle3);
index 9b8e03819d5464cd836b07b926d8125bad909a50..8fc3386c20cbf0cff8499a24ef31afdada94c5eb 100644 (file)
@@ -100,10 +100,7 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase
 
     $this->type("sort_name", "$firstName $lastName");
     $this->click("member_test");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    
-    $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']");
     $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr[1]/td[11]/span/a[text()='View']");
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
index 3a125b0eba86534fe0780f86ee8909f1b9ef3ce8..8ec979063b35c61719090325a35e8e4bb12ea43d 100644 (file)
@@ -46,9 +46,7 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas
     $lastName = 'Smith_' . substr(sha1(rand()), 0, 7);
     $this->type('email-5', "{$lastName}@example.com");
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next_checkout");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next_checkout");
 
     $text = 'I want this membership to be renewed automatically every 1 year(s).';
     $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
@@ -80,9 +78,7 @@ class WebTest_Member_OnlineAutoRenewMembershipGCTest extends CiviSeleniumTestCas
     $lastName = 'Smith_' . substr(sha1(rand()), 0, 7);
     $this->type('email-5', "{$lastName}@example.com");
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next_checkout");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next_checkout");
 
     $text = 'I want this membership to be renewed automatically every 1 year(s).';
     $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
index a98a05bf9844bff5a1df13f1a5969b7f1c817d2e..328613dcff456503b9cc2f2704a0433680158a97 100644 (file)
@@ -49,9 +49,7 @@ class WebTest_Member_OnlineAutoRenewMembershipTest extends CiviSeleniumTestCase
 
     $this->type('email-5', "{$lastName}@example.com");
 
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $text = 'I want this membership to be renewed automatically every 1 year(s).';
     $this->assertElementContainsText('css=div.display-block', $text, 'Missing text: ' . $text);
index cd0dfd3be7cc2f19a1e2f1f9e0a9a7c8042a9cf6..9dfcf6550915a19979c666e4032c400c82e72aa9 100644 (file)
@@ -205,10 +205,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->click('_qf_Set_next-bottom');
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom');
     $this->assertElementContainsText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now.");
   }
 
@@ -266,9 +263,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
           break;
       }
       $this->select("financial_type_id", "label={$contributionType}");
-      $this->click('_qf_Field_next_new-bottom');
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent('_qf_Field_next-bottom');
+      $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom');
       $this->assertElementContainsText('crm-notification-container', "Price Field '{$label}' has been saved.");
     }
     return array($memTypeTitle1, $memTypeTitle2);
@@ -280,11 +275,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->openCiviPage('admin/price', 'reset=1');
 
     // Use the price set id ($sid) to pick the correct row
-    $this->click("css=tr#row_{$sid} a[title='Preview Price Set']");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    // Look for Register button
-    $this->waitForElementPresent('_qf_Preview_cancel-bottom');
+    $this->clickLink("css=tr#row_{$sid} a[title='Preview Price Set']", '_qf_Preview_cancel-bottom');
 
     // Check for expected price set field strings
     $this->assertStringsPresent($validateStrings);
@@ -338,10 +329,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -400,9 +388,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     if($renew){
       $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
       $this->type("sort_name", "{$contactParams['first_name']} {$contactParams['last_name']}");
-      $this->click("_qf_Search_refresh");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
-      $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
+      $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr");
       $this->click("xpath=//div[@id='memberSearch']/table/tbody//tr/td[4][text()='{$memTypeTitle1}']/../td[11]/span/a[text()='View']");
       $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
       $year = CRM_Utils_Date::processDate($this->getText("xpath=//form[@id='MembershipView']//table/tbody/tr/td[text()='End date']/following-sibling::td"));
@@ -458,10 +444,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
index 2abf1e9ada9a6efdd12eea506420495cafc8d516..0cc25d9735e39ec5500cc244dc82e3f7a691b9e9 100644 (file)
@@ -104,9 +104,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->openCiviPage("admin/contribute/membership", "reset=1&action=update&id={$pageId}", '_qf_MembershipBlock_next-bottom');
     $this->click("membership_type_$memTypeId1");
     $this->click("membership_type_$memTypeId2");
-    $this->click('_qf_MembershipBlock_next');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_MembershipBlock_next-bottom');
+    $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom');
     $text = "'MembershipBlock' information has been saved.";
     $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text);
     
@@ -126,11 +124,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr");
     $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr/td[11]/span/a[text()='View']");
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -308,13 +302,8 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase {
     $this->openCiviPage("contribute/search","reset=1", "contribution_date_low");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->click("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_ContributionView_cancel-bottom");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']");
+    $this->clickLink("xpath=//div[@id='contributionSearch']//table//tbody/tr[1]/td[11]/span/a[text()='View']", "_qf_ContributionView_cancel-bottom");
 
     //View Contribution Record and verify data
     $expected = array(
index a36d5cc7fe9b6f78933e282bb49fc76430688acf..8319032d76685b822dc2ca6f3afa09a5e2e8e5dc 100644 (file)
@@ -120,10 +120,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
 
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -134,10 +131,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -183,10 +177,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
 
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -195,10 +186,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -298,10 +286,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
 
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -310,10 +295,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -345,10 +327,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->type("cvv2", "000");
     $this->select("credit_card_exp_date[M]", "value=1");
     $this->select("credit_card_exp_date[Y]", "value=2020");
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -356,10 +335,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$firstName $lastName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -542,9 +518,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->select("billing_country_id-5", "value=1228");
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
-    $this->click("_qf_Main_upload-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -558,10 +532,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$organisationName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -582,10 +553,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$lastName, $firstName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -640,10 +608,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->select("billing_state_province_id-5", "value=1004");
     $this->type("billing_postal_code-5", "94129");
 
-    $this->click("_qf_Main_upload-bottom");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("_qf_Confirm_next-bottom");
+    $this->clickLink("_qf_Main_upload-bottom", "_qf_Confirm_next-bottom");
 
     $this->click("_qf_Confirm_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -656,10 +621,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$organisationName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
@@ -679,10 +641,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->openCiviPage("member/search", "reset=1", "member_end_date_high");
 
     $this->type("sort_name", "$lastName, $firstName");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent('css=#memberSearch table tbody tr td span a.action-item-first');
+    $this->clickLink("_qf_Search_refresh", 'css=#memberSearch table tbody tr td span a.action-item-first');
     $this->click('css=#memberSearch table tbody tr td span a.action-item-first');
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
index f3b038bb1a7ab6b7ac2dbef0472c52ccffc3e03a..81e1173ee0327a9f4e7ca560fec3afe66ab18e28 100644 (file)
@@ -103,9 +103,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase
     $this->openCiviPage('admin/contribute/membership', "reset=1&action=update&id={$pageId}", "_qf_MembershipBlock_next-bottom");
     $this->click("membership_type_$memTypeId1");
     $this->click("membership_type_$memTypeId2");
-    $this->click('_qf_MembershipBlock_next');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_MembershipBlock_next-bottom');
+    $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom');
     $text = "'MembershipBlock' information has been saved.";
     $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text);
     $this->_testOnlineMembershipSignup($pageId, $memTypeTitle1, $cid);
@@ -113,9 +111,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase
     //Find Member
     $this->openCiviPage('member/search', 'reset=1', 'member_end_date_high');
     $this->type("sort_name", "$firstName1 $lastName1");
-    $this->click("_qf_Search_refresh");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='memberSearch']/table/tbody/tr");
+    $this->clickLink("_qf_Search_refresh", "xpath=//div[@id='memberSearch']/table/tbody/tr");
     $this->click("xpath=//div[@id='memberSearch']/table/tbody/tr/td[11]/span/a[text()='View']");
     $this->waitForElementPresent("_qf_MembershipView_cancel-bottom");
 
index 450790224af7204588ae4a27d5224e1519f7af29..9c777138a5c7b9e8ea40d6edcacf316c24cd1c54 100644 (file)
@@ -118,10 +118,7 @@ class WebTest_Pledge_ContactContextAddTest extends CiviSeleniumTestCase {
       $this->verifyText("xpath=//form[@id='PledgeView']//table/tbody/tr/td[text()='{$label}']/following-sibling::td", preg_quote($value));
     }
 
-    $this->click("_qf_PledgeView_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span[1]/a[text()='View']");
+    $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span[1]/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
   }
index 58ffef142784711e6cb76488d738e664ca07adb9..d0df48f1023bef407e5cbd2d9c5c1901b54bc971 100644 (file)
@@ -122,10 +122,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
       )
     );
 
-    $this->click("_qf_PledgeView_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
@@ -168,10 +165,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
       )
     );
 
-    $this->click("_qf_PledgeView_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[4]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[4]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
@@ -302,10 +296,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
       )
     );
 
-    $this->click("_qf_PledgeView_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
@@ -352,10 +343,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
       )
     );
 
-    $this->click("_qf_PledgeView_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[4]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[4]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
index 351a7bc7b02720a7a103bc0189d1527593f25eb3..c94640d8d7ff72c523814448987def1714b08817 100644 (file)
@@ -71,10 +71,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase {
         'Pledge Status' => 'Pending',
       )
     );
-    $this->click('_qf_PledgeView_next-bottom');
-    $this->waitForPageToLoad("30000");
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a");
index f41579896dabab0d413c97bee308e55853b71fa0..152b25bb83112fdd6759bf537b49036ad95e1b4e 100644 (file)
@@ -98,10 +98,7 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase {
         'Send additional reminders' => '4 days after the last one sent',
       )
     );
-    $this->click('_qf_PledgeView_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
+    $this->clickLink('_qf_PledgeView_next-bottom', "xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']");
     $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a");
     $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody//tr//td/table/tbody/tr[2]/td[8]/a[text()='Record Payment (Check, Cash, EFT ...)']");
   }
index e3aa6d30d95dd026bef88bf3f26d6cdfb7f64d36..2fc8851ef7eab8fca24df7f661c365a5869de7a5 100644 (file)
@@ -397,9 +397,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('sort_name');
     $this->type('sort_name', $lastName);
     $this->waitForElementPresent('_qf_Search_refresh');
-    $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('Go');
+    $this->clickLink('_qf_Search_refresh', 'Go');
     $this->click('CIVICRM_QFID_ts_all_4');
     $this->click('Go');
     $this->waitForElementPresent('_qf_Reserve_next_reserveToInterview-top');
index c3ca85181a782accefc6b98c6ef401edcfba94fd..cc2047bf10193b47786f2aba15ff827c9211bc03 100644 (file)
@@ -102,11 +102,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
     $this->click('in_selector');
     // click on save
-    $this->click('_qf_Field_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    // Add Individual Contact.
-    $this->waitForElementPresent("xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']");
+    $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']");
     $this->click("xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']");
 
     $this->waitForElementPresent('_qf_Edit_next');
@@ -148,11 +144,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
 
     // Edit first profile field
     $this->waitForElementPresent("xpath=//table/tbody/tr[1]/td[9]");
-    $this->click("xpath=//table/tbody/tr[1]/td[9]/span[1]/a[1]");
-
-    // Verify that visibility field is present in edit form
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent('_qf_Field_next-bottom');
+    $this->clickLink("xpath=//table/tbody/tr[1]/td[9]/span[1]/a[1]", '_qf_Field_next-bottom');
 
     // sleep 5 to make sure jQuery is not hiding field after page load
     // Because it tends to cause problems, all uses of sleep() must be justified in comments
index 5b15a6d3fddb036837757430db091f1ee6d72bbb..c764f8c9ac1e1e26e9866551b6e6d7a698a74022 100644 (file)
@@ -59,10 +59,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     // Justification for this instance: FIXME
     sleep(3);
     $this->select("group_id", "label=Case Resources");
-    $this->click("_qf_GroupContact_next");
-
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//form[@id='GroupContact']//div[@class='view-content']//div[@class='dataTables_wrapper']/table/tbody/tr/td[4]/a");
+    $this->clickLink("_qf_GroupContact_next", "xpath=//form[@id='GroupContact']//div[@class='view-content']//div[@class='dataTables_wrapper']/table/tbody/tr/td[4]/a");
     $this->click("xpath=//form[@id='GroupContact']//div[@class='view-content']//div[@class='dataTables_wrapper']/table/tbody/tr/td[4]/a");
 
     // Check confirmation alert.
@@ -130,9 +127,7 @@ class WebTest_Report_LoggingReportTest extends CiviSeleniumTestCase {
     $this->select("relationship_type_id", "label=Employee of");
     $this->webtestFillAutocomplete("Default Organization");
     $this->waitForElementPresent("quick-save");
-    $this->click("quick-save");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->waitForElementPresent("xpath=//div[@id='current-relationships']//a[text()='Disable']");
+    $this->clickLink("quick-save", "xpath=//div[@id='current-relationships']//a[text()='Disable']");
     $this->click("xpath=//div[@id='current-relationships']//a[text()='Disable']");
     $this->assertTrue((bool)preg_match("/^Are you sure you want to disable this relationship/",
       $this->getConfirmation()