1: <?php
2: namespace Azalea\Selenium\Login\UI;
3:
4: class LoginForm extends \Azalea\Selenium\Core\View
5: {
6: /**
7: * Sets the email address.
8: * @param string $email
9: */
10: public function email($email)
11: {
12: $this->byName('email')->value($email);
13: }
14:
15: /**
16: * Sets the password.
17: * @param string $password
18: */
19: public function password($password)
20: {
21: $this->byName('password')->value($password);
22: }
23:
24: /**
25: * Submit the form
26: */
27: public function submit()
28: {
29: $this->byName('login')->click();
30: }
31:
32: /**
33: * Returns true if an invalid login message is displayed.
34: * @return boolean
35: */
36: public function isInvalid()
37: {
38: return $this->isTextPresent("Login Invalid. Please Try Again.");
39: }
40:
41: /**
42: * Called by the View class to verify that the view is valid
43: * on the current page.
44: */
45: protected function verify()
46: {
47: // look for the login container
48: $this->byClassName("login_panel");
49:
50: return true;
51: }
52: }