public function search(string $text)
    {
        $search = $this->find('css', '#adminbarsearch');

        if (! $search) {
            throw new ExpectationException(
                '[W404] Search field in the toolbar could not be found',
                $this->getDriver()
            );
        }

        try {
            $search->find('css', '#adminbar-search')->press();
            $search->find('css', '#adminbar-search')->focus();
            $search->fillField('adminbar-search', $text);
            $search->find('css', '#adminbar-search')->focus();
        } catch (UnsupportedDriverActionException $e) {
            $search->fillField('adminbar-search', $text);
        }

        $search->submit();
    }
public function search(string $text)
    {
        $search = $this->find('css', '#adminbarsearch');

        if (! $search) {
            throw new ExpectationException(
                '[W404] Search field in the toolbar could not be found',
                $this->getDriver()
            );
        }

        try {
            $search->find('css', '#adminbar-search')->press();
            $search->find('css', '#adminbar-search')->focus();
            $search->fillField('adminbar-search', $text);
            $search->find('css', '#adminbar-search')->focus();
        } catch (UnsupportedDriverActionException $e) {
            $search->fillField('adminbar-search', $text);
        }

        $search->submit();
    }
public function search ( string $ text ) { $ search = $ this -> find ( 'css' , '#adminbarsearch' ) ; if ( ! $ search ) { throw new ExpectationException ( '[W404] Search field in the toolbar could not be found' , $ this -> getDriver ( ) ) ; } try { $ search -> find ( 'css' , '#adminbar-search' ) -> press ( ) ; $ search -> find ( 'css' , '#adminbar-search' ) -> focus ( ) ; $ search -> fillField ( 'adminbar-search' , $ text ) ; $ search -> find ( 'css' , '#adminbar-search' ) -> focus ( ) ; } catch ( UnsupportedDriverActionException $ e ) { $ search -> fillField ( 'adminbar-search' , $ text ) ; } $ search -> submit ( ) ; }
Searches for the given text using the toolbar search field.

@param string $text Text to enter into the search field

@throws \Behat\Mink\Exception\ExpectationException
Searches for the given text using the toolbar search field .