You are here

private function SaveSettingsTest::addFieldsOnWebform in Webform CiviCRM Integration 8.5

Add fields on the webform.

2 calls to SaveSettingsTest::addFieldsOnWebform()
SaveSettingsTest::testAddFields in tests/src/FunctionalJavascript/SaveSettingsTest.php
Add fields on the webform.
SaveSettingsTest::testDeleteField in tests/src/FunctionalJavascript/SaveSettingsTest.php
Delete fields on the webform.

File

tests/src/FunctionalJavascript/SaveSettingsTest.php, line 95

Class

SaveSettingsTest
Tests settings on the webform.

Namespace

Drupal\Tests\webform_civicrm\FunctionalJavascript

Code

private function addFieldsOnWebform() {
  $this
    ->drupalLogin($this->rootUser);
  $this
    ->drupalGet(Url::fromRoute('entity.webform.civicrm', [
    'webform' => $this->webform
      ->id(),
  ]));
  $this
    ->enableCivicrmOnWebform();
  $this
    ->getSession()
    ->getPage()
    ->clickLink('Activities');
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('activity_number_of_activity', 1);
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->htmlOutput();
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('Activity Type', '- User Select -');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->saveCiviCRMSettings();
  $this
    ->assertSession()
    ->pageTextContains('Added 4 fields to the form');
  $this
    ->assertSession()
    ->pageTextContains('Saved CiviCRM settings');
}