You are here

public function ComplexWidgetTest::waitForXpath in Inline Entity Form 8

Wait, assert, and return an element via XPath.

On fail, save output and throw.

Parameters

string $xpath: The XPath.

int $timeout: The timeout in milliseconds.

Return value

\Behat\Mink\Element\NodeElement The element.

2 calls to ComplexWidgetTest::waitForXpath()
ComplexWidgetTest::elementWithXpath in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Assert and return an element via XPath. On fail, save output and throw.
ComplexWidgetTest::testNestedCreateAndEditWontClash in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests that create and edit of nested data won#t clash.

File

tests/src/FunctionalJavascript/ComplexWidgetTest.php, line 1058

Class

ComplexWidgetTest
IEF complex field widget tests.

Namespace

Drupal\Tests\inline_entity_form\FunctionalJavascript

Code

public function waitForXpath(string $xpath, int $timeout = 10000) : NodeElement {
  $element = $this
    ->assertSession()
    ->waitForElement('xpath', $xpath, $timeout);
  if (!$element) {
    $this
      ->htmlOutput();
    $this
      ->assertNotNull($element);
  }
  return $element;
}