com.ibm.team.fvt.tests.clm.pages
Class ClmWebPage

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebPage
      extended by com.ibm.team.fvt.tests.clm.pages.ClmWebPage
All Implemented Interfaces:
ClmWebPageConstants
Direct Known Subclasses:
CcmWebPage, ClmAdminWebPage, DmWebPage, JtsWebPage, LpaWebPage, QmWebPage, RmWebPage, VvcConfigurationWebPage

public abstract class ClmWebPage
extends com.ibm.team.fvt.tests.web.WebPage
implements ClmWebPageConstants

Manage all common actions to any CLM application web page.

This kind of page always have a title, hence it's loaded (see isLoaded(), load() and waitForTitle(boolean)) when the title web element is found and its text equals to the expected title (see getExpectedTitle()).

The first thing that all CLM web page have in common is the Home Menu. Using this menu, users are able to access any application project area. It can also directly jump to the JTS Admin Home page and the LPA All Projects page.

This class provides access to the following CLM web pages through the Home Menu:

It also provides some information or functionalities available on any CLM web pages accessible at this hierarchy level:

It also provides easy access to menus information:

It also provides some high level actions or functionalities common to all CLM pages:

Additionally, it also provides some common code that subclasses can use in separated branches of the hierarchy tree:

Finally, it provides some useful methods to easily access configuration information:


Field Summary
 
Fields inherited from class com.ibm.team.fvt.tests.web.WebPage
NO_DATA
 
Fields inherited from interface com.ibm.team.fvt.tests.clm.pages.ClmWebPageConstants
ADMINISTRATION_HOME_MENU_GROUP, JAZZ_TEAM_SERVER_HOME_MENU_ITEM, LIFECYCLE_PROJECT_ADMIN_MENU_ITEM, USER_NOT_AUTHORIZED_MESSAGE_ID, USER_NOT_AUTHORIZED_MESSAGE_LOCATOR
 
Constructor Summary
ClmWebPage(java.lang.String url, ClmConfig config, com.ibm.team.fvt.tests.config.User user, java.lang.String... data)
           
 
Method Summary
<RH extends com.ibm.team.fvt.tests.web.WebRichHover<? extends com.ibm.team.fvt.tests.web.WebPage>>
RH
checkRichHover(java.lang.String resource, java.lang.Class<RH> hoverClass, java.lang.String... additionalData)
          Check the rich hover title of the given resource found using the waitForResourceLinkElement(WebBrowserElement, String) method.
