com.ibm.team.fvt.tests.clm.pages.ccm
Class CcmWebWorkItemPage

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebPage
      extended by com.ibm.team.fvt.tests.clm.pages.ClmWebPage
          extended by com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebPage
              extended by com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebProjectAreaPage
                  extended by com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebTabsPage
                      extended by com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebWorkItemPage
All Implemented Interfaces:
ClmWebPageConstants

public class CcmWebWorkItemPage
extends CcmWebTabsPage

Manage the CCM work item web page.

The page address is given by CcmApplication.getPlansUrl(String, String).

Following actions are accessible on this page:

Following functionalities are also defined or specialized by this page:


Field Summary
 
Fields inherited from class com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebTabsPage
AFFECTED_BY_DEFECT, AFFECTS_PLAN_ITEM, AFFECTS_REQUIREMENT, ELABORATES_BY_ARCHITECTURE_ELEMENT, IMPLEMENTS_REQUIREMENT, RELATED_TEST_CASE, TESTED_BY_TEST_CASE, TRACKS_REQUIREMENT
 
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
CcmWebWorkItemPage(java.lang.String url, ClmConfig config, com.ibm.team.fvt.tests.config.User user)
           
CcmWebWorkItemPage(java.lang.String url, ClmConfig config, com.ibm.team.fvt.tests.config.User user, java.lang.String... data)
           
 
Method Summary
 void addComment(java.lang.String comment)
          Add the given text as comment of current work item.
 void addLink(java.lang.String resource, java.lang.String linkType)
          Deprecated. Use either addRequirementLink(String, String, String) when adding a requirement link or addTestCaseLink(String, String) when adding a test case link
 com.ibm.team.fvt.tests.web.WebBrowserElement addParent(java.lang.String workItemTitle)
          Add the work item with the given title as parent of the current work item.
 void addRequirementLink(java.lang.String requirement, java.lang.String linkType, java.lang.String projectAreaName)
          Add a link to the given requirement for the current work item.
 void addTestCaseLink(java.lang.String testCase, java.lang.String linkType)
          Add a link to the given test case for the current work item.
 java.lang.String getComment(int index)
          Get the work item comment at the given index.
 java.lang.String getLastComment()
          Get the last work item comment.
 com.ibm.team.fvt.tests.web.WebBrowserElement getLinkElement(java.lang.String resource, java.lang.String linkType)
          Get the element of the given resource for the given link.
 java.lang.String getStatus()
          Get the work item status.
 java.lang.String getTitle()
          Return the title of the page.
 java.lang.String getWorkItemID()
          Return the work item number.
 java.lang.String getWorkItemReference()
          Return the reference of the work item which is the concatenation of its number and its summary.
 java.lang.String getWorkItemSummary()
          Return the work item summary.
 java.lang.String getWorkItemTitle()
          Return the title of the work item which is the concatenation of its number and its summary.
 RmWebShowRequirementPage gotoAffectsRequirementPageUsingHover(java.lang.String requirement)
          Goto the given requirement page using the hover of the CcmWebTabsPage.AFFECTS_REQUIREMENT link displayed in the current page 'Links' section.
 CcmWebWorkItemPage gotoDefectPageUsingHover(java.lang.String item)
          Goto the given work item page using the hover of the CcmWebTabsPage.AFFECTED_BY_DEFECT link displayed in the current page 'Links' section.
 DmWebDocumentPage gotoElaboratesDocumentUsingHover(java.lang.String documentTitle)
          Goto the given DM document page using the hover of the CcmWebTabsPage.ELABORATES_BY_ARCHITECTURE_ELEMENT link displayed in the current page 'Links' section.
 RmWebShowRequirementPage gotoImplementsRequirementPageUsingHover(java.lang.String requirement)
          Goto the given requirement page using the hover of the CcmWebTabsPage.IMPLEMENTS_REQUIREMENT link displayed in the current page 'Links' section.
 CcmWebWorkItemPage gotoPlanItemPageUsingHover(java.lang.String item)
          Goto the given work item page using the hover of the CcmWebTabsPage.AFFECTS_PLAN_ITEM link displayed in the current page 'Links' section.
 QmWebViewTestCasePage gotoRelatedTestCasePageUsingHover(java.lang.String testCase)
          Goto the given test case page using the hover of the CcmWebTabsPage.RELATED_TEST_CASE link displayed in the current page 'Links' section.
 QmWebViewTestCasePage gotoTestCasePageUsingQuickInformation(java.lang.String linkInfo)
          Goto the test case page using its number displayed in the quick information.
 QmWebViewTestCasePage gotoTestedByTestCasePageUsingHover(java.lang.String testCase)
          Goto the given test case page using the hover of the CcmWebTabsPage.TESTED_BY_TEST_CASE link displayed in the current page 'Links' section.
 RmWebShowRequirementPage gotoTracksRequirementPageUsingHover(java.lang.String requirement)
          Goto the given requirement page using the hover of the CcmWebTabsPage.TRACKS_REQUIREMENT link displayed in the current page 'Links' section.
 CcmWebWorkItemPage gotoWorkItemPageUsingQuickInformation(java.lang.String linkInfo)
          Goto the work item page using its number displayed in the quick information.
 boolean isLinkedTo(java.lang.String resource, java.lang.String linkType)
          Returns whether the current work item is linked to the given resource with the given link type.
 boolean save()
          Save changes done in the current web page.
 void setBusinessValue(java.lang.String value)
          Set the 'Business Value' drop-down with list selection to the given project.
 void setOwner(com.ibm.team.fvt.tests.config.User user)
          Set the 'Owned by' drop-down list selection to the given user name.
 void setPlannedFor(java.lang.String release)
          Set the 'Planned For' drop-down list selection to the given release.
 void setProject(java.lang.String project)
          Set the 'Filed Against' drop-down list selection to the given project.
 void setStatus(java.lang.String status)
          Set the 'Status' selection with the given status.
 void setSummary(java.lang.String summary)
          Set the 'Summary' input field with the given text.
 
