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 class
EditPage.Editor
Enumerates the available editors.
-
Field Summary
Fields Modifier and Type Field Description protected org.openqa.selenium.WebElement
cancel
protected org.openqa.selenium.WebElement
currentEditorDiv
protected org.openqa.selenium.WebElement
save
protected org.openqa.selenium.WebElement
saveandcontinue
protected org.openqa.selenium.WebElement
syntaxIdSelect
-
Constructor Summary
Constructors Constructor Description EditPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ViewPage
clickCancel()
void
clickCancelCSRFWarningButton()
void
clickForceSaveCSRFButton()
void
clickSaveAndContinue()
void
clickSaveAndContinue(boolean wait)
Clicks on the Save and Continue button.<T extends ViewPage>
TclickSaveAndView()
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.WikiEditPage
clickTranslate(String locale)
String
getDefaultLanguage()
String
getDocumentTitle()
EditPage.Editor
getEditor()
Set<Locale>
getExistingLocales()
protected Set<Locale>
getExistingLocales(List<org.openqa.selenium.WebElement> elements)
Set<Locale>
getNotExistingLocales()
String
getParent()
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
.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
.String
getSyntaxId()
boolean
isCSRFWarningDisplayed()
void
setDefaultLanguage(String defaultLanguage)
Set the default language input field.void
setSyntaxId(String syntaxId)
ViewPage
useShortcutKeyForCancellingEdition()
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, 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
-
-
-
-
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
-true
to wait for the page to be saved,false
otherwise
-
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:
getDocumentTitle
in 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()
-
-