Behat Mink: Custom Functions 01 - Click on XPath

Custom Function for Clicking Link By XPath

 
/**

 * @When I click :arg1

 */

public function iClick($arg1)

{

    $clickOn = $this->getSession()

                    ->getPage()

                    ->find("xpath",".//a[text()='" . $arg1 . "']")

                    ->click();

}