<P extends ClmWebPage>
P
clickHomeMenuItem(java.lang.String group, java.lang.String itemName, java.lang.Class<P> pageClass, java.lang.String... info)
          Click on the given Home Menu item.
 java.lang.String getBannerTitle()
          Return the current CLM page banner title.
 CcmApplication getCcmApplication()
           
 ClmConfig getConfig()
          
 DmApplication getDmApplication()
           
 JtsApplication getJtsApplication()
           
 LpaApplication getLpaApplication()
           
 ClmMiniDashboard getMiniDashboard(boolean expanded)
          Get the mini-dashboard.
 QmApplication getQmApplication()
           
 ClmApplication getRmApplication()
           
 java.lang.String getTitle()
          Return the title of the page.
 ClmUser getUser()
          
 CcmWebProjectDashboardPage gotoCcmProjectPage(java.lang.String projectName)
          Go to the CCM project dashboard page using Change and Configuration Management -> projectName menu item.
 CcmWebProjectDashboardPage gotoCcmProjectPage(java.lang.String projectName, java.lang.String dashboardName)
          Go to the CCM project dashboard page using Change and Configuration Management -> projectName menu item.
 DmWebProjectDashboardPage gotoDmProjectPage(java.lang.String projectName)
          Go to the DM project dashboard page using Design Management -> projectName menu item.
 DmWebProjectDashboardPage gotoDmProjectPage(java.lang.String projectName, java.lang.String dashboardName)
          Go to the DM project dashboard page using Design Management -> projectName menu item.
 JtsAdminHomePage gotoJtsAdminHomePage()
          Go to the JTS Admin Home page using Administration -> Jazz Team Server Home menu item.
 LpaWebAllProjectsPage gotoLpaAllProjectsPage()
          Go to the LPA All Projects Home page using Administration -> Lifecycle Project Administration menu item.
 QmWebProjectDashboardPage gotoQmProjectPage(java.lang.String projectName)
          Go to the QM project dashboard page using Quality Management -> projectName menu item.
 QmWebProjectDashboardPage gotoQmProjectPage(java.lang.String projectName, java.lang.String dashboardName)
          Go to the QM project dashboard page using Quality Management -> projectName menu item.
 RmWebProjectDashboardPage gotoRmProjectPage(java.lang.String projectName)
          Go to the RM project dashboard page using Requirement Management -> projectName menu item.
 RmWebProjectDashboardPage gotoRmProjectPage(java.lang.String projectName, java.lang.String dashboardName)
          Go to the RM project dashboard page using Requirement Management -> projectName menu item.
 boolean logout(com.ibm.team.fvt.tests.config.User newUser)
          Logout the current user from the current CLM page.
 ClmMenu openAdminUIMenu()
          Open the Administration menu.
 ClmMenu openHelpMenu()
          Open the Help menu.
 ClmHomeMenu openHomeMenu()
          Open the Home Menu.
 ClmMenu openMenu(org.openqa.selenium.By menuBy, org.openqa.selenium.By linkBy)
          Open a menu by clicking on the link element found using the given search mechanism.
 ClmMenu openMenu(java.lang.String menuId, org.openqa.selenium.By linkBy)
          Open a menu by clicking on the link element found using the given id.
 ClmToolbarMenu openToolbarMenu(java.lang.String menuId, org.openqa.selenium.By linkBy)
          Open a CLM toolbar menu by clicking on the link element found using the given id.
 ClmMenu openUserProfileMenu()
          Open the Users menu and return the corresponding object.
 void refresh()
          
 boolean save()
          Save changes done in the current web page.
 void waitWhileBusy()
          Wait while the page is busy.
 
Methods inherited from class com.ibm.team.fvt.tests.web.WebPage
changeUser, checkHoverTitle, checkRichHover, get, getBrowser, getLocation, getPage, getPage, getPageUsingBrowser, goBack, openPage, openPage, openPageUsingBrowser, openPageUsingHoverTitle, openPageUsingLink, openPageUsingLink, openPageUsingLink, openPageUsingLink, openPageUsingLink, openPageUsingLink, richHoverOverLink, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClmWebPage

public ClmWebPage(java.lang.String url,
                  ClmConfig config,
                  com.ibm.team.fvt.tests.config.User user,
                  java.lang.String... data)
Method Detail

checkRichHover

public <RH extends com.ibm.team.fvt.tests.web.WebRichHover<? extends com.ibm.team.fvt.tests.web.WebPage>> RH checkRichHover(java.lang.String resource,
                                                                                                                            java.lang.Class<RH> hoverClass,
                                                                                                                            java.lang.String... additionalData)
Check the rich hover title of the given resource found using the waitForResourceLinkElement(WebBrowserElement, String) method.

This check opens the rich hover by positioning the mouse pointer over the given link element and checks whether its title matches the given text.

Type Parameters:
RH - The expected class for the hover
Parameters:
resource - The resource name
hoverClass - The expected class for the hover
additionalData - Additional data to check in the rich hover
Returns:
The opened rich hover web element as WebBrowserElement
Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - in following cases:
  • The rich hover is not found (typically when it fails to open)
  • The rich hover title is not found after WebPage.shortTimeout() (typically when the hover is still empty when the timeout is reached)
  • The title does not match the expected one

clickHomeMenuItem

public <P extends ClmWebPage> P clickHomeMenuItem(java.lang.String group,
                                                  java.lang.String itemName,
                                                  java.lang.Class<P> pageClass,
                                                  java.lang.String... info)
Click on the given Home Menu item.

Parameters:
itemName - The Home Menu item to click on
pageClass - The class of the opened page after having clicked on the item
Returns:
The opened page

getBannerTitle

public java.lang.String getBannerTitle()
Return the current CLM page banner title.

Returns:
The banner title as a String

getCcmApplication

