X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FProfile%2FProfileGroupSubscriptionTest.php;h=4667ed98723a0cbaecb0969577e235e7164ef13c;hb=e9479dcf93594b6338697ce76ab490b753c7de45;hp=6b10ca9f66c9b4b08c533ad4289b7f0e7b71dd3d;hpb=dfd4dbfd63915f725f0ba5cd194f0d87d4e05cc6;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php index 6b10ca9f66..4667ed9872 100644 --- a/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php +++ b/tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php @@ -1,9 +1,9 @@ type('title', $profileTitle); + $this->click('uf_group_type_Profile'); //Drupal user account registration option $this->click('CIVICRM_QFID_0_8'); @@ -54,7 +59,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase //Proximity search options $this->click('CIVICRM_QFID_0_14'); - // enable maping for contact + // enable mapping for contact $this->click('is_map'); // include a link in the listings to Edit profile fields @@ -104,28 +109,30 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase $this->assertElementContainsText('crm-profile-block', 'Group(s)', "Groups field was not found."); //fill the subscription form - $radomEmail = substr(sha1(rand()), 0, 7) . "@example.com"; + $randomEmail = substr(sha1(rand()), 0, 7) . "@example.com"; - $this->type("email-Primary", $radomEmail); + $this->type("email-Primary", $randomEmail); // check advisory group ( may be we should create a separate group to test this) $this->click("group_3"); $this->click('_qf_Edit_next'); - $this->waitForPageToLoad($this->getTimeoutMsec()); // assert for subscription message - $this->assertElementContainsText('css=div.messages', "Your subscription request has been submitted for group ", "Subscription message is not shown"); + $this->isTextPresent("Your subscription request has been submitted for"); //check if profile is saved - $this->assertElementContainsText('css=span.msg-text', 'Your information has been saved.', 'Profile is not saved'); + $this->waitForText('crm-notification-container','Your information has been saved.'); // delete the profile $this->openCiviPage('admin/uf/group', 'reset=1'); $this->_testdeleteProfile($profileTitle); } + /** + * @param $profileTitle + */ function _testdeleteProfile($profileTitle) { $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']"); $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']");