I'm writing the behat step definition to automate the submission of the user name and password fields on the following "Sign In" page. I got the following error by using the xpath selector. Please advise what I did wrong? Thanks!!
Fatal error: Call to undefined method LoginAuthContext::find() in /behatlogin/features/bootstrap/LoginAuthContext.php on line 20
Sign In Form
<form action="/auth" method="POST" class="ng-pristine ng-valid">
<input type="text" name="uname" id="uname" class="form-control" placeholder="User name" required="" autofocus="">
<input type="password" name="pass" id="pass" class="form-control" placeholder="Password" required="">
<button class="btn btn-lg btn-primary btn-block shadow1" type="submit">Sign in</button>
</form>
LoginAuthContext Step Definitions
/**
* @When /^I am logged in$/
*/
public function iAmLoggedIn()
{
$this->find('xpath','uname')->setValue('testuname');
$this->findField('xpath','pass')->setValue('testpass');
$this->pressButton('Sign in');
}