Package org.xwiki.test.ui.po.editor
Class EditPage
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.test.ui.po.BasePage
-
- org.xwiki.test.ui.po.editor.EditPage
-
- Direct Known Subclasses:
ClassEditPage,ObjectEditPage,PreviewableEditPage,PreviewEditPage
public class EditPage extends BasePage
Represents the common actions possible on all Pages when using the "edit" action.- Since:
- 3.2M3
- Version:
- $Id: 1c0aeff929d6f2fecd191f438fc89ff7d2e10125 $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEditPage.EditorEnumerates the available editors.
-
Field Summary
Fields Modifier and Type Field Description protected org.openqa.selenium.WebElementcancelprotected org.openqa.selenium.WebElementcurrentEditorDivprotected org.openqa.selenium.WebElementsaveprotected org.openqa.selenium.WebElementsaveandcontinueprotected org.openqa.selenium.WebElementsyntaxIdSelect
-
Constructor Summary
Constructors Constructor Description EditPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ViewPageclickCancel()voidclickCancelCSRFWarningButton()voidclickForceSaveCSRFButton()voidclickSaveAndContinue()voidclickSaveAndContinue(boolean wait)Clicks on the Save and Continue button.<T extends ViewPage>
TclickSaveAndView()voidclickSaveAndView(boolean wait)Useful when the save and view operation could fail on the client side and a reload (the view part) might thus not take place.WikiEditPageclickTranslate(String locale)StringgetDefaultLanguage()StringgetDocumentTitle()EditPage.EditorgetEditor()Set<Locale>getExistingLocales()protected Set<Locale>getExistingLocales(List<org.openqa.selenium.WebElement> elements)Set<Locale>getNotExistingLocales()StringgetParent()org.openqa.selenium.WebElementgetSaveAndContinueButton()Use this method instead ofclickSaveAndContinue()and callWebElement.click()when you know that the next page is not a standard XWikiInlinePage.org.openqa.selenium.WebElementgetSaveAndViewButton()Use this method instead ofclickSaveAndView()and callWebElement.click()when you know that the next page is not a standard XWikiInlinePage.StringgetSyntaxId()booleanisCSRFWarningDisplayed()voidsetDefaultLanguage(String defaultLanguage)Set the default language input field.voidsetSyntaxId(String syntaxId)ViewPageuseShortcutKeyForCancellingEdition()Cancel the edition by using keyboard shortcut.-
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, getEditURL, getErrorContent, getHTMLMetaDataValue, getLocales, getMetaDataValue, getPageTitle, getPageURL, hasLeftPanel, hasLoginLink, hasNotificationsMenu, hasRenderingError, hideDrawer, isAuthenticated, isDrawerVisible, isForbidden, isNewDocument, isNotificationsMenuOpen, login, logout, register, reloadPage, rename, sendKeys, showDrawer, toggleActionMenu, toggleDrawer, toggleNotificationsMenu, useShortcutKeyForClassEditing, useShortcutKeyForEditing, useShortcutKeyForInlineEditing, useShortcutKeyForObjectEditing, useShortcutKeyForPageDeletion, useShortcutKeyForPageRenaming, useShortcutKeyForRightsEditing, useShortcutKeyForSourceViewer, useShortcutKeyForWikiEditing, useShortcutKeyForWysiwygEditing, viewChildren, watchDocument, watchSpace, watchWiki
-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Field Detail
-
saveandcontinue
protected org.openqa.selenium.WebElement saveandcontinue
-
save
protected org.openqa.selenium.WebElement save
-
cancel
protected org.openqa.selenium.WebElement cancel
-
currentEditorDiv
protected org.openqa.selenium.WebElement currentEditorDiv
-
syntaxIdSelect
protected org.openqa.selenium.WebElement syntaxIdSelect
-
-
Method Detail
-
clickSaveAndContinue
public void clickSaveAndContinue()
-
clickSaveAndContinue
public void clickSaveAndContinue(boolean wait)
Clicks on the Save and Continue button. Use this instead ofclickSaveAndContinue()when you want to wait for a different message (e.g. an error message).- Parameters:
wait-trueto wait for the page to be saved,falseotherwise
-
getSaveAndContinueButton
public org.openqa.selenium.WebElement getSaveAndContinueButton()
Use this method instead ofclickSaveAndContinue()and callWebElement.click()when you know that the next page is not a standard XWikiInlinePage.- Returns:
- the save and continue button used to submit the form.
-
clickSaveAndView
public <T extends ViewPage> T clickSaveAndView()
-
clickSaveAndView
public void clickSaveAndView(boolean wait)
Useful when the save and view operation could fail on the client side and a reload (the view part) might thus not take place.- Parameters:
wait- if we should wait for the page to be reloaded- Since:
- 7.4M2
-
getSaveAndViewButton
public org.openqa.selenium.WebElement getSaveAndViewButton()
Use this method instead ofclickSaveAndView()and callWebElement.click()when you know that the next page is not a standard XWikiInlinePage.- Returns:
- the save and view button used to submit the form.
-
clickCancel
public ViewPage clickCancel()
-
getEditor
public EditPage.Editor getEditor()
- Returns:
- the editor being used on this page
-
getSyntaxId
public String getSyntaxId()
- Returns:
- the syntax if of the page
- Since:
- 3.2M3
-
setSyntaxId
public void setSyntaxId(String syntaxId)
- Since:
- 3.2M3
-
getParent
public String getParent()
- Returns:
- the value of the parent field.
- Since:
- 7.2M2
-
getDocumentTitle
public String getDocumentTitle()
- Overrides:
getDocumentTitlein classBasePage- Since:
- 7.2M2
-
getExistingLocales
protected Set<Locale> getExistingLocales(List<org.openqa.selenium.WebElement> elements)
-
getExistingLocales
public Set<Locale> getExistingLocales()
- Returns:
- a list of the locales already translated for this document
- Since:
- 9.0RC1
-
getNotExistingLocales
public Set<Locale> getNotExistingLocales()
- Returns:
- a list of the supported locales not yet translated for this document
- Since:
- 9.0RC1
-
clickTranslate
public WikiEditPage clickTranslate(String locale)
- Parameters:
locale- the locale to translate to- Returns:
- the target locale edit page
- Since:
- 9.0RC1
-
setDefaultLanguage
public void setDefaultLanguage(String defaultLanguage)
Set the default language input field.- Parameters:
defaultLanguage- the string to fill the input.- Since:
- 11.3RC1
-
getDefaultLanguage
public String getDefaultLanguage()
-
isCSRFWarningDisplayed
public boolean isCSRFWarningDisplayed()
-
clickCancelCSRFWarningButton
public void clickCancelCSRFWarningButton()
-
clickForceSaveCSRFButton
public void clickForceSaveCSRFButton()
-
-