Methods inherited from class com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebTabsPage
selectTab
 
Methods inherited from class com.ibm.team.fvt.tests.clm.pages.ccm.CcmWebProjectAreaPage
createNewDevelopmentPlan, createNewWorkItem, createNewWorkItem, getProjectAreaName, getProjectAreaTitle, gotoDevelopmentPlanPage, gotoPlansPage, gotoQueriesPage, gotoReportsPage, gotoWorkItemPage, refreshContent, searchForArtifact
 
Methods inherited from class com.ibm.team.fvt.tests.clm.pages.ClmWebPage
checkRichHover, clickHomeMenuItem, getBannerTitle, getCcmApplication, getConfig, getDmApplication, getJtsApplication, getLpaApplication, getMiniDashboard, getQmApplication, getRmApplication, getUser, gotoCcmProjectPage, gotoCcmProjectPage, gotoDmProjectPage, gotoDmProjectPage, gotoJtsAdminHomePage, gotoLpaAllProjectsPage, gotoQmProjectPage, gotoQmProjectPage, gotoRmProjectPage, gotoRmProjectPage, logout, openAdminUIMenu, openHelpMenu, openHomeMenu, openMenu, openMenu, openToolbarMenu, openUserProfileMenu, refresh, waitWhileBusy
 
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

CcmWebWorkItemPage

public CcmWebWorkItemPage(java.lang.String url,
                          ClmConfig config,
                          com.ibm.team.fvt.tests.config.User user)

CcmWebWorkItemPage

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

addComment

public void addComment(java.lang.String comment)
Add the given text as comment of current work item.

Parameters:
comment - The text to add as comment

addLink

@Deprecated
public void addLink(java.lang.String resource,
                               java.lang.String linkType)
Deprecated. Use either addRequirementLink(String, String, String) when adding a requirement link or addTestCaseLink(String, String) when adding a test case link

Add the given link type to the given resource for the current work item.

The added link is checked by hovering and the work item is saved.

Parameters:
resource - The resource name
linkType - The link type

addParent

public com.ibm.team.fvt.tests.web.WebBrowserElement addParent(java.lang.String workItemTitle)
Add the work item with the given title as parent of the current work item.

Note that current item is saved after having add the parent link.

Parameters:
workItemTitle - The title of the work item to be added as parent

addRequirementLink

public void addRequirementLink(java.lang.String requirement,
                               java.lang.String linkType,
                               java.lang.String projectAreaName)
Add a link to the given requirement for the current work item.

The added link is checked by hovering and the work item is saved.

