/** * @Then I (should) see :total search result(s) */ public function iSeeSearchResults( $total ) { $resultCountElement = $this->getXpath()->findXpath( "//div[@class = 'feedback']" ); EzAssertion::assertSingleElement( 'search feedback', $resultCountElement ); Assertion::assertRegExp( "/Search for \"(.*)\" returned {$total} matches/", $resultCountElement[0]->getText() ); }
/** * @Then on :pageSection I (should) see the :text text emphasized * * @deprecated deprecated since version 6.3.0 */ public function onPageSectionISeeTextEmphasized($text, $pageSection = null) { trigger_error("onPageSectionISeeTextEmphasized is deprecated since v6.3.0 and will be removed in v7.0.0", E_USER_DEPRECATED); // first find the text $base = $this->makeXpathForBlock($pageSection); $el = $this->getXpath()->findXpath("{$base}//*[contains( text(), {$this->getXpath()->literal($text)} )]"); EzAssertion::assertSingleElement($text, $el, $pageSection, 'emphasized text'); // finally verify if it has custom characteristics Assertion::assertTrue($this->isElementEmphasized($el[0]), "The text '{$text}' isn't emphasized"); }