com.ibm.team.fvt.tests.clm.pages.helper
Class ClmProjectDashboardPageHelper

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebPageElement
      extended by com.ibm.team.fvt.tests.clm.pages.helper.ClmWebPageHelper
          extended by com.ibm.team.fvt.tests.clm.pages.helper.ClmProjectAreaPageHelper
              extended by com.ibm.team.fvt.tests.clm.pages.helper.ClmProjectDashboardPageHelper

public class ClmProjectDashboardPageHelper
extends ClmProjectAreaPageHelper

Helper class to manage common code of any application project dashboard page.


Constructor Summary
ClmProjectDashboardPageHelper(ClmWebPageHelper pageHelper, java.lang.String dashboardName)
           
ClmProjectDashboardPageHelper(ClmWebPage page, java.lang.String dashboardName)
           
ClmProjectDashboardPageHelper(ClmWebPage page, com.ibm.team.fvt.tests.web.WebBrowserElement miniDashboardElement)
           
 
Method Summary
<V extends ClmViewlet>
V
addViewlet(java.lang.String title, java.lang.Class<V> viewletClass)
          Add the viewlet with the given title to the current project dashboard.
<V extends ClmViewlet>
V
addViewlet(java.lang.String title, java.lang.String application, java.lang.Class<V> viewletClass)
          Add the given application viewlet with the given title to the current project dashboard.
 java.lang.String getExpectedTitle()
          Return the expected title.
<V extends ClmViewlet>
V
getViewletElement(java.lang.String title, java.lang.Class<V> viewletClass)
          Return the viewlet web element matching the given title.
 java.util.List<com.ibm.team.fvt.tests.web.WebBrowserElement> getViewletElements()
          Return all the viewlet web elements displayed in the current project dashboard page.
 boolean isProjectDashboardPageHelper()
           
 void refreshContent()
          Refresh the page content by clicking on the Refresh button.
 void setAutoSave(boolean on)
          Check on/off the Auto Save for the current dashboard.
 void waitForAllViewlets()
          Wait that all viewlets are displayed in the dashboard page.
 void waitForAllViewletsLoaded()
          Wait for all viewlets to be loaded.
 
Methods inherited from class com.ibm.team.fvt.tests.clm.pages.helper.ClmProjectAreaPageHelper
checkRichHover, checkRichHover, getProjectAreaName, getProjectAreaTitle, gotoPageUsingHover, gotoPageUsingHover, setProjectAreaName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClmProjectDashboardPageHelper

public ClmProjectDashboardPageHelper(ClmWebPage page,
                                     java.lang.String dashboardName)

ClmProjectDashboardPageHelper

public ClmProjectDashboardPageHelper(ClmWebPageHelper pageHelper,
                                     java.lang.String dashboardName)

ClmProjectDashboardPageHelper

public ClmProjectDashboardPageHelper(ClmWebPage page,
                                     com.ibm.team.fvt.tests.web.WebBrowserElement miniDashboardElement)
Method Detail

addViewlet

public final <V extends ClmViewlet> V addViewlet(java.lang.String title,
                                                 java.lang.Class<V> viewletClass)
Add the viewlet with the given title to the current project dashboard.

Note that nothing happens if the viewlet was already displayed in the dashboard.

Parameters:
title - The viewlet title
Returns:
The viewlet element as a ClmViewlet.

addViewlet

public <V extends ClmViewlet> V addViewlet(java.lang.String title,
                                           java.lang.String application,
                                           java.lang.Class<V> viewletClass)
Add the given application viewlet with the given title to the current project dashboard.

Note that nothing happens if the viewlet was already displayed in the dashboard.

Parameters:
title - The viewlet title
application - The application from which to select the widget.
Returns:
The viewlet element as a ClmViewlet.

getExpectedTitle

public java.lang.String getExpectedTitle()
Return the expected title.

By default this is the banner title + " Project Dashboard"

Returns:
The dashboard expected title Design Note that the dashboard title can be modified by user, hence that should not be a static value...

getViewletElement

public <V extends ClmViewlet> V getViewletElement(java.lang.String title,
                                                  java.lang.Class<V> viewletClass)
Return the viewlet web element matching the given title.

Note that if there are several viewlets with the same title, that will be the first one found which will be returned.

Parameters:
title - The viewlet title
Returns:
The viewlet element as a ClmViewlet or null if no viewlet with the given title is found in the current project dashboard.

getViewletElements

public java.util.List<com.ibm.team.fvt.tests.web.WebBrowserElement> getViewletElements()
Return all the viewlet web elements displayed in the current project dashboard page.

Returns:
The viewlet elements as a List ofClmViewlet.

isProjectDashboardPageHelper

public boolean isProjectDashboardPageHelper()
Overrides:
isProjectDashboardPageHelper in class ClmWebPageHelper

refreshContent

public void refreshContent()
Refresh the page content by clicking on the Refresh button.


setAutoSave

public void setAutoSave(boolean on)
Check on/off the Auto Save for the current dashboard.

Parameters:
on - Tells whether the auto-save has to be set or unset.

waitForAllViewlets

public void waitForAllViewlets()
Wait that all viewlets are displayed in the dashboard page.

Throws:
com.ibm.team.fvt.tests.scenario.errors.WaitElementTimeoutError - If the viewlets number is still not stabilized when the WebPageElement.shortTimeout() is reached.

waitForAllViewletsLoaded

public void waitForAllViewletsLoaded()
                              throws com.ibm.team.fvt.tests.scenario.errors.WaitElementTimeoutError
Wait for all viewlets to be loaded.

Note that this operation can take a long while as it reads all viewlets contents to see if it does not start with 'Loading...'.

Throws:
com.ibm.team.fvt.tests.scenario.errors.WaitElementTimeoutError - If there's at least one viewlet still displaying 'Loading...' when the WebPageElement.openTimeout() is reached.