Skip to content

Commit

Permalink
improve var name
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed May 8, 2023
1 parent 5450925 commit 9afa50b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Behat/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ public function iSearchGridFor(string $text): void
*/
public function iSelectValueInLookup(string $value, string $inputName): void
{
$isXpath = $this->parseSelector($inputName)[0] === 'xpath';
$isSelectorXpath = $this->parseSelector($inputName)[0] === 'xpath';

// get dropdown item from Fomantic-UI which is direct parent of input html element
$lookupElem = $this->findElement(null, ($isXpath ? $inputName : '//input[@name="' . $inputName . '"]') . '/parent::div');
$lookupElem = $this->findElement(null, ($isSelectorXpath ? $inputName : '//input[@name="' . $inputName . '"]') . '/parent::div');

// open dropdown and wait till fully opened (just a click is not triggering it)
$this->getSession()->executeScript('$(arguments[0]).dropdown(\'show\')', [$lookupElem]);
Expand Down

0 comments on commit 9afa50b

Please sign in to comment.