it.com.atlassian.gadgets.pages
Class Gadget

java.lang.Object
  extended by it.com.atlassian.gadgets.pages.Gadget
All Implemented Interfaces:
com.atlassian.pageobjects.elements.PageElementFinder
Direct Known Subclasses:
ConfigurableGadget

public class Gadget
extends Object
implements com.atlassian.pageobjects.elements.PageElementFinder

Represents a single gadget that consists of a draggable HTML container containing an IFrame with the contents of the gadget.

The contents inside the gadget IFrame may be queried via the implemented PageElementFinder interface. After querying contents of the gadgets clients must ensure to switch to the main window. A 'shortcut' method switchBack() has been provided.


Field Summary
protected  com.atlassian.pageobjects.elements.PageElementActions actions
           
protected  com.atlassian.webdriver.AtlassianWebDriver driver
           
protected  com.atlassian.pageobjects.elements.PageElementFinder finder
           
protected  com.atlassian.pageobjects.PageBinder pageBinder
           
 
Constructor Summary
Gadget(String id)
           
 
Method Summary
 Gadget changeColor(String colorClass)
           
 Gadget delete()
           
 Gadget dragTo(com.atlassian.pageobjects.elements.PageElement column)
           
 Gadget dragTo(org.openqa.selenium.Point newPosition)
           
 Gadget dragTo(org.openqa.selenium.WebElement column)
           
 com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By by)
           
<T extends com.atlassian.pageobjects.elements.PageElement>
T
find(org.openqa.selenium.By by, Class<T> elementClass)
           
<T extends com.atlassian.pageobjects.elements.PageElement>
T
find(org.openqa.selenium.By by, Class<T> elementClass, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
           
 com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By by, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
           
 List<com.atlassian.pageobjects.elements.PageElement> findAll(org.openqa.selenium.By by)
           
<T extends com.atlassian.pageobjects.elements.PageElement>
List<T>
findAll(org.openqa.selenium.By by, Class<T> elementClass)
           
<T extends com.atlassian.pageobjects.elements.PageElement>
List<T>
findAll(org.openqa.selenium.By by, Class<T> elementClass, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
           
 List<com.atlassian.pageobjects.elements.PageElement> findAll(org.openqa.selenium.By by, com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
           
 com.atlassian.pageobjects.elements.PageElement getChrome()
           
protected  org.openqa.selenium.WebElement getChromeWebElement()
           
 String getColor()
           
 String getErrorMsgText()
           
 String getHtml()
           
 String getId()
           
protected  com.atlassian.pageobjects.elements.PageElement getMain()
           
 String getMainText()
           
protected  org.openqa.selenium.WebElement getMainWebElement()
           
 String getText()
           
 com.atlassian.pageobjects.elements.PageElement getTitleBar()
           
protected  org.openqa.selenium.WebElement getTitleBarWebElement()
           
 Boolean isMinimized()
           
 Gadget maximize()
           
 Gadget minimize()
           
 GadgetMenu openMenu()
           
 void switchBack()
          Switch away from the gadgets contents, back to the main window.
 Gadget switchTo()
          Equivalent to switchToIframe()
<T> T
switchTo(Class<T> cls)
           
 Gadget switchToIframe()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

driver

@Inject
protected com.atlassian.webdriver.AtlassianWebDriver driver

pageBinder

@Inject
protected com.atlassian.pageobjects.PageBinder pageBinder

finder

@Inject
protected com.atlassian.pageobjects.elements.PageElementFinder finder

actions

@Inject
protected com.atlassian.pageobjects.elements.PageElementActions actions
Constructor Detail

Gadget

public Gadget(String id)
Method Detail

getChrome

public com.atlassian.pageobjects.elements.PageElement getChrome()

getChromeWebElement

protected org.openqa.selenium.WebElement getChromeWebElement()

getMain

protected com.atlassian.pageobjects.elements.PageElement getMain()

getMainWebElement

protected org.openqa.selenium.WebElement getMainWebElement()

getId

public String getId()

getTitleBar

public com.atlassian.pageobjects.elements.PageElement getTitleBar()

getTitleBarWebElement

protected org.openqa.selenium.WebElement getTitleBarWebElement()

minimize

public Gadget minimize()

openMenu

public GadgetMenu openMenu()

getHtml

public String getHtml()

getText

public String getText()

maximize

public Gadget maximize()

dragTo

public Gadget dragTo(org.openqa.selenium.WebElement column)
              throws Exception
Throws:
Exception

dragTo

public Gadget dragTo(com.atlassian.pageobjects.elements.PageElement column)
              throws Exception
Throws:
Exception

dragTo

public Gadget dragTo(org.openqa.selenium.Point newPosition)
              throws Exception
Throws:
Exception

isMinimized

public Boolean isMinimized()

getMainText

public String getMainText()

changeColor

public Gadget changeColor(String colorClass)

getErrorMsgText

public String getErrorMsgText()

getColor

public String getColor()

switchToIframe

public Gadget switchToIframe()

switchTo

public Gadget switchTo()
Equivalent to switchToIframe()

Returns:
this gadget instance

switchTo

public <T> T switchTo(Class<T> cls)

switchBack

public void switchBack()
Switch away from the gadgets contents, back to the main window.


delete

public Gadget delete()

find

public com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By by)
Specified by:
find in interface com.atlassian.pageobjects.elements.PageElementFinder

find

public com.atlassian.pageobjects.elements.PageElement find(org.openqa.selenium.By by,
                                                           com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
Specified by:
find in interface com.atlassian.pageobjects.elements.PageElementFinder

findAll

public List<com.atlassian.pageobjects.elements.PageElement> findAll(org.openqa.selenium.By by)
Specified by:
findAll in interface com.atlassian.pageobjects.elements.PageElementFinder

findAll

public List<com.atlassian.pageobjects.elements.PageElement> findAll(org.openqa.selenium.By by,
                                                                    com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
Specified by:
findAll in interface com.atlassian.pageobjects.elements.PageElementFinder

find

public <T extends com.atlassian.pageobjects.elements.PageElement> T find(org.openqa.selenium.By by,
                                                                         Class<T> elementClass)
Specified by:
find in interface com.atlassian.pageobjects.elements.PageElementFinder

find

public <T extends com.atlassian.pageobjects.elements.PageElement> T find(org.openqa.selenium.By by,
                                                                         Class<T> elementClass,
                                                                         com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
Specified by:
find in interface com.atlassian.pageobjects.elements.PageElementFinder

findAll

public <T extends com.atlassian.pageobjects.elements.PageElement> List<T> findAll(org.openqa.selenium.By by,
                                                                                  Class<T> elementClass)
Specified by:
findAll in interface com.atlassian.pageobjects.elements.PageElementFinder

findAll

public <T extends com.atlassian.pageobjects.elements.PageElement> List<T> findAll(org.openqa.selenium.By by,
                                                                                  Class<T> elementClass,
                                                                                  com.atlassian.pageobjects.elements.timeout.TimeoutType timeoutType)
Specified by:
findAll in interface com.atlassian.pageobjects.elements.PageElementFinder


Copyright © 2013 Atlassian. All Rights Reserved.