From fdb227e069173b7b9efcca337ea4e324612355d6 Mon Sep 17 00:00:00 2001 From: pratikshad Date: Mon, 12 Jan 2015 19:35:58 +0530 Subject: [PATCH] Fixed Broken webtest of Event and Contact --- tests/phpunit/WebTest/Contact/MergeContactsTest.php | 6 +++--- tests/phpunit/WebTest/Event/AddParticipationTest.php | 1 - tests/phpunit/WebTest/Event/PricesetMaxCountTest.php | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 4f74185ae6..de6285e06f 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -247,7 +247,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Merge_cancel-bottom'); $this->click('toggleSelect'); $this->click('_qf_Merge_next-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec() * 4); + $this->waitForPageToLoad($this->getTimeoutMsec()); $this->assertTrue($this->isTextPresent("Staff, Student")); } @@ -594,7 +594,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select("name=option51_length", "value=100"); $totalContacts = $this->getXpathCount("//table[@class='pagerDisplay']/tbody/tr"); - $this->click("xpath=//form[@id='DedupeFind']//a/span[text()='Batch Merge Duplicates']"); + $this->click("//form[@id='DedupeFind']//a/span[contains(text(),'Batch Merge Duplicates')]"); // Check confirmation alert. $this->assertTrue( @@ -972,7 +972,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Contact Saved"); $this->openCiviPage("contact/dedupefind", "reset=1&action=update&rgid=4"); - $this->click("xpath=//a/span[text()='Refresh Duplicates']"); + $this->click("//a/span[contains(text(),'Refresh Duplicates')]"); $this->assertTrue((bool) preg_match("/This will refresh the duplicates list. Click OK to proceed./", $this->getConfirmation())); $this->chooseOkOnNextConfirmation(); $this->waitForPageToLoad($this->getTimeoutMsec()); diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index 8a3011e4ed..81bc18ca2f 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -422,7 +422,6 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { public function _fillParticipantDetails($processorId) { $contact = $this->createDialogContact(); - $this->select('payment_processor_id', "value={$processorId}"); $event_id = $this->getAttribute("xpath=//*[@id='event_id']@value"); //check if it is the selected event $this->assertEquals($event_id, 3); diff --git a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php index 1f1b38dcc2..38bbbf10f3 100644 --- a/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php +++ b/tests/phpunit/WebTest/Event/PricesetMaxCountTest.php @@ -220,6 +220,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { // fill correct available option for select field $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}"); + $this->click("css=input[data-amount=10]"); $this->click('_qf_Register_upload-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); @@ -916,7 +917,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { $this->click('_qf_Participant_2_next-Array'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertStringsPresent(array('Sorry, currently only 4 seats are available for this option.')); + $this->assertStringsPresent(array('Sorry, this option is currently sold out.')); // Skip participant3 and register $this->click('_qf_Participant_2_next_skip-Array'); @@ -1221,6 +1222,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase { public function _checkConfirmationAndRegister() { $confirmStrings = array('Event Fee(s)', 'Billing Name and Address', 'Credit Card Information'); $this->assertStringsPresent($confirmStrings); + $this->waitForElementPresent("_qf_Confirm_next-bottom"); $this->click('_qf_Confirm_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); $thankStrings = array('Thank You for Registering', 'Event Total', 'Transaction Date'); -- 2.25.1