You are here

private function VarbaseContext::_getAttributeByOtherAttributeValue in Varbase: The Ultimate Drupal CMS Starter Kit (Bootstrap Ready) 8.7

Same name and namespace in other branches
  1. 8.4 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::_getAttributeByOtherAttributeValue()
  2. 8.5 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::_getAttributeByOtherAttributeValue()
  3. 8.6 tests/features/bootstrap/VarbaseContext.php \VarbaseContext::_getAttributeByOtherAttributeValue()

Helper function to let you get the value of an attribute name for an HTML tag by other Attribute name and value

Parameters

string $attributeName The attribute name.:

string $otherAttributeName other attribute name.:

string $otherAttributeValue other attribute value.:

string $htmlTagName the HTML tag name you are filtring with.:

Return value

string Attribute value for the first matching element.

6 calls to VarbaseContext::_getAttributeByOtherAttributeValue()
VarbaseContext::appendTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
#varbase : To append text at the end of a rich text editor field WYSIWYG with content using the name of the field.
VarbaseContext::iFillInTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
#varbase : To fill in a rich text editor field WYSIWYG with content using the name of the field.
VarbaseContext::iShouldSeeImageWithTheAltTextUnder in tests/features/bootstrap/VarbaseContext.php
#varbase : To Find an image with the alt text attribute. under a custom iframe.
VarbaseContext::iShouldSeeImageWithTheTitleTextInTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
#varbase : To Find an image with the title text attribute under a custom iframe.
VarbaseContext::prependTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
#varbase : To add append text at the end of a rich text editor field WYSIWYG with content using the name of the field.

... See full list

File

tests/features/bootstrap/VarbaseContext.php, line 1470

Class

VarbaseContext
Defines application features from the specific context.

Code

private function _getAttributeByOtherAttributeValue($attributeName, $otherAttributeName, $otherAttributeValue, $htmlTagName = "*") {
  $element = $this
    ->getSession()
    ->getPage()
    ->find('xpath', "//{$htmlTagName}[contains(@{$otherAttributeName}, '{$otherAttributeValue}')]");
  return $element
    ->getAttribute($attributeName);
}