public function elementsCount($selectorType, $selector, $count, ElementInterface $container = null)
    {
        $container = $container ?: $this->session->getPage();
        $nodes = $container->findAll($selectorType, $selector);

        $message = sprintf(
            '%d %s found on the page, but should be %d.',
            count($nodes),
            $this->getMatchingElementRepresentation($selectorType, $selector, count($nodes) !== 1),
            $count
        );

        $this->assert(intval($count) === count($nodes), $message);
    }
public function elementsCount($selectorType, $selector, $count, ElementInterface $container = null)
    {
        $container = $container ?: $this->session->getPage();
        $nodes = $container->findAll($selectorType, $selector);

        $message = sprintf(
            '%d %s found on the page, but should be %d.',
            count($nodes),
            $this->getMatchingElementRepresentation($selectorType, $selector, count($nodes) !== 1),
            $count
        );

        $this->assert(intval($count) === count($nodes), $message);
    }
public function elementsCount ( $ selectorType , $ selector , $ count , ElementInterface $ container = null ) { $ container = $ container ? : $ this -> session -> getPage ( ) ; $ nodes = $ container -> findAll ( $ selectorType , $ selector ) ; $ message = sprintf ( '%d %s found on the page, but should be %d.' , count ( $ nodes ) , $ this -> getMatchingElementRepresentation ( $ selectorType , $ selector , count ( $ nodes ) !== 1 ) , $ count ) ; $ this -> assert ( intval ( $ count ) === count ( $ nodes ) , $ message ) ; }
Checks that there is specified number of specific elements on the page.

@param string           $selectorType element selector type (css, xpath)
@param string|array     $selector     element selector
@param int              $count        expected count
@param ElementInterface $container    document to check against

@throws ExpectationException
Checks that there is specified number of specific elements on the page .