I have written automation test cases for my application.Below is the sample code i have used for web testing.
class UserWebTestcase extends CakeWebTestCase{
var $name='UserWebTestcase';
function testLogin001()
{
//Test if new user registration form works as intended when all the inputs are given properly.
$this->get(Configure::read('url'));
$this->setField('email', 'admin45@gmail.com');
$this->setField('tmppassword', 'admin123');
$this->setField('password_confirm', 'admin123');
$this->clickSubmit('SUBMIT');
$this->assertText('login');
}
}
In test case it always gives false even though the inputs for fields are correct.The error i got like this (Failed C:\xampplite\htdocs\spotchase\app\tests\cases\models\user.test.php -> UserWebTestcase -> testLogin001). Im really confused while using the assertText() method.How should i use this assertText() method and what parameters should i pass to this method. Please help.