Fix for webtests
authorWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 5 Nov 2015 13:11:45 +0000 (18:41 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 5 Nov 2015 13:11:45 +0000 (18:41 +0530)
tests/phpunit/WebTest/Contact/AddTest.php
tests/phpunit/WebTest/Contact/ContactTagTest.php
tests/phpunit/WebTest/Contact/RelationshipAddTest.php
tests/phpunit/WebTest/Event/AddEventTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/AdditionalPaymentTest.php
tests/phpunit/WebTest/Event/PCPAddTest.php
tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php
tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php

index 05cd1fbabb83b2acf3ff1ab89facf5d6af3f3ca9..f2d546c68e7548bde32a85ae54754da023ac9f72 100644 (file)
@@ -42,7 +42,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
 
     // go to display preferences to enable Open ID field
     $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom");
-    $this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input");
+    $this->waitForAjaxContent();
+    $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']");
     $this->click("_qf_Display_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->openCiviPage('contact/add', 'reset=1&ct=Individual');
@@ -178,7 +179,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
 
     // go to display preferences to enable Open ID field
     $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom");
-    $this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input");
+    $this->waitForAjaxContent();
+    $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']");
     $this->click("_qf_Display_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -289,7 +291,8 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
 
     // go to display preferences to enable Open ID field
     $this->openCiviPage('admin/setting/preferences/display', "reset=1", "_qf_Display_next-bottom");
-    $this->check("xpath=//ul[@id='contactEditBlocks']//li/span[2]/label[text()='Open ID']/../input");
+    $this->waitForAjaxContent();
+    $this->click("xpath=//ul[@id='contactEditBlocks']//li/span/label[text()='Open ID']");
     $this->click("_qf_Display_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
index ada9094fc6bc91c8db2525beed100437ef898b8b..de73039ffcd103a75bb5441524839d0b18e4533b 100644 (file)
@@ -145,7 +145,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase {
 
     // Visit contact summary page.
     $this->click("css=ul.ui-autocomplete li");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForAjaxContent();
     $this->waitForText('tags', "tagset1, tagset2");
   }
 
index 88a44b359b2ad46a7b1d9f705d3a6de29ef9ad9c..89be1374c50390299d670139b1faaaa010b14d69 100644 (file)
@@ -336,9 +336,8 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase {
 
     //check the status message
     $this->waitForText('crm-notification-container', 'Relationship created.');
-
-    $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]/a[1]");
-    $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]/a[1]");
+    $this->waitForElementPresent("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]//a[text()='View']");
+    $this->click("xpath=//div[@id='contact-summary-relationship-tab']/div[2]/div[1]/table/tbody/tr/td[9]/span[1]//a[text()='View']");
 
     $this->webtestVerifyTabularData(
       array(
index 10f2bd688496a0636553f1fc2d06b86c62bc3424..5cad3734357763126846cea524ae7c8485402009 100644 (file)
@@ -798,7 +798,6 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
 
     //unselect the payment processor configured
     $this->openCiviPage("event/manage/fee", "reset=1&action=update&id={$eventId}", '_qf_Fee_upload-bottom');
-    $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='Test Processor']");
     $this->click("_qf_Fee_upload-bottom");
     $this->waitForText('crm-notification-container', "'Fees' information has been saved.");
 
index f0b63916e7e4f14bf138729ce01600f4f8f9a5c0..4043f06345b474d0c122b09da52600365c8b7b1b 100644 (file)
@@ -745,14 +745,14 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     //check the delete for price field
     $this->openCiviPage("admin/price/field", "reset=1&action=browse&sid={$sid}");
     $this->waitForElementPresent("xpath=//table[@id='options']/tbody/tr/td[9]/span[2]");
-    $this->click("xpath=//table[@id='options']/tbody/tr/td[9]/span[2]/ul/li[2]/a");
+    $this->click("xpath=//table[@id='options']/tbody/tr/td[9]/span[2]/ul[@class='panel']/li[2]//a[text()='Delete']");
     //assert the message
     $this->waitForText('price_set_used_by', "it is currently in use by one or more active events or contribution pages or contributions or event templates. If you no longer want to use this price set, click the event title below, and modify the fees for that event.");
 
     //check the delete for priceset
     $this->openCiviPage("admin/price", "reset=1");
     $this->waitForElementPresent("xpath=//table[@class='display crm-price-set-listing dataTable no-footer']/tbody/tr/td[4]/span[2]");
-    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]/ul/li[3]/a");
+    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/span[2]/ul/li[3]//a[text()='Delete']");
     // Check confirmation alert.
     $this->assertTrue((bool) preg_match("/^Are you sure you want to delete this price set?/",
       $this->getConfirmation()
index 5b870e7ea01941fa8b902a472cd0026b940fe657..bab05ca745c34a48c44edf73bb25bb981b7b85ca 100644 (file)
@@ -66,6 +66,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $this->select('status_id', 'value=1');
 
     // Setting registration source
+    $this->waitForElementPresent('source');
     $this->type('source', 'Event Partially Paid Webtest');
 
     // Since we're here, let's check of screen help is being displayed properly
@@ -75,7 +76,7 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('priceset');
 
     $this->click("xpath=//input[@class='crm-form-radio']");
-    sleep(1);
+    $this->waitForAjaxContent();
     // record payment total amount
     // amount populated after fee selection
     $amtTotalOwed = (int) $this->getValue('id=total_amount');
@@ -110,9 +111,9 @@ class WebTest_Event_AdditionalPaymentTest extends CiviSeleniumTestCase {
 
     // Is status message correct?
     $this->waitForText('crm-notification-container', "Event registration for $displayName has been added");
-    $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table//tbody/tr[1]/td[8]/span//a[text()='View']");
+    $this->waitForElementPresent("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table[@class='selector row-highlight']//tbody/tr[1]/td[8]/span//a[text()='View']");
     //click through to the participant view screen
-    $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table/tbody/tr[1]/td[8]/span//a[text()='View']");
+    $this->click("xpath=//form[@class='CRM_Event_Form_Search crm-search-form']/table[@class='selector row-highlight']/tbody/tr[1]/td[8]/span//a[text()='View']");
     $this->waitForElementPresent("xpath=//button//span[contains(text(),'Done')]");
 
     $this->webtestVerifyTabularData(
index bd214b3fec3afa100874aa74b469ed28a982a8fe..b89624faff82a2d7b5c4f42ac9acaa4e8ada282e 100644 (file)
@@ -214,7 +214,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase {
     $this->click("link=Fees");
     $this->waitForElementPresent("_qf_Fee_upload-bottom");
     $this->click("CIVICRM_QFID_1_is_monetary");
-    $this->click("xpath=//tr[@class='crm-event-manage-fee-form-block-payment_processor']/td[2]/label[text()='$processorName']");
+    $this->select2('payment_processor', $processorName, TRUE);
     if ($priceSet) {
       // get one - TBD
     }
@@ -256,7 +256,7 @@ class WebTest_Event_PCPAddTest extends CiviSeleniumTestCase {
       $this->assertChecked("is_multiple_registrations");
     }
 
-    $this->click('intro_text-plain');
+    $this->click('intro_text');
     $this->fillRichTextField("intro_text", $registerIntro);
 
     // enable confirmation email
index 9401fd3f7b101fb0ce36c358853da02bd3a8f4e7..34d0f76f492ba2b7602aa96f692f9a778ee3a82a 100644 (file)
@@ -276,11 +276,10 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest
         'Send additional reminders' => '4 days after the last one sent',
       )
     );
-
     $this->clickLink("_qf_PledgeView_next-bottom", "xpath=//div[@class='view-content']//table//tbody/tr[1]/td[10]/span/a[text()='View']", FALSE);
-    $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a");
-    $this->waitForElementPresent("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
-    $this->click("xpath=//div[@class='view-content']//table//tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr[1]/td[1]/span/a");
+    $this->waitForElementPresent("xpath=//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
+    $this->click("xpath=//table/tbody/tr[2]/td[2]/table/tbody/tr[2]/td[8]/a[text()='Record Payment']");
     $this->waitForElementPresent("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
     $this->click("xpath=//form[@id='Contribution']//table//tbody/tr[3]/td[2]/a[text()='adjust payment amount']");
     $this->waitForElementPresent("adjust-option-type");
index bb154f487cbc721b560ec6c74e844471757ca55d..6863f3b27085b0d45481c2c8f2d9222350fb1659 100644 (file)
@@ -93,6 +93,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
     $this->select('field_name[0]', 'value=Contact');
     $this->click("//option[@value='Contact']");
 
+    $this->waitForElementPresent("field_name[1]");
     $this->select('field_name[1]', 'value=group');
     $this->click("//option[@value='group']");