You are here

protected function NestedTableDragTest::addLinkField in Thunder 8.3

Same name and namespace in other branches
  1. 8.5 tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()
  2. 8.2 tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()
  3. 8.4 tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()
  4. 6.2.x tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()
  5. 6.0.x tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()
  6. 6.1.x tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php \Drupal\Tests\thunder\FunctionalJavascript\Integration\NestedTableDragTest::addLinkField()

Adding link field instance.

Parameters

string $paragraphName: Paragraph field name.

int $paragraphIndex: Paragraph field index.

string $fieldName: Field name.

int $fieldIndex: Field index.

string $urlText: Url text.

string $url: Url.

int $position: Position.

1 call to NestedTableDragTest::addLinkField()
NestedTableDragTest::testNestedTableSorting in tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php
Test tabledrag sorting in nested table.

File

tests/src/FunctionalJavascript/Integration/NestedTableDragTest.php, line 127

Class

NestedTableDragTest
Tests the tabledrag sorting mechanism in nested tables.

Namespace

Drupal\Tests\thunder\FunctionalJavascript\Integration

Code

protected function addLinkField($paragraphName, $paragraphIndex, $fieldName, $fieldIndex, $urlText, $url, $position = NULL) {

  /** @var \Behat\Mink\Element\DocumentElement $page */
  $page = $this
    ->getSession()
    ->getPage();
  $addButtonName = $paragraphName . "_" . $paragraphIndex . "_subform_" . $fieldName . "_add_more";
  $this
    ->scrollElementInView("[name=\"{$addButtonName}\"]");
  $page
    ->pressButton($addButtonName);
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $page
    ->fillField("{$paragraphName}[{$paragraphIndex}][subform][{$fieldName}][{$fieldIndex}][title]", $urlText);
  $page
    ->fillField("{$paragraphName}[{$paragraphIndex}][subform][{$fieldName}][{$fieldIndex}][uri]", $url);
}