From 5f0e3af6e2e3ddd6ce8cfadcdcd3915d88f15ab0 Mon Sep 17 00:00:00 2001 From: Dave Greenberg Date: Mon, 8 Sep 2014 16:59:46 -0700 Subject: [PATCH] CRM-15197 - webtest fix for WebTest_Event_AddPricesetTest.testParticipantWithDateSpecificPriceSet and also fixing possible timeouts caused by Similar Contact warning ---------------------------------------- * CRM-15197: https://issues.civicrm.org/jira/browse/CRM-15197 --- tests/phpunit/WebTest/Event/AddPricesetTest.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/phpunit/WebTest/Event/AddPricesetTest.php b/tests/phpunit/WebTest/Event/AddPricesetTest.php index e4aae2d7c3..4a43b68b6d 100644 --- a/tests/phpunit/WebTest/Event/AddPricesetTest.php +++ b/tests/phpunit/WebTest/Event/AddPricesetTest.php @@ -458,9 +458,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { // Adding contact with randomized first name (so we can then select that contact when creating event registration) // We're using Quick Add block on the main page for this. $firstName = substr(sha1(rand()), 0, 7); - $this->webtestAddContact($firstName, 'Anderson', TRUE); - $contactName = "Anderson, $firstName"; - $displayName = "$firstName Anderson"; + $lastName = 'Anderson'. substr(sha1(rand()), 0, 7); + $this->webtestAddContact($firstName, $lastName, TRUE); + $contactName = "$lastName, $firstName"; + $displayName = "$firstName $lastName"; $this->openCiviPage('participant/add', 'reset=1&action=add&context=standalone', '_qf_Participant_upload-bottom'); @@ -472,6 +473,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { // Select role $this->multiselect2('role_id', array('Volunteer')); + $this->waitForElementPresent("xpath=//input[@class='crm-form-radio']"); $this->click("xpath=//input[@class='crm-form-radio']"); $this->click("xpath=//input[@class='crm-form-checkbox']"); @@ -512,9 +514,10 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase { // Adding contact with randomized first name (so we can then select that contact when creating event registration) // We're using Quick Add block on the main page for this. $firstName = substr(sha1(rand()), 0, 7); - $this->webtestAddContact($firstName, 'Anderson', TRUE); - $contactName = "Anderson, $firstName"; - $displayName = "$firstName Anderson"; + $lastName = 'Anderson'. substr(sha1(rand()), 0, 7); + $this->webtestAddContact($firstName, $lastName, TRUE); + $contactName = "$lastName, $firstName"; + $displayName = "$firstName $lastName"; $setTitle = 'Conference Fees - ' . substr(sha1(rand()), 0, 7); $usedFor = 'Event'; -- 2.25.1