View Javadoc

1   package com.atlassian.webdriver.confluence.component.macro;
2   
3   import org.openqa.selenium.By;
4   import org.openqa.selenium.WebElement;
5   
6   /**
7    * TODO: Document this class / interface here
8    *
9    */
10  public class UserMacro
11  {
12  
13      private WebElement vCardElement;
14  
15      private WebElement userLogoLink;
16      private WebElement userLogo;
17      private WebElement usernameLink;
18      private WebElement emailLink;
19  
20      private String username;
21      private String fullName;
22      private String email;
23  
24      /**
25       * 
26       */
27      public UserMacro(final By componentLocator, WebElement profileElement)
28      {
29  
30          vCardElement = profileElement.findElement(componentLocator);
31  
32          userLogoLink = vCardElement.findElement(By.className("userLogoLink"));
33          userLogo = vCardElement.findElement(By.className("userLogo"));
34          usernameLink = vCardElement.findElement(By.className("confluence-userlink"));
35          emailLink = vCardElement.findElement(By.className("email"));
36  
37          username = usernameLink.getAttribute("data-username");
38          fullName = usernameLink.getText();
39          email = emailLink.getText();
40  
41      }
42  
43      public String getFullName()
44      {
45          return fullName;
46      }
47  
48      public String getEmail()
49      {
50          return email;
51      }
52  
53      public String getUsername()
54      {
55          return username;
56      }
57  
58  }