X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FGrant%2FCustomFieldsetTest.php;h=df22add5a2e9670f9caf8e1d3704cfed4f9e9cbd;hb=776ff7a00ca98cd3f668e43e4419c62791b1110f;hp=d76c5f3a19217044c77c514af55582bc438c5863;hpb=88c6259e813c523210e799e874ece50131ebe6d7;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php index d76c5f3a19..df22add5a2 100644 --- a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php +++ b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php @@ -1,7 +1,7 @@ webtestLogin('admin'); @@ -70,10 +70,8 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $this->select('id=extends_0', 'label=Grants'); $this->addSelection('id=extends_1', "label=$grantType"); $this->click('id=collapse_display'); - $this->click('id=_qf_Group_next-bottom'); - $this->waitForElementPresent('newCustomField'); + $this->clickLink('id=_qf_Group_next-bottom'); $this->waitForText('crm-notification-container', "Your custom field set '$grantFieldSet' has been added."); - $this->click('newCustomField'); $this->waitForElementPresent('_qf_Field_done-bottom'); // Add field to fieldset @@ -85,9 +83,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { // Create new Grant $this->openCiviPage('grant/add', 'reset=1&action=add&context=standalone', '_qf_Grant_upload-bottom'); - $firstName = 'First' . $rand; - $lastName = 'Last' . $rand; - $this->webtestNewDialogContact($firstName, $lastName); + $contact = $this->createDialogContact(); $this->select('id=status_id', 'label=Approved for Payment'); $this->select('id=grant_type_id', "label=$grantType"); $this->waitForTextPresent($grantField); @@ -102,15 +98,15 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { // verify tabular data for grant view $this->webtestVerifyTabularData(array( - 'Name' => "$firstName $lastName", - 'Grant Status' => 'Approved', - 'Grant Type' => $grantType, - $grantField => '$ 99.99', - ) + 'Name' => $contact['display_name'], + 'Grant Status' => 'Approved', + 'Grant Type' => $grantType, + $grantField => '$ 99.99', + ) ); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); // Enable CiviGrant module if necessary @@ -119,10 +115,11 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $triggerElement = array('name' => 'grant_type_id', 'type' => 'select'); $customSets = array( array('entity' => 'Grant', 'subEntity' => 'Emergency', 'triggerElement' => $triggerElement), - array('entity' => 'Grant', 'subEntity' => 'Family Support', 'triggerElement' => $triggerElement) + array('entity' => 'Grant', 'subEntity' => 'Family Support', 'triggerElement' => $triggerElement), ); $pageUrl = array('url' => 'grant/add', 'args' => 'reset=1&action=add&context=standalone'); $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } + }