From 6c5f7368ee21df1c53764ae71693be966f75d400 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 20 Mar 2013 16:17:38 -0700 Subject: [PATCH] Change messages to wait instead of assert --- .../phpunit/CiviTest/CiviSeleniumTestCase.php | 4 +-- .../WebTest/ACL/AssignUsersToRolesTest.php | 14 +++++----- .../Activity/ContactContextAddTest.php | 4 +-- tests/phpunit/WebTest/Activity/IcalTest.php | 2 +- tests/phpunit/WebTest/Admin/CustomAddTest.php | 6 ++--- .../WebTest/Admin/MoveCustomDataTest.php | 8 +++--- .../WebTest/Admin/RelationshipTypeAddTest.php | 12 +++------ .../phpunit/WebTest/Campaign/ActivityTest.php | 10 +++---- .../Campaign/CampaignDescriptionTest.php | 4 +-- .../phpunit/WebTest/Campaign/MailingTest.php | 4 +-- .../WebTest/Campaign/MembershipTest.php | 4 +-- .../Campaign/OfflineContributionTest.php | 6 ++--- .../Campaign/OnlineContributionTest.php | 4 +-- .../Campaign/OnlineEventRegistrationTest.php | 13 ++++------ .../Campaign/SurveyUsageScenarioTest.php | 24 ++++++++--------- .../WebTest/Case/ActivityToCaseTest.php | 12 ++++----- tests/phpunit/WebTest/Case/AddCaseTest.php | 2 +- tests/phpunit/WebTest/Contact/AddTest.php | 16 +++++------- .../AdvanceSearchPrivacyOptionsTest.php | 2 +- .../WebTest/Contact/AdvancedSearchTest.php | 10 +++---- .../AdvancedSearchedRelatedContactTest.php | 8 +++--- .../Contact/ContactReferenceFieldTest.php | 8 +++--- .../WebTest/Contact/CustomDataAddTest.php | 16 ++++++------ .../DeceasedContactsAdvancedSearchTest.php | 2 +- .../WebTest/Contact/DupeContactTest.php | 2 +- .../phpunit/WebTest/Contact/GroupAddTest.php | 2 +- .../WebTest/Contact/MergeContactsTest.php | 26 +++++++++---------- .../Contact/MultipleContactSubTypes.php | 4 +-- .../phpunit/WebTest/Contact/PrevNextTest.php | 6 ++--- .../phpunit/WebTest/Contact/SignatureTest.php | 4 +-- .../WebTest/Contact/TagSetSearchTest.php | 2 +- .../Contact/TaskActionAddToGroupTest.php | 8 +++--- .../WebTest/Contact/TaskActionSendSMS.php | 8 +++--- .../Contribute/ContactContextAddTest.php | 2 +- .../Contribute/OnBehalfOfOrganization.php | 2 +- tests/phpunit/WebTest/Event/AddEventTest.php | 2 +- .../WebTest/Event/AddParticipationTest.php | 8 +++--- tests/phpunit/WebTest/Export/ContactTest.php | 2 +- .../Financial/FinancialAccountTypeTest.php | 16 ++++-------- .../WebTest/Grant/CustomFieldsetTest.php | 6 ++--- .../WebTest/Import/AddressImportTest.php | 14 +++++----- .../WebTest/Import/DuplicateMatchingTest.php | 2 +- .../WebTest/Import/MatchExternalIdTest.php | 4 +-- .../Mailing/AddMessageTemplateTest.php | 2 +- .../Mailing/AddNewMailingComponentTest.php | 6 ++--- tests/phpunit/WebTest/Mailing/MailingTest.php | 4 +-- .../Member/BatchUpdateViaProfileTest.php | 16 +++++------- .../WebTest/Member/ContactContextAddTest.php | 10 +++---- .../Member/InheritedMembershipTest.php | 13 +++++----- .../OfflineMembershipAddPricesetTest.php | 6 ++--- .../Member/OfflineMembershipRenewTest.php | 20 ++++---------- .../OnlineMembershipAddPricesetTest.php | 6 ++--- .../Member/OnlineMembershipCreateTest.php | 2 +- .../Member/SeperateMembershipPaymentTest.php | 4 +-- .../Member/UpdateMembershipScriptTest.php | 6 ++--- .../WebTest/Pledge/ContactContextAddTest.php | 2 +- .../ContactContextPledgePaymentAddTest.php | 6 ++--- .../Pledge/StandaloneAddDeleteTest.php | 8 +++--- .../WebTest/Pledge/StandaloneAddTest.php | 2 +- .../WebTest/Profile/BatchUpdateTest.php | 16 ++++++------ tests/phpunit/WebTest/Profile/DedupeTest.php | 2 +- .../Profile/MultiRecordProfileAddTest.php | 2 +- .../WebTest/Profile/ProfileAddTest.php | 4 +-- .../Profile/ProfileGroupSubscriptionTest.php | 4 +-- tests/phpunit/WebTest/Profile/SearchTest.php | 12 ++++----- 65 files changed, 207 insertions(+), 261 deletions(-) diff --git a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php index 0d17dd40bd..c90b66ade3 100644 --- a/tests/phpunit/CiviTest/CiviSeleniumTestCase.php +++ b/tests/phpunit/CiviTest/CiviSeleniumTestCase.php @@ -268,7 +268,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { if ($added) { $this->click("_qf_Component_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "Saved"); + $this->waitForText('crm-notification-container', "Saved"); } } @@ -1226,7 +1226,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase { $this->clickLink('_qf_Edit_upload-bottom'); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "$groupName"); + $this->waitForText('crm-notification-container', "$groupName"); return $groupName; } diff --git a/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php b/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php index fa456256e4..ad4ddbfa2d 100755 --- a/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php +++ b/tests/phpunit/WebTest/ACL/AssignUsersToRolesTest.php @@ -42,23 +42,22 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase { $this->click("_qf_Edit_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "The Group '{$groupTitle}' has been saved."); + $this->waitForText('crm-notification-container', "The Group '{$groupTitle}' has been saved."); $this->openCiviPage("admin/options/acl_role", "group=acl_role&action=add&reset=1", "_qf_Options_cancel-bottom"); $label = "TestAclRole" . substr(sha1(rand()), 0, 4); $this->type("label", $label); - $this->click("_qf_Options_next-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "The Acl Role '{$label}' has been saved"); + $this->clickLink("_qf_Options_next-bottom"); + + $this->waitForText('crm-notification-container', "The Acl Role '{$label}' has been saved"); $this->openCiviPage("acl/entityrole", "action=add&reset=1"); $this->select("acl_role_id", "label=" . $label); $this->select("entity_id", "label={$groupTitle}"); - $this->click("_qf_EntityRole_next-botttom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink("_qf_EntityRole_next-botttom"); $this->openCiviPage("acl", "action=add&reset=1"); $this->click("group_id"); @@ -66,8 +65,7 @@ class WebTest_ACL_AssignUsersToRolesTest extends CiviSeleniumTestCase { $this->select("operation", "label=View"); $this->select("entity_id", "label={$label}"); $this->type("name", "describe {$label}"); - $this->click("_qf_ACL_next-bottom"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink("_qf_ACL_next-bottom"); } } diff --git a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php index 301fea6434..8a06cebaa9 100644 --- a/tests/phpunit/WebTest/Activity/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Activity/ContactContextAddTest.php @@ -78,7 +78,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { // Since we're here, let's check if screen help is being displayed properly - $this->assertElementContainsText('css=tr.crm-activity-form-block-assignee_contact_id td span.description', 'You can optionally assign this activity to someone', 'Help text is missing.'); + $this->assertElementContainsText('css=tr.crm-activity-form-block-assignee_contact_id', 'You can optionally assign this activity to someone', 'Help text is missing.'); // Putting the contents into subject field - assigning the text to variable, it'll come in handy later $subject = "This is subject of test activity being added through activity tab of contact summary screen."; // For simple input fields we can use field id as selector @@ -117,7 +117,7 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving."); + $this->waitForText('crm-notification-container', $subject); $this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[9]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Activity/IcalTest.php b/tests/phpunit/WebTest/Activity/IcalTest.php index 32a35a2d92..4c42993be7 100644 --- a/tests/phpunit/WebTest/Activity/IcalTest.php +++ b/tests/phpunit/WebTest/Activity/IcalTest.php @@ -84,7 +84,7 @@ class WebTest_Activity_IcalTest extends CiviSeleniumTestCase { $this->click("_qf_Activity_upload"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', $subject); // check the resulting email $mail = $mailer->getMostRecentEmail('ezc'); diff --git a/tests/phpunit/WebTest/Admin/CustomAddTest.php b/tests/phpunit/WebTest/Admin/CustomAddTest.php index 80cb670156..96efbc184d 100644 --- a/tests/phpunit/WebTest/Admin/CustomAddTest.php +++ b/tests/phpunit/WebTest/Admin/CustomAddTest.php @@ -49,7 +49,7 @@ class WebTest_Admin_CustomAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now."); //add custom field - alphanumeric text $textFieldLabel = 'test_text_field' . substr(sha1(rand()), 0, 3); $this->click("header"); @@ -97,7 +97,7 @@ class WebTest_Admin_CustomAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved."); //create another custom field - Number Radio $this->click("data_type[0]"); @@ -133,7 +133,7 @@ class WebTest_Admin_CustomAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); //On New Individual contact form $this->openCiviPage("contact/add", "ct=Individual&reset=1"); diff --git a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php index c4772b1d7b..3af6fa56f2 100644 --- a/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php +++ b/tests/phpunit/WebTest/Admin/MoveCustomDataTest.php @@ -123,7 +123,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //assert that the success text is present - $this->assertElementContainsText('crm-notification-container', "has been moved", "Move field success message not displayed"); + $this->waitForText('crm-notification-container', "has been moved"); //assert that the custom field not on old data set page @@ -210,7 +210,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Field_cancel-bottom"); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.", "Group title missing"); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); $url = $this->parseURL(); $group_id = $url['queryString']['gid']; @@ -343,7 +343,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$fieldLabel' has been saved.", "Field was not created successfully"); + $this->waitForText('crm-notification-container', "Your custom field '$fieldLabel' has been saved."); //get the custom id of the custom field that was just created $results = $this->webtest_civicrm_api("CustomField", "get", array('label' => $fieldLabel, 'custom_group_id' => $group_id)); @@ -417,7 +417,7 @@ class WebTest_Admin_MoveCustomDataTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //assert success - $this->assertElementContainsText('crm-notification-container', "has been updated", "Contact Record could not be saved"); + $this->waitForText('crm-notification-container', "has been updated"); } } diff --git a/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php b/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php index a6e265333b..fa1cf8b415 100644 --- a/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php +++ b/tests/phpunit/WebTest/Admin/RelationshipTypeAddTest.php @@ -60,9 +60,7 @@ class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //does data saved. - $this->assertElementContainsText('crm-notification-container', 'The Relationship Type has been saved.', - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', 'The Relationship Type has been saved.'); //validate data. $data = array( @@ -98,9 +96,7 @@ class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase { $this->click('_qf_RelationshipType_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', 'Relationship Label-A to B is a required field.', - 'Required form rule for Label A - B seems to be broken.' - ); + $this->waitForText('crm-notification-container', 'Relationship Label-A to B is a required field.'); //enter the relationship type values. $labelAB = 'Test Relationship Type A - B - DUPLICATE TO BE' . rand(); @@ -122,9 +118,7 @@ class WebTest_Admin_RelationshipTypeAddTest extends CiviSeleniumTestCase { $this->click('_qf_RelationshipType_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', 'Label already exists in Database.', - 'Unique relationship type label form rule seems to be broken.' - ); + $this->waitForText('crm-notification-container', 'Label already exists in Database.'); } } diff --git a/tests/phpunit/WebTest/Campaign/ActivityTest.php b/tests/phpunit/WebTest/Campaign/ActivityTest.php index ac48a1c0b2..f9315dd7b6 100644 --- a/tests/phpunit/WebTest/Campaign/ActivityTest.php +++ b/tests/phpunit/WebTest/Campaign/ActivityTest.php @@ -102,10 +102,7 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); @@ -195,11 +192,10 @@ class WebTest_Campaign_ActivityTest extends CiviSeleniumTestCase { $this->type("followup_activity_subject", "This is subject of schedule follow-up activity"); // Clicking save. - $this->click("_qf_Activity_upload"); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->clickLink("_qf_Activity_upload"); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', $subject); $this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[1]/td[9]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php index a712596381..a12087da18 100644 --- a/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php +++ b/tests/phpunit/WebTest/Campaign/CampaignDescriptionTest.php @@ -74,9 +74,7 @@ class WebTest_Campaign_CampaignDescriptionTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); //Opening Edit Page of the created Campaign $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody//tr/td[text()='{$campaignTitle}']/../td[13]/span/a[text()='Edit']"); diff --git a/tests/phpunit/WebTest/Campaign/MailingTest.php b/tests/phpunit/WebTest/Campaign/MailingTest.php index 0a7955ed41..bf403308ac 100644 --- a/tests/phpunit/WebTest/Campaign/MailingTest.php +++ b/tests/phpunit/WebTest/Campaign/MailingTest.php @@ -91,9 +91,7 @@ class WebTest_Campaign_MailingTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); diff --git a/tests/phpunit/WebTest/Campaign/MembershipTest.php b/tests/phpunit/WebTest/Campaign/MembershipTest.php index f62db6bd2d..2ee8a4df5a 100644 --- a/tests/phpunit/WebTest/Campaign/MembershipTest.php +++ b/tests/phpunit/WebTest/Campaign/MembershipTest.php @@ -100,9 +100,7 @@ class WebTest_Campaign_MembershipTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); diff --git a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php index 702b04d408..75b5232b8f 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php @@ -107,9 +107,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign $campaignTitle has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']"); $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href")); @@ -209,7 +207,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved"); + $this->waitForText('crm-notification-container', "The contribution record has been saved"); $this->waitForElementPresent("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index 686a02ff4a..7295ce81aa 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -105,9 +105,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); diff --git a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php index 90fa187aab..2f7ec65ad2 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineEventRegistrationTest.php @@ -102,9 +102,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Campaign Campaign $title has been saved.", - "Status message didn't show up after saving campaign!" - ); + $this->waitForText('crm-notification-container', "Campaign $title"); $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); @@ -187,11 +185,10 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->select("address_1_state_province_id", "value=1004"); $this->type("email_1_email", "info@civicrm.org"); - $this->click("_qf_Location_upload-bottom"); + $this->clickLink("_qf_Location_upload-bottom"); // Wait for "saved" status msg - $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Location' information has been saved."); + $this->waitForText('crm-notification-container', "saved"); } function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { @@ -221,7 +218,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase // Wait for "saved" status msg $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Fee' information has been saved."); + $this->waitForText('crm-notification-container', "saved"); } function _testAddOnlineRegistration($registerIntro, $multipleRegistrations = FALSE) { @@ -245,7 +242,7 @@ class WebTest_Campaign_OnlineEventRegistrationTest extends CiviSeleniumTestCase $this->click("_qf_Registration_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->waitForTextPresent("'Registration' information has been saved."); + $this->waitForText('crm-notification-container', "saved"); } function _testVerifyEventInfo($eventTitle, $eventInfoStrings) { diff --git a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php index e640d8fa54..72d2bc4e00 100644 --- a/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php +++ b/tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php @@ -99,7 +99,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click("_qf_Campaign_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "$title"); + $this->waitForText('crm-notification-container', "$title"); // create a custom data set for activities -> survey $this->openCiviPage('admin/custom/group', "action=add&reset=1", "_qf_Group_next-bottom"); @@ -133,7 +133,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click("_qf_Field_next-bottom"); $this->waitForElementPresent("newCustomField"); - $this->assertElementContainsText("crm-notification-container", "$title"); + $this->waitForText('crm-notification-container', "$title"); // create a profile for campaign $this->openCiviPage("admin/uf/group/add", "action=add&reset=1", "_qf_Group_next-bottom"); @@ -145,7 +145,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click("_qf_Group_next-bottom"); $this->waitForElementPresent("_qf_Field_next-bottom"); - $this->assertElementContainsText("crm-notification-container", "$title"); + $this->waitForText('crm-notification-container', "$title"); // add a profile field for activity $this->select("field_name[0]", "value=Activity"); @@ -154,7 +154,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click("_qf_Field_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "$title"); + $this->waitForText('crm-notification-container', "$title"); // create a survey $this->openCiviPage("survey/add", "reset=1", "_qf_Main_upload-bottom"); @@ -197,7 +197,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->type("//input[@id='option_value_2']", "2"); $this->click('_qf_Results_upload_done-bottom'); $this->waitForElementPresent("//div[@id='search_form_survey']"); - $this->assertElementContainsText("crm-notification-container", "Results"); + $this->waitForText('crm-notification-container', "Results"); // Reserve Respondents $this->openCiviPage("survey/search", "reset=1&op=reserve", "_qf_Search_refresh"); @@ -214,7 +214,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom"); $this->click("_qf_Reserve_done_reserve-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "2"); + $this->waitForText('crm-notification-container', "2"); // Interview Respondents $this->openCiviPage("survey/search", "reset=1&op=interview", "_qf_Search_refresh"); @@ -273,7 +273,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Reserve_done_reserve-bottom"); $this->click("_qf_Reserve_done_reserve-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "Contact(s) have been reserved"); + $this->waitForText('crm-notification-container', "Contact(s) have been reserved"); // Release Respondents $this->openCiviPage("survey/search", "reset=1&op=release", "_qf_Search_refresh"); @@ -289,7 +289,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent("Go"); $this->clickLink("Go", "_qf_Release_done-bottom"); $this->clickLink("_qf_Release_done-bottom", 'access'); - $this->assertElementContainsText("crm-notification-container", "released"); + $this->waitForText('crm-notification-container', "released"); // check whether contact is available for reserving again $this->openCiviPage("survey/search", "reset=1&op=reserve", "_qf_Search_refresh"); @@ -359,7 +359,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->select('extends[0]', "value=Contact"); $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('_qf_Field_cancel-bottom'); - $this->assertElementContainsText("crm-notification-container", $customGroup); + $this->waitForText('crm-notification-container', $customGroup); // Add custom fields $field1 = "Checkbox $title"; @@ -387,7 +387,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->click('_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", $field1); + $this->waitForText('crm-notification-container', $field1); // Create a profile for survey $this->openCiviPage("admin/uf/group", "reset=1"); @@ -399,7 +399,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->type('title', $surveyProfile); $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('_qf_Field_cancel-bottom'); - $this->assertElementContainsText("crm-notification-container", $surveyProfile); + $this->waitForText('crm-notification-container', $surveyProfile); // Add fields to the profile // Phone ( Primary ) @@ -491,7 +491,7 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Reserve_done_reserve-bottom'); $this->clickLink('_qf_Reserve_done_reserve-bottom', 'access'); - $this->assertElementContainsText("crm-notification-container", "2"); + $this->waitForText('crm-notification-container', "2"); $this->openCiviPage("report/survey/detail", "reset=1", '_qf_SurveyDetails_submit'); diff --git a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php index 6b0f1599ab..6f069c3aaa 100644 --- a/tests/phpunit/WebTest/Case/ActivityToCaseTest.php +++ b/tests/phpunit/WebTest/Case/ActivityToCaseTest.php @@ -76,7 +76,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->clickLink('_qf_Case_upload-bottom', '_qf_CaseView_cancel-bottom'); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Case opened successfully."); $customGroupTitle = 'Custom_' . substr(sha1(rand()), 0, 7); $this->_testAddNewActivity($firstName, $subject, $customGroupTitle, $contactName); @@ -167,9 +167,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Activity '$subject' has been saved.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', $subject); // click through to the Activity view screen $this->waitForElementPresent("xpath=//div[@id='Activities']//table/tbody/tr[2]/td[9]"); @@ -244,7 +242,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Field_cancel-bottom'); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); // create a custom field - Integer Radio $this->click("data_type[0]"); @@ -280,7 +278,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); // create another custom field - text field $this->click("//a[@id='newCustomField']/span"); @@ -303,7 +301,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved."); $textFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$textFieldLabel']/../../td[8]/span/a[text()='Edit Field']/@href")); $textFieldId = $textFieldId[1]; diff --git a/tests/phpunit/WebTest/Case/AddCaseTest.php b/tests/phpunit/WebTest/Case/AddCaseTest.php index 8b8746e3a4..13350f1ff3 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTest.php @@ -98,7 +98,7 @@ class WebTest_Case_AddCaseTest extends CiviSeleniumTestCase { $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom"); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Case opened successfully.", "Save successful status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Case opened successfully."); $summaryStrings = array( "Case Summary", diff --git a/tests/phpunit/WebTest/Contact/AddTest.php b/tests/phpunit/WebTest/Contact/AddTest.php index 5116b0afc3..254e6f5327 100644 --- a/tests/phpunit/WebTest/Contact/AddTest.php +++ b/tests/phpunit/WebTest/Contact/AddTest.php @@ -164,7 +164,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); } function testHouseholdAdd() { @@ -268,7 +268,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); } function testOrganizationAdd() { @@ -367,7 +367,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); } function testIndividualAddWithSharedAddress() { @@ -428,9 +428,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Edit_next"); // Is new contact created? - $this->assertElementContainsText('crm-notification-container', "$currentEmployer has been created.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "$currentEmployer has been created."); //make sure shared address is selected $this->waitForElementPresent('selected_shared_address-1'); @@ -460,9 +458,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Edit_next"); // Is new contact created? - $this->assertElementContainsText('crm-notification-container', "$sharedHousehold has been created.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "$sharedHousehold has been created."); //make sure shared address is selected $this->waitForElementPresent('selected_shared_address-2'); @@ -471,7 +467,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); $name = $this->getText("xpath=//div[@class='crm-summary-display_name']"); - $this->assertElementContainsText('crm-notification-container', "$name has been created."); + $this->waitForText('crm-notification-container', "$name has been created."); //make sure current employer is set $this->verifyText("xpath=id('contactinfo-block')/div/div/div[2]/div", 'Employer'); diff --git a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php index 4d4b14722b..0f486cc8bf 100644 --- a/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php +++ b/tests/phpunit/WebTest/Contact/AdvanceSearchPrivacyOptionsTest.php @@ -199,7 +199,7 @@ class WebTest_Contact_AdvanceSearchPrivacyOptionsTest extends CiviSeleniumTestCa // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "{$firstName} {$lastName} has been created."); + $this->waitForText('crm-notification-container', "{$firstName} {$lastName} has been created."); } } diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php index b1e05f5398..ea89df791e 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchTest.php @@ -66,7 +66,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { // is status message correct? $this->waitForTextPresent("Saved"); - $this->assertElementContainsText('crm-notification-container', "Saved"); + $this->waitForText('crm-notification-container', "Saved"); // go to event tab and register for event ( auto add activity and contribution ) $this->click("css=li#tab_participant a"); @@ -84,7 +84,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->type("trxn_id", "trid$firstName"); $this->click("_qf_Participant_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Event registration for $firstName adv$firstName has been added"); + $this->waitForText('crm-notification-container', "Event registration for $firstName adv$firstName has been added"); // go to pledge tab and add pledge $this->click("css=li#tab_pledge a"); @@ -98,7 +98,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->click("_qf_Pledge_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); // go to Membership tab and add membership $this->click("css=li#tab_member a"); @@ -113,7 +113,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->click("_qf_Membership_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Student membership for $firstName adv$firstName has been added"); + $this->waitForText('crm-notification-container', "Student membership for $firstName adv$firstName has been added"); // go to relationship tab and add relationship $this->click("css=li#tab_rel a"); @@ -127,7 +127,7 @@ class WebTest_Contact_AdvancedSearchTest extends CiviSeleniumTestCase { $this->webtestFillDate("end_date", "+1 day"); $this->click("details-save"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "New relationship created."); + $this->waitForText('crm-notification-container', "New relationship created."); //-------------- advance search -------------- diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 50e58ffcbf..a780e84285 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -131,8 +131,8 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->click("_qf_AddToGroup_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added Contacts to ".$groupName); - $this->assertElementContainsText('crm-notification-container', '2 contacts added to group'); + $this->waitForText('crm-notification-container', "Added Contacts to ".$groupName); + $this->waitForText('crm-notification-container', '2 contacts added to group'); $this->_testSearchResult($relType); } @@ -178,7 +178,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes // Wait for "saved" status msg $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "'Location' information has been saved."); + $this->waitForText('crm-notification-container', "'Location' information has been saved."); } function _testAddFees($discount = FALSE, $priceSet = FALSE, $processorId) { @@ -250,7 +250,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->waitForElementPresent("current-relationships"); //check the status message - $this->assertElementContainsText('crm-notification-container', "New relationship created."); + $this->waitForText('crm-notification-container', "New relationship created."); $this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']"); $this->click("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php index fb219d8851..9929cecf2a 100644 --- a/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php +++ b/tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php @@ -63,7 +63,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase { $this->select('group_id', "label={$groupName}"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Individual 1 $contact2 = substr(sha1(rand()), 0, 7); @@ -92,7 +92,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Field_cancel-bottom"); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); $matches = array(); preg_match('/gid=([0-9]+)/', $this->getLocation(), $matches); @@ -112,7 +112,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$contactRefFieldLabel1' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$contactRefFieldLabel1' has been saved."); //add custom field - alphanumeric checkbox $contactRefFieldLabel2 = 'contact_ref_' . substr(sha1(rand()), 0, 4); @@ -131,7 +131,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$contactRefFieldLabel2' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$contactRefFieldLabel2' has been saved."); $this->openCiviPage('admin/custom/group/field', "reset=1&action=browse&gid={$customGroupId}"); diff --git a/tests/phpunit/WebTest/Contact/CustomDataAddTest.php b/tests/phpunit/WebTest/Contact/CustomDataAddTest.php index 7403bf6be9..073fc63973 100644 --- a/tests/phpunit/WebTest/Contact/CustomDataAddTest.php +++ b/tests/phpunit/WebTest/Contact/CustomDataAddTest.php @@ -49,7 +49,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Field_cancel-bottom"); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); //add custom field - alphanumeric checkbox $checkboxFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4); @@ -86,7 +86,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved."); //create another custom field - Integer Radio $this->click("//a[@id='newCustomField']/span"); @@ -128,7 +128,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$radioFieldLabel' has been saved."); // Go to the URL to create an Individual contact. $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -173,7 +173,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("_qf_Field_cancel-bottom"); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); //add custom field - money text $moneyTextFieldLabel = 'money' . substr(sha1(rand()), 0, 4); @@ -200,7 +200,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText('crm-notification-container', "Your custom field '$moneyTextFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$moneyTextFieldLabel' has been saved."); //Get the customFieldsetID $this->openCiviPage('admin/custom/group', 'reset=1'); @@ -256,7 +256,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->click("id=collapse_display"); $this->click("id=_qf_Group_next-bottom"); $this->waitForElementPresent('_qf_Field_next-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your custom field set '$customFieldSet' has been added."); + $this->waitForText('crm-notification-container', "Your custom field set '$customFieldSet' has been added."); // Add field to fieldset $customField = 'CustomField' . rand(); @@ -264,7 +264,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->select("id=data_type_0", "value=0"); $this->click("id=_qf_Field_next-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Your custom field '$customField' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$customField' has been saved."); $this->openCiviPage('contact/add', 'reset=1&ct=Individual'); @@ -311,7 +311,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "{$firstName} {$lastName} has been created."); + $this->waitForText('crm-notification-container', "{$firstName} {$lastName} has been created."); //Update the custom field $this->click("css=a.edit.button"); diff --git a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php index 5e43f93162..4ab45cb5fb 100644 --- a/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php +++ b/tests/phpunit/WebTest/Contact/DeceasedContactsAdvancedSearchTest.php @@ -73,7 +73,7 @@ class WebTest_Contact_DeceasedContactsAdvancedSearchTest extends CiviSeleniumTes $this->select('group_id', "label={$groupName}"); $this->click('_qf_RemoveFromGroup_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "2 contacts removed from '{$groupName}'"); + $this->waitForText('crm-notification-container', "2 contacts removed from '{$groupName}'"); // Search for the contacts who are not deceased $this->openCiviPage('contact/search/advanced', 'reset=1', '_qf_Advanced_refresh'); diff --git a/tests/phpunit/WebTest/Contact/DupeContactTest.php b/tests/phpunit/WebTest/Contact/DupeContactTest.php index 40c5627d1a..81560ef0db 100644 --- a/tests/phpunit/WebTest/Contact/DupeContactTest.php +++ b/tests/phpunit/WebTest/Contact/DupeContactTest.php @@ -62,7 +62,7 @@ class WebTest_Contact_DupeContactTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $this->openCiviPage('contact/add' , 'reset=1&ct=Individual'); diff --git a/tests/phpunit/WebTest/Contact/GroupAddTest.php b/tests/phpunit/WebTest/Contact/GroupAddTest.php index d65a98c267..eda91d4040 100644 --- a/tests/phpunit/WebTest/Contact/GroupAddTest.php +++ b/tests/phpunit/WebTest/Contact/GroupAddTest.php @@ -65,7 +65,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The Group '{$params['name']}' has been saved."); + $this->waitForText('crm-notification-container', "The Group '{$params['name']}' has been saved."); $this->openCiviPage('group', 'reset=1'); $this->type('title', $params['name']); diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 9ba0fb64a7..8826cecd2d 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -62,7 +62,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Add Contact to a group $group = 'Newsletter Subscribers'; @@ -71,7 +71,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select('group_id', "label=$group"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Add Tags to the contact $tag = 'Government Entity'; @@ -104,7 +104,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Add second pair of dupes so we can test Merge and Goto Next Pair $fname2 = 'Janet'; @@ -122,7 +122,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Find and Merge Contacts with Supervised Rule $this->openCiviPage("contact/dedupefind", "reset=1&rgid=1&action=renew"); @@ -301,7 +301,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // contact2: duplicate of contact1. $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -325,7 +325,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Find and Merge Contacts with Supervised Rule $this->openCiviPage("contact/dedupefind", "reset=1&rgid=1&action=renew"); @@ -390,7 +390,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // contact2: duplicate of contact1. $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -414,7 +414,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Find and Merge Contacts with Supervised Rule $this->openCiviPage("contact/dedupefind", "reset=1&rgid=1&action=renew"); @@ -496,7 +496,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { //Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); //duplicate of contact2. $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -523,7 +523,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // add contact3 and its duplicate //fill in first name @@ -554,7 +554,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->chooseOkOnNextConfirmation(); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForElementPresent('civicrm-footer'); - $this->assertElementContainsText('crm-notification-container', "safe mode"); + $this->waitForText('crm-notification-container', "safe mode"); // If we are still on the dedupe table page, count unmerged contacts if ($this->isElementPresent("//table[@class='pagerDisplay']")) { @@ -611,7 +611,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); //duplicate of above contact. $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -632,7 +632,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent("One matching contact was found. You can View or Edit the existing contact.")); $this->click("_qf_Contact_upload_duplicate"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); } } diff --git a/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php b/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php index 60f471f88e..0f727a945c 100644 --- a/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php +++ b/tests/phpunit/WebTest/Contact/MultipleContactSubTypes.php @@ -167,7 +167,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //checking the contact sub-type of newly created individual - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $this->assertElementContainsText('css=.crm-contact_type_label', "Student"); $this->assertElementContainsText('css=.crm-contact_type_label', "Parent"); @@ -202,7 +202,7 @@ class WebTest_Contact_MultipleContactSubTypes extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Verify contact types - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $this->assertElementNotContainsText('css=.crm-contact_type_label', "Student"); $this->assertElementContainsText('css=.crm-contact_type_label', "Staff"); $this->assertElementContainsText('css=.crm-contact_type_label', "Parent"); diff --git a/tests/phpunit/WebTest/Contact/PrevNextTest.php b/tests/phpunit/WebTest/Contact/PrevNextTest.php index cc4fef680e..3767c37b9b 100644 --- a/tests/phpunit/WebTest/Contact/PrevNextTest.php +++ b/tests/phpunit/WebTest/Contact/PrevNextTest.php @@ -63,7 +63,7 @@ class WebTest_Contact_PrevNextTest extends CiviSeleniumTestCase { $this->select('group_id', "label={$groupName}"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Individual 2 $contact2 = substr(sha1(rand()), 0, 7); @@ -75,7 +75,7 @@ class WebTest_Contact_PrevNextTest extends CiviSeleniumTestCase { $this->select('group_id', "label={$groupName}"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Individual 3 $contact3 = substr(sha1(rand()), 0, 7); @@ -87,7 +87,7 @@ class WebTest_Contact_PrevNextTest extends CiviSeleniumTestCase { $this->select('group_id', "label={$groupName}"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Search contacts $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); diff --git a/tests/phpunit/WebTest/Contact/SignatureTest.php b/tests/phpunit/WebTest/Contact/SignatureTest.php index 4abf33fb59..f0704b70b2 100644 --- a/tests/phpunit/WebTest/Contact/SignatureTest.php +++ b/tests/phpunit/WebTest/Contact/SignatureTest.php @@ -63,7 +63,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); // Go for Ckeck Your Editor, Click on Send Mail $this->click("//a[@id='crm-contact-actions-link']/span"); @@ -119,7 +119,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText("crm-notification-container", "{$name} has been updated."); + $this->waitForText('crm-notification-container', "{$name} has been updated."); // Go for Ckeck Your Editor, Click on Send Mail $this->click("//a[@id='crm-contact-actions-link']/span"); diff --git a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php index f02bf56b7b..3ea97bbb7c 100644 --- a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php +++ b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php @@ -154,7 +154,7 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The tag '$tagSetName' has been saved."); + $this->waitForText('crm-notification-container', "The tag '$tagSetName' has been saved."); // sort by ID desc $this->click("xpath=//table//tr/th[text()=\"ID\"]"); diff --git a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php index 372f9e56d8..7f744157fa 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php +++ b/tests/phpunit/WebTest/Contact/TaskActionAddToGroupTest.php @@ -83,8 +83,8 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Check status messages are as expected - $this->assertElementContainsText('crm-notification-container', "Added Contacts to {$newGroupName}"); - $this->assertElementContainsText('crm-notification-container', "2 contacts added to group"); + $this->waitForText('crm-notification-container', "Added Contacts to {$newGroupName}"); + $this->waitForText('crm-notification-container', "2 contacts added to group"); // Search by group membership in newly created group $this->openCiviPage('contact/search/advanced', 'reset=1'); @@ -130,8 +130,8 @@ class WebTest_Contact_TaskActionAddToGroupTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Check status messages are as expected - $this->assertElementContainsText('crm-notification-container', "Added Contacts to {$newGroupName}"); - $this->assertElementContainsText('crm-notification-container', "50 contacts added to group"); + $this->waitForText('crm-notification-container', "Added Contacts to {$newGroupName}"); + $this->waitForText('crm-notification-container', "50 contacts added to group"); $this->openCiviPage('contact/search/advanced', 'reset=1'); $this->select("crmasmSelect1", "label=" . $newGroupName); diff --git a/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php b/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php index 6881b08a4d..f37765e3cc 100644 --- a/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php +++ b/tests/phpunit/WebTest/Contact/TaskActionSendSMS.php @@ -61,14 +61,14 @@ class WebTest_Contact_TaskActionSendSMS extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $this->click('css=li#tab_group a'); $this->waitForElementPresent('_qf_GroupContact_next'); $this->select('group_id', "label=$smsGroupName"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // ADD contact2 $this->openCiviPage("contact/add", "reset=1&ct=Individual"); @@ -85,14 +85,14 @@ class WebTest_Contact_TaskActionSendSMS extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $this->click('css=li#tab_group a'); $this->waitForElementPresent('_qf_GroupContact_next'); $this->select('group_id', "label=$smsGroupName"); $this->click('_qf_GroupContact_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Added to Group"); + $this->waitForText('crm-notification-container', "Added to Group"); // Do an advanced search $this->click("css=ul#civicrm-menu li.crm-Search"); diff --git a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php index 2ad020aecd..46b1fbe7a5 100644 --- a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php @@ -147,7 +147,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { // Clicking save. $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer'); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved"); + $this->waitForText('crm-notification-container', "The contribution record has been saved"); $this->waitForElementPresent("xpath=//div[@id='Contributions']//table/tbody/tr/td[8]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php index 05f2a0e8c6..a7a42b2fde 100644 --- a/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php +++ b/tests/phpunit/WebTest/Contribute/OnBehalfOfOrganization.php @@ -1369,7 +1369,7 @@ class WebTest_Contribute_OnBehalfOfOrganization extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click('_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Selected Profile Field has been deleted."); + $this->waitForText('crm-notification-container', "Selected Profile Field has been deleted."); } function _testOrganizationWithImageUpload($pageId, $cid, $pageTitle) { diff --git a/tests/phpunit/WebTest/Event/AddEventTest.php b/tests/phpunit/WebTest/Event/AddEventTest.php index 49e5af62fd..00108118ba 100644 --- a/tests/phpunit/WebTest/Event/AddEventTest.php +++ b/tests/phpunit/WebTest/Event/AddEventTest.php @@ -451,7 +451,7 @@ class WebTest_Event_AddEventTest extends CiviSeleniumTestCase { // Wait for "saved" status msg $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText("crm-notification-container", "'Fee' information has been saved"); + $this->waitForText('crm-notification-container', "'Fee' information has been saved"); return array($discount1, $discount2); } diff --git a/tests/phpunit/WebTest/Event/AddParticipationTest.php b/tests/phpunit/WebTest/Event/AddParticipationTest.php index cd96620877..792de9a2d7 100644 --- a/tests/phpunit/WebTest/Event/AddParticipationTest.php +++ b/tests/phpunit/WebTest/Event/AddParticipationTest.php @@ -89,7 +89,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Event registration for $displayName has been added"); $this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen @@ -158,7 +158,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom group created? - $this->assertElementContainsText("crm-notification-container", "Your custom field set '$customGroupTitle' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now."); //add custom field - alphanumeric checkbox $checkboxFieldLabel = 'custom_field' . substr(sha1(rand()), 0, 4); @@ -195,7 +195,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created? - $this->assertElementContainsText("crm-notification-container", "Your custom field '$checkboxFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$checkboxFieldLabel' has been saved."); //create another custom field - Integer Radio $this->click("//a[@id='newCustomField']/span"); @@ -286,7 +286,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText("crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Event registration for $displayName has been added"); $this->waitForElementPresent("xpath=//div[@id='Events']//table//tbody/tr[1]/td[8]/span/a[text()='View']"); //click through to the participant view screen diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index 6f17c4f2f3..34173855a7 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -325,6 +325,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The Group '$groupName' has been saved."); + $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved."); } } diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php index 76a55d9853..d7af5d4854 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php @@ -112,27 +112,21 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { $this->click('_qf_FinancialTypeAccount_next_new'); $this->waitForPageToLoad($this->getTimeoutMsec()); $text = 'The financial type Account has been saved.'; - $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); - $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); + $this->waitForText('crm-notification-container', $text); $text = 'You can add another Financial Account Type.'; - $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); - $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); + $this->waitForText('crm-notification-container', $text); $accountRelationship = 'Expense Account is'; $expected[] = array( - 'financial_account' => 'Banking Fees', - 'account_relationship' => $accountRelationship - ); $this->select('account_relationship', "label={$accountRelationship}"); $this->select('financial_account_id', "label=Banking Fees"); $this->click('_qf_FinancialTypeAccount_next'); - $this->waitForElementPresent( 'newfinancialTypeAccount'); + $this->waitForElementPresent('newfinancialTypeAccount'); $text = 'The financial type Account has been saved.'; - $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); - $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); + $this->waitForText('crm-notification-container', $text); foreach ($expected as $value => $label) { $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$label[financial_account]']/../td[2]", preg_quote($label['account_relationship'])); @@ -156,7 +150,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { $this->clickLink("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='Accounts Receivable']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom'); $this->click('_qf_FinancialTypeAccount_next-botttom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', 'Selected financial type account has been deleted.', 'Missing text: ' . 'Selected financial type account has been deleted.'); + $this->waitForText('crm-notification-container', 'Selected financial type account has been deleted.'); //edit financial type $financialType['oldname'] = $financialType['name']; diff --git a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php index 9e30f38f42..fbb602d29a 100644 --- a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php +++ b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php @@ -56,7 +56,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $this->type('id=label', $grantType); $this->click('id=_qf_Options_next-top'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "The Grant Type '$grantType' has been saved."); + $this->waitForText('crm-notification-container', "The Grant Type '$grantType' has been saved."); // Create new Custom Field Set that extends the grant type $this->openCiviPage('admin/custom/group', 'reset=1'); @@ -69,7 +69,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $this->click('id=collapse_display'); $this->click('id=_qf_Group_next-bottom'); $this->waitForElementPresent('_qf_Field_next-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your custom field set '$grantFieldSet' has been added."); + $this->waitForText('crm-notification-container', "Your custom field set '$grantFieldSet' has been added."); // Add field to fieldset $grantField = 'GrantField' . $rand; @@ -77,7 +77,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $this->select('id=data_type_0', 'label=Money'); $this->click('id=_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Your custom field '$grantField' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$grantField' has been saved."); // Create new Grant $this->openCiviPage('grant/add', 'reset=1&action=add&context=standalone', '_qf_Grant_upload-bottom'); diff --git a/tests/phpunit/WebTest/Import/AddressImportTest.php b/tests/phpunit/WebTest/Import/AddressImportTest.php index 1489cff4cf..92d089649f 100644 --- a/tests/phpunit/WebTest/Import/AddressImportTest.php +++ b/tests/phpunit/WebTest/Import/AddressImportTest.php @@ -118,7 +118,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->waitForElementPresent('_qf_Field_cancel-bottom'); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); $url = explode('gid=', $this->getLocation()); $gid = $url[1]; @@ -130,7 +130,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container',"Your custom field '{$customField}' has been saved."); + $this->waitForText('crm-notification-container',"Your custom field '{$customField}' has been saved."); $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField']/../../td[8]/span/a@href")); $customFieldId = $customFieldId[1]; @@ -144,7 +144,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { // clicking save $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container', "Your custom field '{$customField1}' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '{$customField1}' has been saved."); $customFieldId1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField1']/../../td[8]/span/a@href")); $customFieldId1 = $customFieldId1[1]; @@ -158,7 +158,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { // clicking save $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container', "Your custom field '{$customField2}' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '{$customField2}' has been saved."); $customFieldId2 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField2']/../../td[8]/span/a@href")); $customFieldId2 = $customFieldId2[1]; @@ -208,7 +208,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { // clicking save $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container', "Your custom field '{$customField9}' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '{$customField9}' has been saved."); $customFieldId9 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField9']/../../td[8]/span/a@href")); $customFieldId9 = $customFieldId9[1]; @@ -223,7 +223,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { // clicking save $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container', "Your custom field '{$customField10}' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '{$customField10}' has been saved."); $customFieldId10 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customField10']/../../td[8]/span/a@href")); $customFieldId10 = $customFieldId10[1]; @@ -283,7 +283,7 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase { // clicking save $this->click('_qf_Field_next-bottom'); $this->waitForElementPresent('newCustomField'); - $this->assertElementContainsText('crm-notification-container', "Your custom field '{$customFieldName}' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '{$customFieldName}' has been saved."); $customFieldId = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr/td/span[text()='$customFieldName']/../../td[8]/span/a@href")); $customFieldId = $customFieldId[1]; return $customFieldId; diff --git a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php index 7e3acb9537..9039233947 100644 --- a/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php +++ b/tests/phpunit/WebTest/Import/DuplicateMatchingTest.php @@ -55,7 +55,7 @@ class WebTest_Import_DuplicateMatchingTest extends ImportCiviSeleniumTestCase { // Clicking save. $this->click('_qf_Contact_upload_view'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); $existingContact = array( 'first_name' => $firstName, diff --git a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php index a462daef32..3f0d105f4e 100644 --- a/tests/phpunit/WebTest/Import/MatchExternalIdTest.php +++ b/tests/phpunit/WebTest/Import/MatchExternalIdTest.php @@ -244,7 +244,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Contact Saved"); + $this->waitForText('crm-notification-container', "Contact Saved"); return $externalId; } @@ -335,7 +335,7 @@ class WebTest_Import_MatchExternalIdTest extends ImportCiviSeleniumTestCase { $this->click("_qf_Registration_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Saved"); + $this->waitForText('crm-notification-container', "Saved"); // verify event input on info page // start at Manage Events listing diff --git a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php index 30db0e4f6c..02282de0df 100644 --- a/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php +++ b/tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php @@ -83,7 +83,7 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct - $this->assertElementContainsText('crm-notification-container', "The Message Template '$msgTitle' has been saved."); + $this->waitForText('crm-notification-container', "The Message Template '$msgTitle' has been saved."); // Verify text. $this->assertTrue($this->isElementPresent("xpath=id('user')/div[2]/div/table/tbody//tr/td[1][contains(text(), '$msgTitle')]"), diff --git a/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php b/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php index 5de23b0fff..9c1c3ec857 100644 --- a/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php +++ b/tests/phpunit/WebTest/Mailing/AddNewMailingComponentTest.php @@ -62,7 +62,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct. - $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved."); + $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved."); // Verify text. $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Header']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details"); @@ -99,7 +99,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct. - $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved."); + $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved."); // Verify text. $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Footer']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details"); @@ -136,7 +136,7 @@ class WebTest_Mailing_AddNewMailingComponentTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct. - $this->assertElementContainsText('crm-notification-container', "The mailing component '$componentName' has been saved."); + $this->waitForText('crm-notification-container', "The mailing component '$componentName' has been saved."); // Verify text $this->assertTrue($this->isElementPresent("xpath=//table/tbody//tr/td[text()='{$componentName}']/../td[2][text()='Reply']/../td[3][text()='{$subject}']/../td[4][text()='{$txtMsg}']/../td[5][text()='{$htmlMsg}']"), "The row doesn't consists of proper component details"); diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index c3edaa3fa1..8e15984fc7 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -58,7 +58,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The Group '$groupName' has been saved."); + $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved."); //---- create mailing contact and add to mailing Group $firstName = substr(sha1(rand()), 0, 7); @@ -323,7 +323,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "The Group '$groupName' has been saved."); + $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved."); //---- create mailing contact and add to mailing Group $firstName = substr(sha1(rand()), 0, 7); diff --git a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php index 33dc8ab485..1bb3a24989 100644 --- a/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php +++ b/tests/phpunit/WebTest/Member/BatchUpdateViaProfileTest.php @@ -50,8 +50,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { // Add membership for this individual $this->_addMembership($memTypeParams); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "membership for $firstName1 $lastName has been added.", - "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "membership for $firstName1 $lastName has been added"); // click through to the membership view screen $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']"); @@ -75,8 +74,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->_addMembership($memTypeParams); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "membership for $firstName2 $lastName has been added.", - "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "membership for $firstName2 $lastName has been added."); // click through to the membership view screen $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']"); @@ -196,7 +194,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('_qf_Field_cancel-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); $this->select('field_name[0]', "value=Membership"); $this->select('field_name[1]', "label={$customDataParams[0]} :: {$customDataParams[1]}"); @@ -206,7 +204,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { // Clicking save and new $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[0]}' has been saved to '{$profileTitle}'."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[0]}' has been saved to '{$profileTitle}'."); // Add membership status field to profile - CRM-8618 $this->select('field_name[0]', "value=Membership"); @@ -216,7 +214,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { // Clicking save $this->click('_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field 'Membership Status' has been saved to '{$profileTitle}'."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Membership Status' has been saved to '{$profileTitle}'."); } function _addCustomData() { @@ -240,7 +238,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Field_cancel-bottom'); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); $textFieldLabel = 'Custom Field Text_' . substr(sha1(rand()), 0, 4); $this->type('label', $textFieldLabel); @@ -259,7 +257,7 @@ class WebTest_Member_BatchUpdateViaProfileTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$textFieldLabel' has been saved."); return array($textFieldLabel, $customGroupTitle); } diff --git a/tests/phpunit/WebTest/Member/ContactContextAddTest.php b/tests/phpunit/WebTest/Member/ContactContextAddTest.php index e8cebc0b46..c080dabce1 100644 --- a/tests/phpunit/WebTest/Member/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Member/ContactContextAddTest.php @@ -56,7 +56,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "$firstName $lastName has been created."); + $this->waitForText('crm-notification-container', "$firstName $lastName"); // click through to the membership view screen $this->click("css=li#tab_member a"); @@ -93,8 +93,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "membership for $firstName $lastName has been added.", - "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "membership for $firstName $lastName has been added."); // click through to the membership view screen $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']"); @@ -180,7 +179,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { // Clicking save. $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "$firstName $lastName has been created."); + $this->waitForText('crm-notification-container', "$firstName $lastName has been created."); // click through to the membership view screen $this->click("css=li#tab_member a"); @@ -218,8 +217,7 @@ class WebTest_Member_ContactContextAddTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "membership for $firstName $lastName has been added.", - "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "membership for $firstName $lastName has been added."); // click through to the membership view screen $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php index 497bf2b16e..91f7cb39a2 100644 --- a/tests/phpunit/WebTest/Member/InheritedMembershipTest.php +++ b/tests/phpunit/WebTest/Member/InheritedMembershipTest.php @@ -41,7 +41,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->type('email_1_email', "$title@org.com"); $this->click('_qf_Contact_upload_view'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Organization {$title} has been created."); + $this->waitForText('crm-notification-container', "Organization {$title} has been created."); $this->openCiviPage('admin/member/membershipType', 'reset=1&action=browse'); @@ -69,7 +69,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->click('_qf_MembershipType_upload-bottom'); $this->waitForElementPresent('link=Add Membership Type'); - $this->assertElementContainsText('crm-notification-container', "The membership type 'Membership Type $title' has been saved."); + $this->waitForText('crm-notification-container', "Membership Type $title"); $this->openCiviPage('contact/add', 'reset=1&ct=Organization', '_qf_Contact_cancel'); @@ -104,8 +104,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "Membership Type $title membership for Organization $title1 has been added.", - "Status message didn't show up after saving!"); + $this->waitForText('crm-notification-container', "Membership Type $title"); // click through to the membership view screen $this->click("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]/span/a[text()='View']"); @@ -156,7 +155,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->click('quick-save'); $this->waitForElementPresent('current-relationships'); //check the status message - $this->assertElementContainsText('crm-notification-container', 'New relationship created.'); + $this->waitForText('crm-notification-container', 'New relationship created'); $this->waitForElementPresent("xpath=//div[@id='current-relationships']//div//table/tbody//tr/td[9]/span/a[text()='View']"); @@ -200,7 +199,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->click('_qf_Relationship_upload'); $this->waitForElementPresent('inactive-relationships'); //check the status message - $this->assertElementContainsText('crm-notification-container', 'Relationship record has been updated.'); + $this->waitForText('crm-notification-container', 'Relationship record has been updated'); // click through to the membership view screen $this->click('css=li#tab_member a'); @@ -223,7 +222,7 @@ class WebTest_Member_InheritedMembershipTest extends CiviSeleniumTestCase { $this->click('_qf_Relationship_upload'); $this->waitForElementPresent('current-relationships'); //check the status message - $this->assertElementContainsText('crm-notification-container', 'Relationship record has been updated.'); + $this->waitForText('crm-notification-container', 'Relationship record has been updated.'); //check for memberships $this->click('css=li#tab_member a'); diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php index 68d6dc11bf..4a28ad2c5b 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipAddPricesetTest.php @@ -143,7 +143,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->waitForElementPresent('_qf_Field_next-bottom'); $this->click('_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved."); + $this->waitForText('crm-notification-container', "Price Field '{$fields[0]}' has been saved."); // load the Price Set Preview and check for expected values $this->_testVerifyPriceSet($validateStrings, $sid); @@ -186,7 +186,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->click('_qf_Set_next-bottom'); $this->waitForElementPresent('_qf_Field_next-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); + $this->waitForText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); } function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { @@ -246,7 +246,7 @@ class WebTest_Member_OfflineMembershipAddPricesetTest extends CiviSeleniumTestCa $this->select("financial_type_id", "label={$contributionType}"); $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Price Field '{$label}' has been saved."); + $this->waitForText('crm-notification-container', "Price Field '{$label}' has been saved."); } return array($memTypeTitle1, $memTypeTitle2); } diff --git a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php index 215339d8b7..b38da54b4f 100644 --- a/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php +++ b/tests/phpunit/WebTest/Member/OfflineMembershipRenewTest.php @@ -78,9 +78,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); $this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); @@ -185,9 +183,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); $this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); @@ -275,9 +271,7 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); $this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[7]/span[2][text()='more']/ul/li/a[text()='Renew']"); @@ -387,12 +381,8 @@ class WebTest_Member_OfflineMembershipRenewTest extends CiviSeleniumTestCase { $this->waitForTextPresent($sourceText); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added.", - "Status message didn't show up after saving!" - ); - $this->assertElementContainsText('crm-notification-container', "A membership confirmation and receipt has been sent to {$firstName}@memberson.com.", - "Email sent to member message didn't show up after saving membership!" - ); + $this->waitForText('crm-notification-container', "{$membershipTypes['membership_type']} membership for $firstName Memberson has been added."); + $this->waitForText('crm-notification-container', "A membership confirmation and receipt has been sent to {$firstName}@memberson.com."); $this->waitForElementPresent("xpath=//div[@id='Memberships']//table/tbody/tr/td[9]/span[2][text()='more']/ul/li/a[text()='Renew']"); diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php index 91985d7dc1..675c5e5436 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipAddPricesetTest.php @@ -157,7 +157,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas $this->waitForElementPresent('_qf_Field_next-bottom'); $this->click('_qf_Field_next-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Price Field '{$fields[0]}' has been saved."); + $this->waitForText('crm-notification-container', "Price Field '{$fields[0]}' has been saved."); // load the Price Set Preview and check for expected values $this->_testVerifyPriceSet($validateStrings, $sid); @@ -206,7 +206,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.'); $this->clickLink('_qf_Set_next-bottom', '_qf_Field_next-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); + $this->waitForText('crm-notification-container', "Your Set '{$setTitle}' has been added. You can add fields to this set now."); } function _testAddPriceFields(&$fields, &$validateString, $dateSpecificFields = FALSE, $title, $sid, $contributionType) { @@ -264,7 +264,7 @@ class WebTest_Member_OnlineMembershipAddPricesetTest extends CiviSeleniumTestCas } $this->select("financial_type_id", "label={$contributionType}"); $this->clickLink('_qf_Field_next_new-bottom', '_qf_Field_next-bottom'); - $this->assertElementContainsText('crm-notification-container', "Price Field '{$label}' has been saved."); + $this->waitForText('crm-notification-container', "Price Field '{$label}' has been saved."); } return array($memTypeTitle1, $memTypeTitle2); } diff --git a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php index 04033dfdb9..708aea32e6 100644 --- a/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php +++ b/tests/phpunit/WebTest/Member/OnlineMembershipCreateTest.php @@ -104,7 +104,7 @@ class WebTest_Member_OnlineMembershipCreateTest extends CiviSeleniumTestCase { $this->click("membership_type_$memTypeId2"); $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom'); $text = "'MembershipBlock' information has been saved."; - $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); + $this->waitForText('crm-notification-container', $text); //logout $this->webtestLogout(); diff --git a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php index c50d944bd3..3960a2d76f 100644 --- a/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php +++ b/tests/phpunit/WebTest/Member/SeperateMembershipPaymentTest.php @@ -41,7 +41,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase $firstName1 = 'Ma_' . substr(sha1(rand()), 0, 7); $lastName1 = 'An_' . substr(sha1(rand()), 0, 7); $this->webtestAddContact($firstName1, $lastName1, TRUE); - $this->assertElementContainsText('crm-notification-container', "$firstName1 $lastName1 has been created."); + $this->waitForText('crm-notification-container', "$firstName1 $lastName1 has been created."); $url = explode('&cid=', $this->getLocation()); $cid = $url[1]; @@ -103,7 +103,7 @@ class WebTest_Member_SeperateMembershipPaymentTest extends CiviSeleniumTestCase $this->click("membership_type_$memTypeId2"); $this->clickLink('_qf_MembershipBlock_next', '_qf_MembershipBlock_next-bottom'); $text = "'MembershipBlock' information has been saved."; - $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); + $this->waitForText('crm-notification-container', $text); $this->_testOnlineMembershipSignup($pageId, $memTypeTitle1, $cid); //Find Member diff --git a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php index 48fa5ca90d..ff50a9723a 100644 --- a/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php +++ b/tests/phpunit/WebTest/Member/UpdateMembershipScriptTest.php @@ -63,9 +63,7 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); // Is status message correct? - $this->assertElementContainsText('crm-notification-container', "{$memTypeParams['membership_type']} membership for $firstName Anderson has been added.", - "Status message didn't show up after saving!" - ); + $this->waitForText('crm-notification-container', "{$memTypeParams['membership_type']} membership for $firstName Anderson has been added."); // click through to the membership view screen $this->waitForElementPresent("xpath=//div[@id='memberships']//table//tbody/tr[1]/td[9]"); @@ -123,7 +121,7 @@ class WebTest_Member_UpdateMembershipScriptTest extends CiviSeleniumTestCase { // Clicking save $this->click('_qf_MembershipType_upload-bottom'); $this->waitForElementPresent('link=Add Membership Type'); - $this->assertElementContainsText('crm-notification-container', "The membership type '$title' has been saved."); + $this->waitForText('crm-notification-container', "The membership type '$title' has been saved."); return $memTypeParams; } diff --git a/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php index 05cbb4663e..5fa74f4d5b 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextAddTest.php @@ -91,7 +91,7 @@ class WebTest_Pledge_ContactContextAddTest extends CiviSeleniumTestCase { $this->click("_qf_Pledge_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span[1]/a[text()='View']"); //click through to the Pledge view screen diff --git a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php index b422067387..cce6a3fe00 100644 --- a/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php +++ b/tests/phpunit/WebTest/Pledge/ContactContextPledgePaymentAddTest.php @@ -98,7 +98,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->click("_qf_Pledge_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); //click through to the Pledge view screen @@ -272,7 +272,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->click("_qf_Pledge_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); //click through to the Pledge view screen @@ -430,7 +430,7 @@ class WebTest_Pledge_ContactContextPledgePaymentAddTest extends CiviSeleniumTest $this->click("_qf_Pledge_upload-bottom"); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); //Add payments $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php index acb45eb0f1..95f2a8aeda 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php @@ -50,7 +50,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $this->click('_qf_Pledge_upload-bottom'); $this->waitForPageToLoad("30000"); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); // verify if Pledge is created $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); @@ -80,7 +80,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $this->click('_qf_Contribution_upload-bottom'); $this->waitForPageToLoad("30000"); - $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved."); + $this->waitForText('crm-notification-container', "The contribution record has been saved."); $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a"); @@ -91,7 +91,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $this->type('total_amount', '250.00'); $this->click('_qf_Contribution_upload-bottom'); $this->waitForPageToLoad("30000"); - $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved."); + $this->waitForText('crm-notification-container', "The contribution record has been saved."); $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->click("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[1]/span/a"); @@ -103,7 +103,7 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $this->type('total_amount', '170.00'); $this->click('_qf_Contribution_upload-bottom'); $this->waitForPageToLoad("30000"); - $this->assertElementContainsText('crm-notification-container', "The contribution record has been saved."); + $this->waitForText('crm-notification-container', "The contribution record has been saved."); // delete the contribution associated with the 2nd payment $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php index 7fd52c2d1d..f592222ef8 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddTest.php @@ -73,7 +73,7 @@ class WebTest_Pledge_StandaloneAddTest extends CiviSeleniumTestCase { $this->click('_qf_Pledge_upload-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); + $this->waitForText('crm-notification-container', "Pledge has been recorded and the payment schedule has been created."); // verify if Pledge is created $this->waitForElementPresent("xpath=//div[@id='Pledges']//table//tbody/tr[1]/td[10]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index e152e53a7e..a39d7610e2 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -562,7 +562,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('_qf_Field_cancel-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); foreach ($customDataArr as $key => $customDataParams) { $this->select('field_name[0]', "label={$profileFor}"); @@ -573,7 +573,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { // Clicking save and new $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[1]}' has been saved to '{$profileTitle}'."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[1]}' has been saved to '{$profileTitle}'."); } } @@ -602,7 +602,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Field_cancel-bottom'); //Is custom group created? - $this->assertElementContainsText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); + $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); //for checkbox 1 $checkLabel1 = 'Custom Check One Text_' . substr(sha1(rand()), 0, 4); @@ -631,7 +631,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkLabel1' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$checkLabel1' has been saved."); $returnArray[1] = array($customGroupTitle, $checkLabel1); // create another custom field - Integer Radio @@ -662,7 +662,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$checkLabel2' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$checkLabel2' has been saved."); $returnArray[2] = array($customGroupTitle, $checkLabel2); // create another custom field - Integer Radio @@ -691,7 +691,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$dateFieldLabel' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$dateFieldLabel' has been saved."); $returnArray[3] = array($customGroupTitle, $dateFieldLabel); // create another custom field - Integer Radio @@ -710,7 +710,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$richTextField' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$richTextField' has been saved."); $returnArray[4] = array($customGroupTitle, $richTextField); // create another custom field - Integer Radio @@ -773,7 +773,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //Is custom field created - $this->assertElementContainsText('crm-notification-container', "Your custom field '$radioLabel2' has been saved."); + $this->waitForText('crm-notification-container', "Your custom field '$radioLabel2' has been saved."); $returnArray[6] = array($customGroupTitle, $radioLabel2); return $returnArray; diff --git a/tests/phpunit/WebTest/Profile/DedupeTest.php b/tests/phpunit/WebTest/Profile/DedupeTest.php index aa1308d303..982389a3b5 100644 --- a/tests/phpunit/WebTest/Profile/DedupeTest.php +++ b/tests/phpunit/WebTest/Profile/DedupeTest.php @@ -57,7 +57,7 @@ class WebTest_Profile_DedupeTest extends CiviSeleniumTestCase { $this->click("_qf_Contact_upload_view"); $this->waitForPageToLoad($this->getTimeoutMsec()); $individualName = $this->getText("xpath=//div[@class='crm-summary-display_name']"); - $this->assertElementContainsText('crm-notification-container', "$individualName has been created."); + $this->waitForText('crm-notification-container', "$individualName has been created."); // submit dupe using profile/create as anonymous $this->openCiviPage('profile/create', 'gid=4&reset=1', '_qf_Edit_next'); diff --git a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php index c7e1de430e..0f9cc89099 100644 --- a/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/MultiRecordProfileAddTest.php @@ -101,7 +101,7 @@ class WebTest_Profile_MultiRecordProfileAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //check for profile create - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); //Add field to profile $this->waitForElementPresent('field_name[0]'); diff --git a/tests/phpunit/WebTest/Profile/ProfileAddTest.php b/tests/phpunit/WebTest/Profile/ProfileAddTest.php index c565b62b62..a886b48f77 100644 --- a/tests/phpunit/WebTest/Profile/ProfileAddTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileAddTest.php @@ -99,7 +99,7 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //check for profile create - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); //Add field to profile $this->click('field_name[0]'); @@ -125,6 +125,6 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_Group_next-bottom'); $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('newCiviCRMProfile-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted."); } } diff --git a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php index efd3027693..e6020d0a44 100644 --- a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php @@ -68,7 +68,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase $this->waitForPageToLoad($this->getTimeoutMsec()); //check for profile create - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); //Add email field to profile $this->click('field_name[0]'); @@ -133,7 +133,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase $this->waitForElementPresent('_qf_Group_next-bottom'); $this->click('_qf_Group_next-bottom'); $this->waitForElementPresent('newCiviCRMProfile-bottom'); - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been deleted."); } } diff --git a/tests/phpunit/WebTest/Profile/SearchTest.php b/tests/phpunit/WebTest/Profile/SearchTest.php index 7c11c7dfc7..e22c193173 100644 --- a/tests/phpunit/WebTest/Profile/SearchTest.php +++ b/tests/phpunit/WebTest/Profile/SearchTest.php @@ -50,7 +50,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->waitForPageToLoad($this->getTimeoutMsec()); //check for profile create - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); // Get profile id (gid) from URL $elements = $this->parseURL(); @@ -70,8 +70,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); //check for field add - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field 'Last Name' has been saved to '$profileTitle'."); - $this->assertElementContainsText('crm-notification-container', 'You can add another profile field.'); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Last Name' has been saved to '$profileTitle'."); + $this->waitForText('crm-notification-container', 'You can add another profile field.'); // Add Email field. $this->click('field_name[0]'); @@ -87,8 +87,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->click('_qf_Field_next_new-bottom'); $this->waitForPageToLoad($this->getTimeoutMsec()); //check for field add - $this->assertElementContainsText('crm-notification-container', "Your CiviCRM Profile Field 'Email' has been saved to '$profileTitle'."); - $this->assertElementContainsText('crm-notification-container', 'You can add another profile field.'); + $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Email' has been saved to '$profileTitle'."); + $this->waitForText('crm-notification-container', 'You can add another profile field.'); // Add Sample Custom Field. $this->click('field_name[0]'); @@ -153,7 +153,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase { $this->assertTrue($this->isElementPresent("visibility"), 'Visibility field not present when editing existing profile field.'); $this->click("xpath=//tr[@id='profile_visibility']/td[1]/a"); $this->waitForElementPresent("xpath=//div[@id='crm-notification-container']/div/div[2]/p[2]"); - $this->assertElementContainsText('crm-notification-container', 'Is this field hidden from other users'); + $this->waitForText('crm-notification-container', 'Is this field hidden from other users'); $this->select('visibility', 'value=Public Pages and Listings'); } } -- 2.25.1