You are here

protected function InlineEntityFormTestBase::getXpathForButtonWithValue in Inline Entity Form 8

Returns xpath selector to the index-th button with button text value.

Note: index starts at 1.

Parameters

string $value: The text on the button to select.

int $index: The index of the button to select.

Return value

string The xpath selector for the button to select.

4 calls to InlineEntityFormTestBase::getXpathForButtonWithValue()
ComplexWidgetRevisionsTest::testRevisionsAtDepth in tests/src/FunctionalJavascript/ComplexWidgetRevisionsTest.php
Tests saving entity reference revisions' field types at depth.
ComplexWidgetRevisionsTest::testRevisionsWithTestEntityNoBundle in tests/src/FunctionalJavascript/ComplexWidgetRevisionsTest.php
Tests saving entity revision with test entity that has no bundle.
ComplexWidgetTest::buttonXpath in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Get xpath for a button.
ComplexWidgetTest::testNestedCreateAndEditWontClash in tests/src/FunctionalJavascript/ComplexWidgetTest.php
Tests that create and edit of nested data won#t clash.

File

tests/src/FunctionalJavascript/InlineEntityFormTestBase.php, line 285

Class

InlineEntityFormTestBase
Base Class for Inline Entity Form Tests.

Namespace

Drupal\Tests\inline_entity_form\FunctionalJavascript

Code

protected function getXpathForButtonWithValue(string $value, int $index) {
  return "(//input[@type='submit' and @value='{$value}'])[{$index}]";
}