Class AttachmentGalleryPicker
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.attachment.picker.test.po.AttachmentGalleryPicker
-
public class AttachmentGalleryPicker extends BaseElement
Page object for an attachment picker.- Since:
- 14.4RC1
- Version:
- $Id: bed3d34c0723ee0b6aaf438226238fde670e25f8 $
-
-
Constructor Summary
Constructors Constructor Description AttachmentGalleryPicker(String id)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AttachmentGalleryPickerclickAttachment(String attachmentName)Click on an attachment.List<String>getAttachmentTitles()Optional<String>getSelectedAttachment()Returns the name of the currently selected attachment, wrapped in anOptional, orOptional.empty()if no attachment is currently selected.booleanisGlobalSelectionWarningDisplayed()AttachmentGalleryPickersetSearch(String searchQuery)Define the search query of the attachment picker.AttachmentGalleryPickertoggleAllPages()Click on the "All Pages" search button to return search results from the whole farm.AttachmentGalleryPickertoggleCurrentPage()Click on the "Current Page" search button to return search results from the current page only.voidwaitNoResultMessageDisplayed()Wait until the not result warning message is displayed.voidwaitUntilAttachmentsCount(IntPredicate predicate)Wait until the expected number of attachments is displayed in the picker.AttachmentGalleryPickerwaitUntilReady()Wait until the picker is ready.-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Constructor Detail
-
AttachmentGalleryPicker
public AttachmentGalleryPicker(String id)
Default constructor.- Parameters:
id- the id of the attachment picker
-
-
Method Detail
-
waitUntilReady
public AttachmentGalleryPicker waitUntilReady()
Wait until the picker is ready.- Returns:
- the current page object
-
getAttachmentTitles
public List<String> getAttachmentTitles()
- Returns:
- the list of the titles of the attachments
-
setSearch
public AttachmentGalleryPicker setSearch(String searchQuery)
Define the search query of the attachment picker.- Parameters:
searchQuery- the search query, for instance the name of an attachment- Returns:
- the current page object
-
waitUntilAttachmentsCount
public void waitUntilAttachmentsCount(IntPredicate predicate)
Wait until the expected number of attachments is displayed in the picker.- Parameters:
predicate- a boolean predicate taking the current attachments count in parameter
-
waitNoResultMessageDisplayed
public void waitNoResultMessageDisplayed()
Wait until the not result warning message is displayed.
-
toggleAllPages
public AttachmentGalleryPicker toggleAllPages()
Click on the "All Pages" search button to return search results from the whole farm.- Returns:
- the current page object
- Since:
- 14.10.1, 15.0RC1
-
toggleCurrentPage
public AttachmentGalleryPicker toggleCurrentPage()
Click on the "Current Page" search button to return search results from the current page only.- Returns:
- the current page object
- Since:
- 14.10.1, 15.0RC1
-
clickAttachment
public AttachmentGalleryPicker clickAttachment(String attachmentName)
Click on an attachment. This will either select or un-select it according to it's initial state.- Parameters:
attachmentName- the name of the attachment to click on- Returns:
- the current page object
- Since:
- 14.10.1, 14.5RC1
-
getSelectedAttachment
public Optional<String> getSelectedAttachment()
Returns the name of the currently selected attachment, wrapped in anOptional, orOptional.empty()if no attachment is currently selected.- Returns:
- the currently selected attachment name, wrapped in an
Optional, orOptional.empty()if no attachment is currently selected - Since:
- 14.10.1, 14.5RC1
-
isGlobalSelectionWarningDisplayed
public boolean isGlobalSelectionWarningDisplayed()
- Returns:
trueif the global selection warning message is displayed,falseotherwise- Since:
- 14.10.1, 14.5RC1
-
-