Fixed Broken webtest of Event and Contact
authorpratikshad <pratiksha.dubey@webaccess.co.in>
Mon, 12 Jan 2015 14:05:58 +0000 (19:35 +0530)
committerpratikshad <pratiksha.dubey@webaccess.co.in>
Mon, 12 Jan 2015 14:05:58 +0000 (19:35 +0530)
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Event/AddParticipationTest.php
tests/phpunit/WebTest/Event/PricesetMaxCountTest.php

index 4f74185ae631880abe8c9a92b2a718906059c03c..de6285e06f57b08cd554ec27e85f0b2ff369ee4a 100644 (file)
@@ -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());
index 8a3011e4ed3eb1063d99bfc6e529db35d1611776..81bc18ca2f281009b7a8342c2b28ffc045aa2382 100644 (file)
@@ -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);
index 1f1b38dcc2c2ca8cca461f6009a4f7cc8033cf37..38bbbf10f32007952c42b37fa27b5384abe6bfa6 100644 (file)
@@ -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');