webtest fixes
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 20 Apr 2016 13:22:48 +0000 (18:52 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 20 Apr 2016 13:22:48 +0000 (18:52 +0530)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Profile/ProfileAddTest.php

index c3cd052b7f7b383a240212857cd07ea0866c41db..14cdfc82205c0aa7bdfe7eb403fa3a4428b8fe12 100644 (file)
@@ -402,6 +402,16 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     return $this->settingCache[$field];
   }
 
+  /**
+   * override this since the built in function doesn't work with the new phpunit.
+   * @param string $element
+   * @param string $text
+   */
+  public function waitForText($element, $text) {
+    $this->waitForTextPresent($text);
+    $this->assertElementContainsText($element, $text);
+  }
+
   /**
    * Ensures the required CiviCRM components are enabled.
    * @param $components
@@ -1558,7 +1568,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->clickLink('_qf_Edit_upload-bottom');
 
     // Is status message correct?
-    $this->waitForText('crm-notification-container', "$groupName");
+    $this->waitForText('crm-notification-container', "The Group '$groupName' has been saved.");
     return $groupName;
   }
 
index 8d2485b8e93b48ef081ad17df08cc45a3a7e2dbc..47c14a88de14157e422b5639fab70acb0f96da78 100644 (file)
@@ -194,9 +194,9 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     //check the existence of the two contacts in the group
     $this->openCiviPage('group', 'reset=1');
     $this->type('title', $groupName);
-    $this->click('_qf_Search_refresh');
-    $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[text() = '$groupName']/parent::td/following-sibling::td[@class=' crm-group-group_links']/span/a");
-    $this->clickLink("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[1]/span[text() = '$groupName']/parent::td/following-sibling::td[@class=' crm-group-group_links']/span/a");
+    $this->click('title');
+    $this->waitForElementPresent("xpath=//div[text() = '$groupName']/parent::td/following-sibling::td[@class='crm-group-group_links']/span/a");
+    $this->clickLink("xpath=//div[text() = '$groupName']/parent::td/following-sibling::td[@class='crm-group-group_links']/span/a");
     $contactEmails = array(
       1 => "$lastName1, $firstName1",
       2 => "$lastName2, $firstName2",