18 public function testLoginEmailAndStatus()
20 $this->open(
'widgetsTests/userLogin');
21 $this->assertTextPresent(
'Remember me next time');
22 $this->assertTextPresent(
'Google open Id');
24 $this->type(
'name=UserLogin[authField]',
'webmaster@example.com');
25 $this->type(
'name=UserLogin[password]',
'admin');
26 $this->clickAndWait(
"//input[@value='Login']");
27 $this->assertTextPresent(
'User id: 1');
29 $this->open(
'widgetsTests/userStatus');
30 $this->assertTextPresent(
'User: ');
34 public function testLogout()
36 $this->open(
'widgetsTests/userLogin');
37 $this->type(
'name=UserLogin[authField]',
'webmaster@example.com');
38 $this->type(
'name=UserLogin[password]',
'admin');
39 $this->clickAndWait(
"//input[@value='Login']");
41 $this->open(
'widgetsTests/userLogout');
42 $this->assertElementPresent(
'xpath=//a[text()="Logout"]');
43 $this->clickAndWait(
'link=Logout');
44 $this->assertElementNotPresent(
'xpath=//a[text()="Logout"]');
47 public function testRegistration()
49 $this->open(
'widgetsTests/userRegistration');
51 $this->assertTextPresent(
'E-mail *');
52 $this->assertTextPresent(
'Verification Code *');
54 $username = $password =
'test_' . uniqid();
55 $email =
"$username@gmail.com";
57 $this->type(
'name=RegistrationForm[username]', $username);
58 $this->type(
'name=RegistrationForm[email]', $email);
59 $this->type(
'name=RegistrationForm[password]', $password);
60 $this->type(
'name=RegistrationForm[verifyPassword]', $password);
61 $this->type(
'name=Profile[lastname]', $username);
62 $this->type(
'name=Profile[firstname]', $username);
63 $this->type(
'name=RegistrationForm[verifyCode]', Yii::app()->params[
'captcha']);
65 $this->clickAndWait(
"//input[@value='Register']");
66 $this->assertTextPresent(
'Thank you for your registration');
69 public function testRecovery()
71 $this->open(
'widgetsTests/userRecovery');
72 $this->type(
'UserRecoveryForm[login_or_email]',
'webmaster@example.com');
73 $this->clickAndWait(
"//input[@value='Restore']");
74 $this->assertTextPresent(
'Please check your email.');
76 $this->open(
'widgetsTests/userRecovery');
77 $this->type(
'UserRecoveryForm[login_or_email]',
'.com');
78 $this->clickAndWait(
"//input[@value='Restore']");
79 $this->assertTextPresent(
'Please fix the following input errors');