Package org.xwiki.test.ui.po
Class CreatePagePage
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.BasePage
-
- org.xwiki.test.ui.po.ViewPage
-
- org.xwiki.test.ui.po.CreatePagePage
-
- Direct Known Subclasses:
CreateSpacePage
public class CreatePagePage extends ViewPage
Represents the actions possible on the Create Page template page.- Since:
- 3.2M3
- Version:
- $Id: 430d3b24acaf6ba5eaa7c814a85ef9648f4d7449 $
-
-
Constructor Summary
Constructors Constructor Description CreatePagePage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clickCreate()
void
clickCreate(boolean waitForSubmit)
Click on the create page button.EditPage
createPage(String spaceValue, String pageValue)
EditPage
createPage(String spaceValue, String pageValue, boolean isTerminalPage)
EditPage
createPage(String title, String spaceValue, String pageValue, boolean isTerminalPage)
EditPage
createPageFromTemplate(String spaceValue, String pageValue, String templateValue)
EditPage
createPageFromTemplate(String spaceValue, String pageValue, String templateValue, boolean isTerminalPage)
EditPage
createPageFromTemplate(String title, String spaceValue, String pageValue, String templateValue)
EditPage
createPageFromTemplate(String title, String spaceValue, String pageValue, String templateValue, boolean isTerminalPage)
void
fillForm(String title, String spaceReference, String pageName, boolean isTerminalPage)
List<String>
getAvailableTemplates()
int
getAvailableTemplateSize()
DocumentPicker
getDocumentPicker()
String
getErrorMessage()
static CreatePagePage
gotoPage()
boolean
isTerminalOptionDisplayed()
boolean
isTerminalPage()
void
setTemplate(String template)
void
setTerminalPage(boolean isTerminalPage)
void
setType(String type)
void
waitForErrorMessage()
Waits for a global error message in the page.void
waitForFieldErrorMessage()
Waits for a validation error in a field.void
waitForLocationPreviewContent(String expectedPathString)
Wait for the location preview to display the passed path string and throw an exception if the timeout is reached.-
Methods inherited from class org.xwiki.test.ui.po.ViewPage
clickBreadcrumbLink, clickWantedLink, clickWantedLink, contentContainsElement, editSection, exists, getBreadcrumb, getBreadcrumbContent, getContent, getLastModifiedText, getPageBackgroundColor, getTitleColor, getTitleFontFamily, getTranslateButton, hasBreadcrumbContent, hasBreadcrumbContent, hasTranslateButton, isInlinePage, openCommentsDocExtraPane, openHistoryDocExtraPane, openInformationDocExtraPane, scrollToTop, useShortcutForDocExtraPane, useShortcutKeyForCommentPane, useShortcutKeyForHistoryPane, useShortcutKeyForInformationPane, waitForDocExtraPaneActive, waitUntilContent
-
Methods inherited from class org.xwiki.test.ui.po.BasePage
canDelete, clickAdminActionsSubMenuEntry, clickEditSubMenuEntry, clickLocale, clickMoreActionsSubMenuEntry, copy, createInlinePage, createPage, delete, deletePage, edit, editClass, editInline, editObjects, editRights, editWiki, editWYSIWYG, getCurrentUser, getDocumentTitle, getDrawerMenu, getEditURL, getErrorContent, getHTMLMetaDataValue, getLocales, getMetaDataValue, getPageTitle, getPageURL, getXWikiMessageContent, hasLeftPanel, hasLoginLink, hasNotificationsMenu, hasRenderingError, isAuthenticated, isForbidden, isNewDocument, isNotificationsMenuOpen, login, logout, register, reloadPage, rename, sendKeys, toggleActionMenu, toggleNotificationsMenu, useShortcutKeyForClassEditing, useShortcutKeyForEditing, useShortcutKeyForInlineEditing, useShortcutKeyForObjectEditing, useShortcutKeyForPageDeletion, useShortcutKeyForPageRenaming, useShortcutKeyForRightsEditing, useShortcutKeyForSourceViewer, useShortcutKeyForWikiEditing, useShortcutKeyForWysiwygEditing, validateWCAG, validateWCAG, validateWCAG, viewChildren, watchDocument, watchSpace, watchWiki
-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Method Detail
-
gotoPage
public static CreatePagePage gotoPage()
-
getDocumentPicker
public DocumentPicker getDocumentPicker()
- Returns:
- the document picker used to select the target document
-
getAvailableTemplateSize
public int getAvailableTemplateSize()
- Since:
- 3.2M3
-
setTemplate
public void setTemplate(String template)
-
setType
public void setType(String type)
-
clickCreate
public void clickCreate()
-
clickCreate
public void clickCreate(boolean waitForSubmit)
Click on the create page button.- Parameters:
waitForSubmit
- whether to wait for the form to be submitted or not- Since:
- 14.8RC1
-
createPage
public EditPage createPage(String title, String spaceValue, String pageValue, boolean isTerminalPage)
- Since:
- 7.2M3
-
createPageFromTemplate
public EditPage createPageFromTemplate(String spaceValue, String pageValue, String templateValue)
-
createPageFromTemplate
public EditPage createPageFromTemplate(String title, String spaceValue, String pageValue, String templateValue)
-
createPageFromTemplate
public EditPage createPageFromTemplate(String spaceValue, String pageValue, String templateValue, boolean isTerminalPage)
- Since:
- 7.2M1
-
createPageFromTemplate
public EditPage createPageFromTemplate(String title, String spaceValue, String pageValue, String templateValue, boolean isTerminalPage)
- Since:
- 7.2M3
-
fillForm
public void fillForm(String title, String spaceReference, String pageName, boolean isTerminalPage)
- Parameters:
title
- document title, ignored ifnull
spaceReference
- document's space reference (parent nested document), ignored ifnull
pageName
- document's name (space name or page name, depending if terminal or not), ignored ifnull
isTerminalPage
- true if the new document is terminal, false for non-terminal- Since:
- public since 7.4M2
-
waitForErrorMessage
public void waitForErrorMessage()
Waits for a global error message in the page.- Since:
- 3.2M3
-
getErrorMessage
public String getErrorMessage()
- Returns:
- the content of the error message.
- Since:
- 11.4RC1
-
waitForFieldErrorMessage
public void waitForFieldErrorMessage()
Waits for a validation error in a field.- Since:
- 3.2M3
-
isTerminalPage
public boolean isTerminalPage()
- Returns:
- true if the page to create should be a terminal page, false otherwise
- Since:
- 7.2M1
-
setTerminalPage
public void setTerminalPage(boolean isTerminalPage)
- Parameters:
isTerminalPage
- true if the page to create is terminal, false otherwise- Since:
- 7.2M1
-
isTerminalOptionDisplayed
public boolean isTerminalOptionDisplayed()
- Returns:
- true if the choice between terminal or non-terminal document is displayed, false otherwise.
- Since:
- 7.2M3
-
waitForLocationPreviewContent
public void waitForLocationPreviewContent(String expectedPathString)
Wait for the location preview to display the passed path string and throw an exception if the timeout is reached. Note that we need to wait since the Breadcrumb is updated live and asserting its content without waiting would lead to false positives.Note: This method can not be implemented inside
BreadcrumbElement
because a change of parent replaces completely theBreadcrumbElement
's container and thus it becomes stale. To avoid that, at each wait iteration, we lookup the current breadcrumb element and not a cached one.TODO: Reuse
DocumentPicker
inside this PO instead of duplicating this method.- Parameters:
expectedPathString
- the path string to wait for- Since:
- 7.2RC1
-
-