org.xwiki.test.ui.po
Class BasePage

java.lang.Object
  extended by org.xwiki.test.ui.po.BaseElement
      extended by org.xwiki.test.ui.po.BasePage
Direct Known Subclasses:
AbstractRegistrationPage, ClassEditPage, DocumentDoesNotExistPage, EditPage, ResubmissionPage, ViewPage

public class BasePage
extends BaseElement

Represents the common actions possible on all Pages.

Since:
3.2M3
Version:
$Id: 3bd00677b58cf6482b12c79650cb2b8c1900a4f6 $

Constructor Summary
BasePage()
           
 
Method Summary
 boolean canDelete()
           
protected  void clickContentMenuEditSubMenuEntry(String id)
          Perform a click on a "content menu" sub-menu entry.
protected  void clickContentMenuTopEntry(String id)
          Perform a click on a "content menu" top entry.
 CopyPage copy()
           
protected
<T extends InlinePage>
T
createInlinePage()
          Can be overridden to return extended InlinePage.
 CreatePagePage createPage()
           
 CreateSpacePage createSpace()
           
 ConfirmationPage delete()
           
 void edit()
          Performs a click on the "edit" entry of the content menu.
 ClassEditPage editClass()
          Performs a click on the "edit class" entry of the content menu.
<T extends InlinePage>
T
editInline()
          Performs a click on the "edit inline" entry of the content menu.
 ObjectEditPage editObjects()
          Performs a click on the "edit objects" entry of the content menu.
 RightsEditPage editRights()
          Performs a click on the "edit acces rights" entry of the content menu.
 WikiEditPage editWiki()
          Performs a click on the "edit wiki" entry of the content menu.
 WYSIWYGEditPage editWYSIWYG()
          Performs a click on the "edit wysiwyg" entry of the content menu.
 String getCurrentUser()
           
 String getDocumentTitle()
           
 String getEditURL()
          Gets a string representation of the URL for editing the page.
 String getMetaDataValue(String metaName)
           
 String getPageMenuLink()
           
 String getPageTitle()
           
 String getPageURL()
           
 boolean hasLoginLink()
           
 boolean isAuthenticated()
           
 boolean isNewDocument()
          Determine if the current page is a new document.
 LoginPage login()
           
 void logout()
           
 RegistrationPage register()
           
 void sendKeys(CharSequence... keys)
           
 BasePage waitUntilPageIsLoaded()
          Waits until the page has loaded.
 void watchDocument()
           
 void watchSpace()
           
 
Methods inherited from class org.xwiki.test.ui.po.BaseElement
executeJavascript, getDriver, getUtil, makeAlertDialogSilent, makeConfirmDialogSilent, makeElementVisible, makeElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilElementDisappears, waitUntilElementEndsWithAttributeValue, waitUntilElementHasAttributeValue, waitUntilElementHasTextContent, waitUntilElementIsVisible, waitUntilElementsAreVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePage

public BasePage()
Method Detail

getPageTitle

public String getPageTitle()

getPageURL

public String getPageURL()

getMetaDataValue

public String getMetaDataValue(String metaName)

isAuthenticated

public boolean isAuthenticated()
Returns:
true if we are currently logged in, false otherwise

isNewDocument

public boolean isNewDocument()
Determine if the current page is a new document.

Returns:
true if the document is new, false otherwise

clickContentMenuTopEntry

protected void clickContentMenuTopEntry(String id)
Perform a click on a "content menu" top entry.

Parameters:
id - The id of the entry to follow

clickContentMenuEditSubMenuEntry

protected void clickContentMenuEditSubMenuEntry(String id)
Perform a click on a "content menu" sub-menu entry.

Parameters:
id - The id of the entry to follow

edit

public void edit()
Performs a click on the "edit" entry of the content menu.


getEditURL

public String getEditURL()
Gets a string representation of the URL for editing the page.


editWiki

public WikiEditPage editWiki()
Performs a click on the "edit wiki" entry of the content menu.


editWYSIWYG

public WYSIWYGEditPage editWYSIWYG()
Performs a click on the "edit wysiwyg" entry of the content menu.


editInline

public <T extends InlinePage> T editInline()
Performs a click on the "edit inline" entry of the content menu.


createInlinePage

protected <T extends InlinePage> T createInlinePage()
Can be overridden to return extended InlinePage.


editRights

public RightsEditPage editRights()
Performs a click on the "edit acces rights" entry of the content menu.


editObjects

public ObjectEditPage editObjects()
Performs a click on the "edit objects" entry of the content menu.


editClass

public ClassEditPage editClass()
Performs a click on the "edit class" entry of the content menu.


sendKeys

public void sendKeys(CharSequence... keys)
Since:
3.2M3

waitUntilPageIsLoaded

public BasePage waitUntilPageIsLoaded()
Waits until the page has loaded. Normally we don't need to call this method since a click in Selenium2 is a blocking call. However there are cases (such as when using a shortcut) when we asynchronously load a page.

Returns:
this page
Since:
3.2M3

createPage

public CreatePagePage createPage()
Since:
4.5M1

createSpace

public CreateSpacePage createSpace()
Since:
4.5M1

copy

public CopyPage copy()
Since:
4.5M1

delete

public ConfirmationPage delete()
Since:
4.5M1

canDelete

public boolean canDelete()
Since:
4.5M1

watchDocument

public void watchDocument()
Since:
4.5M1

hasLoginLink

public boolean hasLoginLink()
Since:
4.5M1

login

public LoginPage login()
Since:
4.5M1

getCurrentUser

public String getCurrentUser()
Since:
4.5M1

logout

public void logout()
Since:
4.5M1

register

public RegistrationPage register()
Since:
4.5M1

getDocumentTitle

public String getDocumentTitle()
Since:
4.5M1

watchSpace

public void watchSpace()
Since:
4.5M1

getPageMenuLink

public String getPageMenuLink()
Returns:
the URL of the link representing the current page in the Page top level menu entry
Since:
4.5M1


Copyright © 2004-2013 XWiki. All Rights Reserved.