Webtest fixes
authorColeman Watts <coleman@civicrm.org>
Wed, 17 Sep 2014 18:24:42 +0000 (14:24 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 17 Sep 2014 18:24:42 +0000 (14:24 -0400)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php
tests/phpunit/WebTest/Event/AddEventTest.php

index 33c9a60022322e70ed4e65f118e063800fb84f06..870608c1a9bb847b6a137740481f34427aa27c9f 100644 (file)
@@ -2085,7 +2085,6 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
       //Is custom group created?
       $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added.");
-      $this->click('css=a#newCustomField');
 
       $gid = $this->urlArg('gid');
       $this->waitForTextPresent("{$customGroupTitle} - New Field");
index bfdce3e9d972bb5ade4dc1d4c802c824f46e6787..37e15b1b0c832702f4cc3d97d62a5076b33c84a6 100644 (file)
@@ -343,8 +343,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->openCiviPage('admin/custom/group', 'reset=1');
 
     //add new custom data
-    $this->click("//a[@id='newCustomDataGroup']/span");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink("//a[@id='newCustomDataGroup']/span");
 
     //fill custom group title
     $this->click("title");
@@ -355,12 +354,12 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->select("extends[0]", "value=Activity");
     $this->click("//option[@value='Activity']");
     $this->clickLink('_qf_Group_next-bottom');
-    $this->waitForElementPresent('_qf_Field_cancel-bottom');
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
 
     // create a custom field - Integer Radio
+    $this->clickLinkSuppressPopup('newCustomField', "data_type[0]");
     $this->click("data_type[0]");
     $this->select("data_type[0]", "value=1");
     $this->click("//option[@value='1']");
@@ -390,7 +389,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->click("is_searchable");
 
     //clicking save
-    $this->clickLink("_qf_Field_next_new-bottom", "_qf_Field_next_new-bottom", FALSE);
+    $this->clickLink("_qf_Field_next_new-bottom", "_qf_Field_next_new-bottom");
 
     //Is custom field created
     $this->waitForText('crm-notification-container', "Custom field '$radioFieldLabel' has been saved.");
@@ -409,8 +408,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
 
     //clicking save
-    $this->click("_qf_Field_done-bottom");
-    $this->waitForElementPresent("//a[@id='newCustomField']/span");
+    $this->clickLink("_qf_Field_done-bottom", "//a[@id='newCustomField']/span");
 
     //Is custom field created
     $this->waitForText('crm-notification-container', "Custom field '$textFieldLabel' has been saved.");
index bcd368c2ababafed66084c65fee5b71389951c3a..fc2eb4f106058a507afec563829dba0a967e4e02 100644 (file)
@@ -95,7 +95,6 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("newCustomField");
 
     //Is custom group created?
-    $this->click("newCustomField");
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
 
     $customGroupId = $this->urlArg('gid');
index d726c76595026a79d9fae2af9ce395a490d7e25e..5f5ce829f45dcae59042a2a4cc5700a21c8d2117 100644 (file)
@@ -591,6 +591,8 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->open($registerUrl);
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
+    $this->waitForElementPresent('additional_participants');
+
     $this->select("additional_participants", "value=" . $numberRegistrations);
 
     if ($infoPassed) {
@@ -788,7 +790,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
       );
       $this->assertFalse($this->isElementPresent('record_contribution'),
         'Record Payment checkbox showed up wrongly for additional participant edit screen');
-      $this->clickLink("_qf_Participant_cancel-top");
+      $this->click("_qf_Participant_cancel-top");
     }
 
     //unselect the payment processor configured
@@ -804,10 +806,9 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->openCiviPage("event/search?reset=1", "reset=1");
     $this->select2("event_id", $eventTitle, FALSE);
     $this->click("xpath=//td[@class='crm-event-form-block-participant_status']/div[@class='listing-box']//div/label[text()='Pending from pay later']");
-    $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink('_qf_Search_refresh');
+
     $uRL = $this->getAttribute("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']@href");
-    $participantName = $this->getText("xpath=//div[@id='participantSearch']/table/tbody//tr/td[3]/a");
     $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']");
     $this->waitForElementPresent("status_id");
     $this->select('status_id', 'label=Registered');
@@ -820,7 +821,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase {
     $this->click('_qf_Participant_upload-top');
     $this->waitForElementPresent("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='Edit']");
     $this->click("xpath=//div[@id='participantSearch']/table/tbody//tr/td[11]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_ParticipantView_cancel-top");
+    $this->waitForElementPresent("css=.ui-dialog");
     $this->verifyFinancialRecords($contributionID);
 
     // add participant and 3 additional participant and change status of participant from edit contribution