X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FEvent%2FTellAFriendTest.php;h=eb5661f93a769e57b5ae4f42cdc3a6fd6f5736fd;hb=82af04d6a6f8bb1acc04bc8b720038c7adc2821e;hp=1528e8f4cd1f815e638d8d90369c1749666980a2;hpb=1789c269b1c68178c1f3de38d751a4e37f94db4c;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 1528e8f4cd..eb5661f93a 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -1,7 +1,7 @@ webtestLogin('admin'); @@ -75,7 +75,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->open($registerUrl); $this->waitForElementPresent('_qf_Register_upload-bottom'); - $firstName = 'Jane' .substr(sha1(rand()), 0, 7); + $firstName = 'Jane' . substr(sha1(rand()), 0, 7); $lastName = 'Doe' . substr(sha1(rand()), 0, 7); $this->type('first_name', "$firstName"); $this->type('last_name', "$lastName"); @@ -141,27 +141,26 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->openCiviPage("contact/search", "reset=1", '_qf_Basic_refresh'); $this->type('sort_name', $firstName); $this->click('_qf_Basic_refresh '); - $this->waitForElementPresent('Go'); - $this->assertTrue($this->isTextPresent('1 Contact')); + $this->waitForTextPresent('1 Contact'); // Verify Activity created $this->openCiviPage("activity/search", "reset=1", '_qf_Search_refresh'); $this->type('sort_name', $firstName1); $this->click('_qf_Search_refresh'); - $this->waitForElementPresent("Go"); + $this->waitForElementPresent("xpath=//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[text()='View']"); $this->click("xpath=//div[@class='crm-search-results']//table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[text()='View']"); $this->waitForElementPresent('_qf_Activity_cancel-bottom'); $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[1]/td[2]/span/a[1]", preg_quote("$lastName, $firstName") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[1]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span", preg_quote("$lastName1, $firstName1") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[2]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span", preg_quote("$lastName2, $firstName2") ); - $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span/a[3]", + $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/span", preg_quote("$lastName3, $firstName3") ); @@ -174,7 +173,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $eventTitle * @param $eventDescription */ - function _testAddEventInfo($eventTitle, $eventDescription) { + public function _testAddEventInfo($eventTitle, $eventDescription) { $this->waitForElementPresent("_qf_EventInfo_upload-bottom"); $this->select("event_type_id", "value=1"); @@ -202,7 +201,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { /** * @param $streetAddress */ - function _testAddLocation($streetAddress) { + public function _testAddLocation($streetAddress) { // Wait for Location tab form to load $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent("_qf_Location_upload-bottom"); @@ -212,6 +211,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->type("address_1_street_address", $streetAddress); $this->type("address_1_city", "San Francisco"); $this->type("address_1_postal_code", "94117"); + $this->select('address_1_country_id', 'United States'); $this->select("address_1_state_province_id", "value=1004"); $this->type("email_1_email", "info@civicrm.org"); @@ -226,7 +226,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $registerIntro * @param bool $multipleRegistrations */ - function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { + public function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { // Go to Online Registration tab $this->click("link=Online Registration"); $this->waitForElementPresent("_qf_Registration_upload-bottom"); @@ -238,6 +238,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->assertChecked("is_multiple_registrations"); } + $this->click('intro_text-plain'); $this->fillRichTextField("intro_text", $registerIntro); // enable confirmation email @@ -255,7 +256,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { * @param $thankYouMsg * @param $eventTitle */ - function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { + public function _testAddTellAFriend($subject, $thankYouMsg, $eventTitle) { // Go to Tell A Friend Tab $this->click('link=Tell a Friend'); $this->waitForElementPresent('_qf_Event_cancel-bottom'); @@ -275,4 +276,3 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->waitForElementPresent("xpath=//div[@id='event_status_id']//div[@id='option11_wrapper']/table/tbody//tr/td[1]/a[text()='$eventTitle']"); } } -