public CcmApplication getCcmApplication()
See Also:
ClmTopology.getCcmApplication()

getConfig

public ClmConfig getConfig()

Overrides:
getConfig in class com.ibm.team.fvt.tests.web.WebPage
Returns:
The configuration as a ClmConfig.

getDmApplication

public DmApplication getDmApplication()
See Also:
ClmTopology.getDmApplication(boolean)

getJtsApplication

public JtsApplication getJtsApplication()
See Also:
ClmTopology.getJtsApplication()

getLpaApplication

public LpaApplication getLpaApplication()
See Also:
ClmTopology.getLpaApplication()

getMiniDashboard

public ClmMiniDashboard getMiniDashboard(boolean expanded)
Get the mini-dashboard.

Note that the mini-dashboard is stored in the web page. If it has become stale for any page html content refresh, then it's automatically searched again ensuring that the returned element is ready to be used without any trouble.

Parameters:
expanded - Tell whether the mini-dashboard should be expanded when returned or just get it in the current state.
Returns:
The opened mini-dashboard as a ClmMiniDashboard.

getQmApplication

public QmApplication getQmApplication()
See Also:
ClmTopology.getQmApplication()

getRmApplication

public ClmApplication getRmApplication()
See Also:
ClmTopology.getRmApplication()

getTitle

public java.lang.String getTitle()
Return the title of the page.

Returns:
The title as a String.

getUser

public ClmUser getUser()

Overrides:
getUser in class com.ibm.team.fvt.tests.web.WebPage
Returns:
The user as a ClmUser.

gotoCcmProjectPage

public CcmWebProjectDashboardPage gotoCcmProjectPage(java.lang.String projectName)
Go to the CCM project dashboard page using Change and Configuration Management -> projectName menu item.

When using this method, it's assumed that the dashboard name is the CCM project name.

Parameters:
projectName - The project to jump to
Returns:
The opened CCM project dashboard page as CcmWebProjectDashboardPage

gotoCcmProjectPage

public CcmWebProjectDashboardPage gotoCcmProjectPage(java.lang.String projectName,
                                                     java.lang.String dashboardName)
Go to the CCM project dashboard page using Change and Configuration Management -> projectName menu item.

Parameters:
projectName - The project to jump to
dashboardName - The name of the project dashboard
Returns:
The opened CCM project dashboard page as CcmWebProjectDashboardPage

gotoDmProjectPage

public DmWebProjectDashboardPage gotoDmProjectPage(java.lang.String projectName)
Go to the DM project dashboard page using Design Management -> projectName menu item.

When using this method, it's assumed that the dashboard name is the DM project name.

Note that a ScenarioFailedError error will be raised if the scenario topology is not supposed to includes DM application.

Parameters:
projectName - The project to jump to
Returns:
The opened DM project dashboard page as DmWebProjectDashboardPage

gotoDmProjectPage

public DmWebProjectDashboardPage gotoDmProjectPage(java.lang.String projectName,
                                                   java.lang.String dashboardName)
Go to the DM project dashboard page using Design Management -> projectName menu item.

Note that a ScenarioFailedError error will be raised if the scenario topology is not supposed to includes DM application.

Parameters:
projectName - The project to jump to
dashboardName - The name of the project dashboard
Returns:
The opened DM project dashboard page as DmWebProjectDashboardPage

gotoJtsAdminHomePage

public JtsAdminHomePage gotoJtsAdminHomePage()
Go to the JTS Admin Home page using Administration -> Jazz Team Server Home menu item.

Returns:
The opened JTS Admin Home page as JtsAdminHomePage

gotoLpaAllProjectsPage

public LpaWebAllProjectsPage gotoLpaAllProjectsPage()
Go to the LPA All Projects Home page using Administration -> Lifecycle Project Administration menu item.

Returns:
The opened LPA All Projects page as LpaWebAllProjectsPage

gotoQmProjectPage

public QmWebProjectDashboardPage gotoQmProjectPage(java.lang.String projectName)
Go to the QM project dashboard page using Quality Management -> projectName menu item.

When using this method, it's assumed that the dashboard name is the RM project name + " Project Dashboard".

