-- webtest improvements
authorRavish Nair <ravish@ravish.(none)>
Tue, 26 Mar 2013 13:24:49 +0000 (18:54 +0530)
committerRavish Nair <ravish@ravish.(none)>
Tue, 26 Mar 2013 13:24:49 +0000 (18:54 +0530)
tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php
tests/phpunit/WebTest/Event/EventListingTest.php
tests/phpunit/WebTest/Member/OnlineMembershipRenewTest.php

index e1189771d20106bbef7c6ed810215ffecb8a9e13..9fd7c93f1ce5358808e4804b8e8c3c4d3ac3a5c3 100644 (file)
@@ -77,9 +77,6 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
     //fill in IM
     $this->type("im_1_name", "testYahoo");
 
-    //fill in openID
-    $this->type("openid_1_openid", "http://" . substr(sha1(rand()), 0, 7) . "openid.com");
-
     //fill in website
     $this->type("website_1_url", "http://www.john.com");
 
@@ -172,8 +169,8 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
     $this->assertElementContainsText('css=.crm-contact_type_label', "Parent");
 
     //custom data check
-    $this->assertTrue($this->isTextPresent("dummy text for customData{$customGroupIdForParent}"));
-    $this->assertTrue($this->isTextPresent("dummy text for customData{$customGroupIdForStudent}"));
+    $this->waitForText("custom-set-content-{$customGroupIdForParent}", "dummy text for customData{$customGroupIdForParent}");
+    $this->waitForText("custom-set-content-{$customGroupIdForStudent}", "dummy text for customData{$customGroupIdForStudent}");
 
     // Get contact id
     $cid = $this->urlArg('cid');
@@ -208,8 +205,8 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
     $this->assertElementContainsText('css=.crm-contact_type_label', "Parent");
 
     //custom data check
-    $this->assertTrue($this->isTextPresent("dummy text for customData{$customGroupIdForParent}"));
-    $this->assertTrue($this->isTextPresent("dummy text for customData{$customGroupIdForStaff}"));
+    $this->waitForText("custom-set-content-{$customGroupIdForParent}", "dummy text for customData{$customGroupIdForParent}");
+    $this->waitForText("custom-set-content-{$customGroupIdForStaff}", "dummy text for customData{$customGroupIdForStaff}");
   }
 
   /**
@@ -236,7 +233,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
 
     //Is custom group created?
-    $this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added."));
+    $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added.");
     $gid = $this->urlArg('gid');
 
     $fieldLabel = "custom_field_for_{$contactSubType}" . substr(sha1(rand()), 0, 4);
index c0dd9b2c0f761684df0640dd2c73bd89982731b1..be6693317e62345526df0190e18813041c467ad5 100644 (file)
@@ -44,15 +44,15 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle3);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("{$eventTitle3}"));
+    $this->waitForText("SearchEvent", "{$eventTitle3}");
     $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle4);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
+    $this->waitForText("SearchEvent", "{$eventTitle4}");
     $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input",$eventTitle5);
     $this->click("_qf_SearchEvent_refresh");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-    $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
+    $this->waitForText("SearchEvent", "{$eventTitle5}");
     $this->type("xpath=//div[@class='crm-block crm-form-block crm-event-searchevent-form-block']/table/tbody/tr/td/input","");
 
     //check if closed Event is present
@@ -63,8 +63,8 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->click('_qf_SearchEvent_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("{$eventTitle1}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle2}"));
+    $this->waitForText("option11", "{$eventTitle1}");
+    $this->waitForText("option11", "{$eventTitle2}");
     $this->assertFalse($this->isTextPresent("{$eventTitle3}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle4}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle5}"));
@@ -73,9 +73,9 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->openCiviPage("event/ical", "reset=1&page=1&html=1", NULL);
     $this->assertFalse($this->isTextPresent("{$eventTitle1}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle2}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle3}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
+    $this->waitForText("option11", "{$eventTitle3}");
+    $this->waitForText("option11", "{$eventTitle4}");
+    $this->waitForText("option11", "{$eventTitle5}");
 
     //go to block listing to enable Upcomming Events Block
     // you need to be admin user for below operation
@@ -98,8 +98,8 @@ class WebTest_Event_EventListingTest extends CiviSeleniumTestCase {
     $this->assertFalse($this->isTextPresent("{$eventTitle1}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle2}"));
     $this->assertFalse($this->isTextPresent("{$eventTitle3}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle4}"));
-    $this->assertTrue($this->isTextPresent("{$eventTitle5}"));
+    $this->waitForText("block-civicrm-6", "{$eventTitle4}");
+    $this->waitForText("block-civicrm-6", "{$eventTitle5}");
 
     //go to block listing to disable Upcomming Events Block
     $this->open($this->sboxPath . 'admin/structure/block');
index 22f417dad65da51dd57629990956de20cba96354..3c700fc0c4d9961ba0198b83e2cbdd946b230697 100644 (file)
@@ -50,7 +50,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     // this contribution page for membership signup
     // select newly created processor
     $xpath = "xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]";
-    $this->assertTrue($this->isTextPresent($processorName));
+    $this->waitForText('css=.crm-contribution-contributionpage-amount-form-block-payment_processor', $processorName);
     $this->check($xpath);
 
     // save
@@ -224,7 +224,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     //this contribution page for membership signup
     $xpath = "xpath=//label[text() = '{$processorName}']/preceding-sibling::input[1]";
-    $this->assertTrue($this->isTextPresent($processorName));
+    $this->waitForText('css=.crm-contribution-contributionpage-amount-form-block-payment_processor', $processorName);
     $this->check($xpath);
 
     // save
@@ -378,7 +378,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
     $this->click('_qf_Contact_upload_view');
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->assertTrue($this->isTextPresent("Organization $title has been created."));
+    $this->waitForText('crm-notification-container', "Organization $title has been created.");
 
     $this->openCiviPage("admin/member/membershipType", "reset=1&action=browse");
 
@@ -404,7 +404,7 @@ class WebTest_Member_OnlineMembershipRenewTest extends CiviSeleniumTestCase {
 
     $this->click('_qf_MembershipType_upload-bottom');
     $this->waitForElementPresent('link=Add Membership Type');
-    $this->assertTrue($this->isTextPresent("The membership type 'Membership Type $title' has been saved."));
+    $this->waitForText('crm-notification-container', "The membership type 'Membership Type $title' has been saved.");
 
     $url = $this->getAttribute("xpath=//div[@id='membership_type']//div[@class='dataTables_wrapper']//table/tbody//tr/td[1][text()='{$membershipTypeTitle}']/../td[12]/span/a[3][text()='Delete']/@href");