public function getMetaBox(string $title): NodeElement
    {
        $metaboxes = $this->findAll('css', '.postbox');
        if ($metaboxes) {
            foreach ($metaboxes as $metabox) {
                if ($metabox->find('css', 'h2')->getText() === $title) {
                    return $metabox;
                }
            }
        }

        throw new ExpectationException(
            sprintf(
                '[W400] Metabox "%s" not found on the screen.',
                $title
            ),
            $this->getDriver()
        );
    }
public function getMetaBox(string $title): NodeElement
    {
        $metaboxes = $this->findAll('css', '.postbox');
        if ($metaboxes) {
            foreach ($metaboxes as $metabox) {
                if ($metabox->find('css', 'h2')->getText() === $title) {
                    return $metabox;
                }
            }
        }

        throw new ExpectationException(
            sprintf(
                '[W400] Metabox "%s" not found on the screen.',
                $title
            ),
            $this->getDriver()
        );
    }
public function getMetaBox ( string $ title ) : NodeElement { $ metaboxes = $ this -> findAll ( 'css' , '.postbox' ) ; if ( $ metaboxes ) { foreach ( $ metaboxes as $ metabox ) { if ( $ metabox -> find ( 'css' , 'h2' ) -> getText ( ) === $ title ) { return $ metabox ; } } } throw new ExpectationException ( sprintf ( '[W400] Metabox "%s" not found on the screen.' , $ title ) , $ this -> getDriver ( ) ) ; }
Get the node element for the specified metabox.

@param string $title The title of the metabox to get

@return \Behat\Mink\Element\NodeElement

@throws \Behat\Mink\Exception\ExpectationException If the metabox cannot be found
Get the node element for the specified metabox .