Parameters:
projectName - The project to jump to
Returns:
The opened QM project dashboard page as QmWebProjectDashboardPage

gotoQmProjectPage

public QmWebProjectDashboardPage gotoQmProjectPage(java.lang.String projectName,
                                                   java.lang.String dashboardName)
Go to the QM project dashboard page using Quality Management -> projectName menu item.

Parameters:
projectName - The project to jump to
dashboardName - The name of the project dashboard
Returns:
The opened QM project dashboard page as QmWebProjectDashboardPage

gotoRmProjectPage

public RmWebProjectDashboardPage gotoRmProjectPage(java.lang.String projectName)
Go to the RM project dashboard page using Requirement Management -> projectName menu item.

When using this method, it's assumed that the dashboard name is the RM project name + " Project Dashboard".

Parameters:
projectName - The project to jump to
Returns:
The opened project dashboard page as RmWebProjectDashboardPage

gotoRmProjectPage

public RmWebProjectDashboardPage gotoRmProjectPage(java.lang.String projectName,
                                                   java.lang.String dashboardName)
Go to the RM project dashboard page using Requirement Management -> projectName menu item.

Parameters:
projectName - The project to jump to
dashboardName - The name of the project dashboard
Returns:
The opened project dashboard page as RmWebProjectDashboardPage

logout

public boolean logout(com.ibm.team.fvt.tests.config.User newUser)
Logout the current user from the current CLM page.

TODO Should be login(User) instead...

Overrides:
logout in class com.ibm.team.fvt.tests.web.WebPage

openAdminUIMenu

public ClmMenu openAdminUIMenu()
Open the Administration menu.

Returns:
The menu as a WebMenu.

openHelpMenu

public ClmMenu openHelpMenu()
Open the Help menu.

Returns:
The menu as a ClmMenu.

openHomeMenu

public ClmHomeMenu openHomeMenu()
Open the Home Menu.

Returns:
The Home Menu as a ClmHomeMenu.

openMenu

public ClmMenu openMenu(org.openqa.selenium.By menuBy,
                        org.openqa.selenium.By linkBy)
Open a menu by clicking on the link element found using the given search mechanism. The opened menu is found using the given search mechanism.

Parameters:
menuBy - The mechanism to find the menu when opened
linkBy - The mechanism to find the web element to open the menu
Returns:
The opened menu as ClmMenu

openMenu

public ClmMenu openMenu(java.lang.String menuId,
                        org.openqa.selenium.By linkBy)
Open a menu by clicking on the link element found using the given id. The opened menu is found with the given search mechanism.

Parameters:
menuId - The ID of the popup menu
linkBy - The mechanism to find the web element to open the menu
Returns:
The opened menu as ClmMenu

openToolbarMenu

public ClmToolbarMenu openToolbarMenu(java.lang.String menuId,
                                      org.openqa.selenium.By linkBy)
Open a CLM toolbar menu by clicking on the link element found using the given id. The opened menu is found with the given search mechanism.

Parameters:
menuId - The ID of the popup menu
linkBy - The mechanism to find the web element to open the menu
Returns:
The opened menu as ClmToolbarMenu

openUserProfileMenu

public ClmMenu openUserProfileMenu()
Open the Users menu and return the corresponding object.

Returns:
The menu as ClmToolbarMenu

refresh

public void refresh()

Store that the page has been refreshed. Hence, when used, it's important to reset the flag when possible.

Overrides:
refresh in class com.ibm.team.fvt.tests.web.WebPage

save

public boolean save()
Save changes done in the current web page.

Nothing happen if there's nothing to save (ie. if the button is disabled).

This method only works for CLM web pages which have a 'Save' button. Hence, if a subclass wants to use this generic method, it also has to override methods:

Note that a ScenarioFailedError is raised if one of these methods is not overridden.

Returns:
true if the page was saved, false if the save was not necessary.
Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - If the method is not applicable for the current page (ie. if getSaveButtonXpath() or waitForSavingEnd() methods are not overridden).

waitWhileBusy

public void waitWhileBusy()
Wait while the page is busy.

By default the page is busy if the status message is displayed and the timeout is WebPage.openTimeout() seconds.

Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - If the timeout is reached while the page is still busy.