From: Coleman Watts Date: Wed, 17 Sep 2014 18:24:42 +0000 (-0400) Subject: Webtest fixes X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=57e9cdaf98061e047c5b9301c4a9579aa156bdcb;p=civicrm-core.git Webtest fixes --- diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 33c9a60022..870608c1a9 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -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"); diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index bfdce3e9d9..37e15b1b0c 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -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."); diff --git a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php index bcd368c2ab..fc2eb4f106 100644 --- a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php +++ b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php @@ -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'); diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index d726c76595..5f5ce829f4 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -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