You are here

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

Same name and namespace in other branches
  1. 9.0.x 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: The other attribute name.

string $otherAttributeValue: The other attribute value.

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

Return value

string Attribute value for the first matching element.

5 calls to VarbaseContext::getAttributeByOtherAttributeValue()
VarbaseContext::appendTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
Append text at the end of a rich text editor field WYSIWYG with content.
VarbaseContext::iFillInTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
Fill in a rich text editor field WYSIWYG with content.
VarbaseContext::iShouldSeeImageWithTheAltTextUnder in tests/features/bootstrap/VarbaseContext.php
Find an image with the alt text attribute under a custom iframe.
VarbaseContext::iShouldSeeImageWithTheTitleTextInTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
Find an image with the title text attribute under a custom iframe.
VarbaseContext::prependTheRichTextEditorField in tests/features/bootstrap/VarbaseContext.php
Add append text at the end of rich text editor field WYSIWYG with content.

File

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

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);
}