fix the webtest
authoryashodha <yashodha.chaku@webaccess.co.in>
Tue, 13 Aug 2013 09:08:52 +0000 (14:38 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Tue, 13 Aug 2013 09:08:52 +0000 (14:38 +0530)
tests/phpunit/WebTest/Event/TellAFriendTest.php

index 7e6b96563badb7739b2d77fcc7dbab419737759b..765c0e1ef6285cd44675b91f5fffb278c323d032 100644 (file)
@@ -71,8 +71,11 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase {
     $this->open($registerUrl);
     $this->waitForElementPresent('_qf_Register_upload-bottom');
 
-    $firstName = substr(sha1(rand()), 0, 7);
-    $this->type('email-Primary', "$firstName@Anderson.com");
+    $firstName = 'Jane' .substr(sha1(rand()), 0, 7);
+    $lastName = 'Doe' . substr(sha1(rand()), 0, 7);
+    $this->type('first_name', "$firstName");
+    $this->type('last_name', "$lastName");
+    $this->type('email-Primary', "$firstName@$lastName.com");
     $this->click('_qf_Register_upload-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->click("css=div.crm-event-thankyou-form-block div#tell-a-friend a");
@@ -144,7 +147,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Activity_cancel-bottom');
 
     $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[1]/td[2]",
-      preg_quote("$firstName@Anderson.com")
+      preg_quote("$lastName, $firstName")
     );
 
     $this->verifyText("xpath=//table[@class='crm-info-panel']/tbody/tr[2]/td[2]/a[1]",