package com.atlassian.webdriver.bitbucket.element;

import com.atlassian.pageobjects.elements.PageElement;
import com.atlassian.pageobjects.elements.WebDriverLocatable;
import com.atlassian.pageobjects.elements.timeout.TimeoutType;
import org.openqa.selenium.By;

public class Avatar extends LegacyElementPageObject {

    public static final String CLASS_NAME = "user-avatar";

    public Avatar(PageElement avatarContainer) {
        super(avatarContainer);
    }

    public Avatar(By locator, WebDriverLocatable parent) {
        super(locator, parent);
    }

    public Avatar(WebDriverLocatable locatable, TimeoutType timeoutType) {
        super(locatable, timeoutType);
    }

    public Avatar(By by, TimeoutType timeoutType) {
        super(by, timeoutType);
    }

    public Avatar(By locator, WebDriverLocatable parent, TimeoutType timeoutType) {
        super(locator, parent, timeoutType);
    }

    public String getUsername() {
        return getAttribute("data-username");
    }

    public String getUrl() {
        return find(By.tagName("img")).getAttribute("src");
    }

}