Parameters:
requirement - The requirement name
linkType - The link type
projectAreaName - The RM project area name belonging the requirement

addTestCaseLink

public void addTestCaseLink(java.lang.String testCase,
                            java.lang.String linkType)
Add a link to the given test case for the current work item.

The added link is checked by hovering and the work item is saved.

Parameters:
testCase - The test case name
linkType - The link type

getComment

public java.lang.String getComment(int index)
Get the work item comment at the given index.

Parameters:
index - The comment index
Returns:
The comment at the given index
Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - if the given index is out of scope

getLastComment

public java.lang.String getLastComment()
Get the last work item comment.

Returns:
The last comment or null if there's no comment. TODO Need improvement

getLinkElement

public com.ibm.team.fvt.tests.web.WebBrowserElement getLinkElement(java.lang.String resource,
                                                                   java.lang.String linkType)
Get the element of the given resource for the given link.

If the given resource is null, then it will return the first element found for the given link type.

Parameters:
resource - The resource name.
linkType - The type of the link
Returns:
The link element as a WebBrowserElement or null if the expected link does not exist.

getStatus

public java.lang.String getStatus()
Get the work item status.

Returns:
The status as a String.

getTitle

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

As the title element is an input field, it's value is got from the "value" attribute.

Overrides:
getTitle in class ClmWebPage
Returns:
The title as a String.

getWorkItemID

public java.lang.String getWorkItemID()
Return the work item number.

Returns:
The work item number as a String.

getWorkItemReference

public java.lang.String getWorkItemReference()
Return the reference of the work item which is the concatenation of its number and its summary.

Returns:
The work item title as a String.

getWorkItemSummary

public java.lang.String getWorkItemSummary()
Return the work item summary.

Returns:
The work item summary as a String.

getWorkItemTitle

public java.lang.String getWorkItemTitle()
Return the title of the work item which is the concatenation of its number and its summary.

Returns:
The work item title as a String.

gotoAffectsRequirementPageUsingHover

public RmWebShowRequirementPage gotoAffectsRequirementPageUsingHover(java.lang.String requirement)
Goto the given requirement page using the hover of the CcmWebTabsPage.AFFECTS_REQUIREMENT link displayed in the current page 'Links' section.

If the given requirement is null, then it will return the first element found for the CcmWebTabsPage.AFFECTS_REQUIREMENT link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
requirement - The requirement name to find the link in the current page.
Returns:
The opened RM requirement page as RmWebShowRequirementPage.

gotoDefectPageUsingHover

public CcmWebWorkItemPage gotoDefectPageUsingHover(java.lang.String item)
Goto the given work item page using the hover of the CcmWebTabsPage.AFFECTED_BY_DEFECT link displayed in the current page 'Links' section.

If the given item is null, then it will return the first element found for the CcmWebTabsPage.AFFECTED_BY_DEFECT link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
item - The work item name to find the link in the current page.
Returns:
The opened CCM work item page as CcmWebWorkItemPage.

gotoElaboratesDocumentUsingHover

public DmWebDocumentPage gotoElaboratesDocumentUsingHover(java.lang.String documentTitle)
Goto the given DM document page using the hover of the CcmWebTabsPage.ELABORATES_BY_ARCHITECTURE_ELEMENT link displayed in the current page 'Links' section.

If the given item is null, then it will return the first element found for the CcmWebTabsPage.ELABORATES_BY_ARCHITECTURE_ELEMENT link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
documentTitle - The design document title to find the link in the current page.
Returns:
The opened DM document page as DmWebDocumentPage.

gotoImplementsRequirementPageUsingHover

public RmWebShowRequirementPage gotoImplementsRequirementPageUsingHover(java.lang.String requirement)
Goto the given requirement page using the hover of the CcmWebTabsPage.IMPLEMENTS_REQUIREMENT link displayed in the current page 'Links' section.

If the given requirement is null, then it will return the first element found for the CcmWebTabsPage.IMPLEMENTS_REQUIREMENT link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
requirement - The requirement name to find the link in the current page.
Returns:
The opened RM requirement page as RmWebShowRequirementPage.

gotoPlanItemPageUsingHover

public CcmWebWorkItemPage gotoPlanItemPageUsingHover(java.lang.String item)
Goto the given work item page using the hover of the CcmWebTabsPage.AFFECTS_PLAN_ITEM link displayed in the current page 'Links' section.

