1 package com.atlassian.webdriver.jira.page.user;
2
3 import com.atlassian.pageobjects.Page;
4 import com.atlassian.webdriver.jira.page.JiraAdminAbstractPage;
5 import org.openqa.selenium.WebElement;
6 import org.openqa.selenium.support.FindBy;
7
8
9
10
11 public class ViewUserPage extends JiraAdminAbstractPage
12 {
13
14 private static final String URI = "/secure/admin/user/ViewUser.jspa";
15
16 @FindBy (id = "username")
17 private WebElement username;
18
19 @FindBy (className = "fn")
20 private WebElement fullname;
21
22 @FindBy (className = "email")
23 private WebElement email;
24
25 @FindBy (id = "loginCount")
26 private WebElement loginCount;
27
28 @FindBy (id = "lastLogin")
29 private WebElement lastLogin;
30
31 @FindBy (id = "previousLogin")
32 private WebElement previousLogin;
33
34 @FindBy (id = "lastFailedLogin")
35 private WebElement lastFailedLogin;
36
37 @FindBy (id = "currentFailedLoginCount")
38 private WebElement currentFailedLoginCount;
39
40 @FindBy (id = "totalFailedLoginCount")
41 private WebElement totalFailedLoginCount;
42
43 @FindBy (id ="deleteuser_link")
44 WebElement deleteUserLink;
45
46 @FindBy (id = "editgroups_link")
47 WebElement editUserLink;
48
49
50
51 public String getUrl()
52 {
53 return URI;
54 }
55
56 public DeleteUserPage gotoDeleteUserPage()
57 {
58 deleteUserLink.click();
59
60 return pageBinder.bind(DeleteUserPage.class);
61 }
62
63 public Page setPassword()
64 {
65 throw new UnsupportedOperationException("Set password on ViewUserPage is not supported");
66 }
67
68 public Page editDetails()
69 {
70 throw new UnsupportedOperationException("Edit details on ViewUserPage is not supported");
71 }
72
73 public Page viewProjectsRoles()
74 {
75 throw new UnsupportedOperationException("View project roles on ViewUSerPage is not supported");
76 }
77
78 public EditUserGroupsPage editGroups()
79 {
80 editUserLink.click();
81
82 return pageBinder.bind(EditUserGroupsPage.class);
83 }
84
85 public Page editProperties()
86 {
87 throw new UnsupportedOperationException("Edit properties on the ViewUserPage is not supported");
88 }
89
90 public Page viewPublicProfile()
91 {
92 throw new UnsupportedOperationException("View public profile on ViewUserPage is not supported");
93 }
94
95
96 public String getUsername()
97 {
98 return username.getText();
99 }
100
101 public String getFullname()
102 {
103 return fullname.getText();
104 }
105
106 public String getEmail()
107 {
108 return email.getText();
109 }
110
111 public String getLoginCount()
112 {
113 return loginCount.getText();
114 }
115
116 public String getLastLogin()
117 {
118 return lastLogin.getText();
119 }
120
121 public String getPreviousLogin()
122 {
123 return previousLogin.getText();
124 }
125
126 public String getLastFailedLogin()
127 {
128 return lastFailedLogin.getText();
129 }
130
131 public String getCurrentFailedLoginCount()
132 {
133 return currentFailedLoginCount.getText();
134 }
135
136 public String getTotalFailedLoginCount()
137 {
138 return totalFailedLoginCount.getText();
139 }
140 }