public function login($username, $password)
    {
        $this->visit("wp-login.php");
        $currentPage = $this->getSession()->getPage();

        $currentPage->fillField('user_login', $username);
        $currentPage->fillField('user_pass', $password);
        $currentPage->findButton('wp-submit')->click();

        assertTrue($this->getSession()->getPage()->hasContent('Dashboard'));
    }
public function login($username, $password)
    {
        $this->visit("wp-login.php");
        $currentPage = $this->getSession()->getPage();

        $currentPage->fillField('user_login', $username);
        $currentPage->fillField('user_pass', $password);
        $currentPage->findButton('wp-submit')->click();

        assertTrue($this->getSession()->getPage()->hasContent('Dashboard'));
    }
public function login ( $ username , $ password ) { $ this -> visit ( "wp-login.php" ) ; $ currentPage = $ this -> getSession ( ) -> getPage ( ) ; $ currentPage -> fillField ( 'user_login' , $ username ) ; $ currentPage -> fillField ( 'user_pass' , $ password ) ; $ currentPage -> findButton ( 'wp-submit' ) -> click ( ) ; assertTrue ( $ this -> getSession ( ) -> getPage ( ) -> hasContent ( 'Dashboard' ) ) ; }
Login into the reserved area of this wordpress

@Given /^I am logged in as "([^"]*)" with password "([^"]*)"$/
Login into the reserved area of this wordpress