If the given item is null, then it will return the first element found for the CcmWebTabsPage.AFFECTS_PLAN_ITEM link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
item - The work item name to find the link in the current page.
Returns:
The opened QM test case page as CcmWebWorkItemPage.

gotoRelatedTestCasePageUsingHover

public QmWebViewTestCasePage gotoRelatedTestCasePageUsingHover(java.lang.String testCase)
Goto the given test case page using the hover of the CcmWebTabsPage.RELATED_TEST_CASE link displayed in the current page 'Links' section.

If the given test case is null, then it will return the first element found for the CcmWebTabsPage.RELATED_TEST_CASE link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
testCase - The test case name to find the link in the current page.
Returns:
The opened QM test case page as QmWebViewTestCasePage.

gotoTestCasePageUsingQuickInformation

public QmWebViewTestCasePage gotoTestCasePageUsingQuickInformation(java.lang.String linkInfo)
Goto the test case page using its number displayed in the quick information.

Parameters:
linkInfo - The piece of information to find the link in the quick information block.
Returns:
The opened work item page as a QmWebViewTestCasePage.

gotoTestedByTestCasePageUsingHover

public QmWebViewTestCasePage gotoTestedByTestCasePageUsingHover(java.lang.String testCase)
Goto the given test case page using the hover of the CcmWebTabsPage.TESTED_BY_TEST_CASE link displayed in the current page 'Links' section.

If the given test case is null, then it will return the first element found for the CcmWebTabsPage.TESTED_BY_TEST_CASE link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
testCase - The test case name to find the link in the current page.
Returns:
The opened QM test case page as QmWebViewTestCasePage.

gotoTracksRequirementPageUsingHover

public RmWebShowRequirementPage gotoTracksRequirementPageUsingHover(java.lang.String requirement)
Goto the given requirement page using the hover of the CcmWebTabsPage.TRACKS_REQUIREMENT link displayed in the current page 'Links' section.

If the given requirement is null, then it will return the first element found for the CcmWebTabsPage.TRACKS_REQUIREMENT link.

Note that this test the hover as we jump to the page through it's title link (see WebLinkHover.clickOnTitle()).

Parameters:
requirement - The requirement name to find the link in the current page.
Returns:
The opened RM requirement page as RmWebShowRequirementPage.

gotoWorkItemPageUsingQuickInformation

public CcmWebWorkItemPage gotoWorkItemPageUsingQuickInformation(java.lang.String linkInfo)
Goto the work item page using its number displayed in the quick information.

Parameters:
linkInfo - The piece of information to find the link in the quick information block.
Returns:
The opened work item page as a CcmWebWorkItemPage.

isLinkedTo

public boolean isLinkedTo(java.lang.String resource,
                          java.lang.String linkType)
Returns whether the current work item is linked to the given resource with the given link type.

Parameters:
resource - The resource name
linkType - The type of link
Returns:
true if a link element has been found with the given type, false otherwise.

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.

Update information after having saved the work item.

Overrides:
save in class ClmWebPage
Returns:
true if the page was saved, false if the save was not necessary.

setBusinessValue

public void setBusinessValue(java.lang.String value)
Set the 'Business Value' drop-down with list selection to the given project.

Valid values are: "Unassigned", "$", "$$", "$$$", "$$$$", "$$$$$"

Parameters:
value - The String value to select in the drop-down list
Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - If an invalid value is given as parameter.

setOwner

public void setOwner(com.ibm.team.fvt.tests.config.User user)
Set the 'Owned by' drop-down list selection to the given user name.

Parameters:
user - The user to select in the drop-down list

setPlannedFor

public void setPlannedFor(java.lang.String release)
Set the 'Planned For' drop-down list selection to the given release.

Parameters:
release - The release to select in the drop-down list

setProject

public void setProject(java.lang.String project)
Set the 'Filed Against' drop-down list selection to the given project.

Parameters:
project - The project to select in the drop-down list

setStatus

public void setStatus(java.lang.String status)
Set the 'Status' selection with the given status.

Parameters:
status - The text to set the status with
Throws:
com.ibm.team.fvt.tests.scenario.errors.ScenarioFailedError - If the status is not valid

setSummary

public void setSummary(java.lang.String summary)
Set the 'Summary' input field with the given text.

Parameters:
summary - The text to put in the input field