/** * @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() ); }
/** * @Given I unchecked :label checkbox * @When I uncheck :label checkbox * * Unchecks the value for the checkbox with name ':label' */ public function uncheckOption($option) { $fieldElements = $this->getXpath()->findFields($option); EzAssertion::assertElementFound($option, $fieldElements, null, 'checkbox'); // this is needed for the cases where are checkboxes and radio's // side by side, for main option the radio and the extra being the // checkboxes values if (strtolower($fieldElements[0]->getAttribute('type')) !== 'checkbox') { $value = $fieldElements[0]->getAttribute('value'); $fieldElements = $this->getXpath()->findXpath("//input[@type='checkbox' and @value='{$value}']"); EzAssertion::assertElementFound($value, $fieldElements, null, 'checkbox'); } $fieldElements[0]->uncheck(); }