<?php

Yii::import('application.modules.usuario.models.*');
Yii::import('application.modules.usuario.models.formularios.*');
Yii::import('application.modules.usuario.controllers.*');

class LoginTest extends CWebTestCase {

    public function testRegistro() {
        $this->open('');
        
        // ensure the user is logged out
        if ($this->isTextPresent('Logout'))
            $this->clickAndWait('link=Logout (demo)');

        // test login process, including validation
        $this->clickAndWait('link=Login');
        /*$this->assertElementPresent('name=LoginForm[username]');
        $this->type('name=LoginForm[username]', 'demo');
        $this->click("//input[@value='Login']");
        $this->waitForTextPresent('Password cannot be blank.');
        $this->type('name=LoginForm[password]', 'demo');
        $this->clickAndWait("//input[@value='Login']");
        $this->assertTextNotPresent('Password cannot be blank.');
        $this->assertTextPresent('Logout');

        // test logout process
        $this->assertTextNotPresent('Login');
        $this->clickAndWait('link=Logout (demo)');
        $this->assertTextPresent('Login');*/
    }

}