Package org.xwiki.flamingo.skin.test.po
Class AttachmentsPane
- java.lang.Object
-
- org.xwiki.test.ui.po.BaseElement
-
- org.xwiki.flamingo.skin.test.po.AttachmentsPane
-
public class AttachmentsPane extends BaseElement
Represents the actions possible on the Attachment Pane at the bottom of a page.- Since:
- 3.2M3
- Version:
- $Id: 7f7f5cdc83db0511a869c67fffc7cef70f4777f2 $
-
-
Constructor Summary
Constructors Constructor Description AttachmentsPane()
Default constructor.AttachmentsPane(String liveDataId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnotherFile()
Adds another input field for attaching a file.boolean
attachmentExistsByFileName(String attachmentName)
Check if the attachment exists, regardless of the page where it is displayed.boolean
attachmentIsDisplayedByFileName(String attachmentName)
Check if the attachment exists for the currently displayed rows.void
clickAttachFiles()
Open a file picker dialog.void
clickHideProgress()
Close the progress displayed after uploading one or multiple files.void
deleteAllAttachments()
Deletes ALL the attached files.void
deleteAttachmentByFileByName(String attachmentName)
Deletes the corresponding file name.void
deleteFirstAttachment()
Deletes the first attachment.void
filterColumn(int columnIndex, String filterValue)
Set the value in the filter of a column and wait for the results to be displayed.org.openqa.selenium.WebElement
getAttachmentLink(String attachmentName)
Return thea
tag of an attachment link according to its name.org.openqa.selenium.WebElement
getAttachmentMoveElement(String attachmentName)
String
getAttachmentNameByIndex(int index)
Get the filename of an attachment knowing the index in the attachments liveData.String
getDateOfLastUpload(String attachmentName)
String
getLatestVersionOfAttachment(String attachmentName)
Return the version number for the requested attachment.int
getNumberOfAttachments()
int
getNumberOfAttachmentsDisplayed()
Get the number of displayed attachments, regardless of the total number.int
getRowIndexByAttachmentName(String attachmentName)
Get the row index of an attachment knowing the filename, starting with position 1.String
getSizeOfAttachment(String attachmentName)
String
getUploaderOfAttachment(String attachmentName)
AttachmentHistoryPage
goToAttachmentHistory(String attachmentName)
Click on the attachment history link for a given attachment.boolean
isOpened()
void
setFilesToUpload(List<String> filePaths)
Fills the URL with the specified file paths.void
setFileToUpload(String filePath)
Fills the URL with the specified file path.void
waitForAttachmentsLiveData()
Wait for the attachments liveData to be ready.void
waitForUploadToFinish(String fileName)
Wait for the upload of a specific file to be finished.-
Methods inherited from class org.xwiki.test.ui.po.BaseElement
getDriver, getUtil, isElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationInProgressMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilPageIsReady
-
-
-
-
Constructor Detail
-
AttachmentsPane
public AttachmentsPane()
Default constructor.- Since:
- 14.6RC1
-
AttachmentsPane
public AttachmentsPane(String liveDataId)
- Parameters:
liveDataId
- the id of the attachments liveData- Since:
- 14.6RC1
-
-
Method Detail
-
isOpened
public boolean isOpened()
- Returns:
true
if the attachments pane is fully loaded and ready to use,false
otherwise
-
waitForAttachmentsLiveData
public void waitForAttachmentsLiveData()
Wait for the attachments liveData to be ready.- Since:
- 14.6RC1
-
setFileToUpload
public void setFileToUpload(String filePath)
Fills the URL with the specified file path.- Parameters:
filePath
- the path to the file to upload in URL form (the file *must* exist in the target directory).
-
setFilesToUpload
public void setFilesToUpload(List<String> filePaths)
Fills the URL with the specified file paths.- Parameters:
filePaths
- a list of paths to the files to upload in URL form (the files *must* exist in the target directory).- Since:
- 14.10.2, 15.0RC1
-
waitForUploadToFinish
public void waitForUploadToFinish(String fileName)
Wait for the upload of a specific file to be finished.- Parameters:
fileName
- the name of the attachment
-
clickHideProgress
public void clickHideProgress()
Close the progress displayed after uploading one or multiple files.
-
addAnotherFile
public void addAnotherFile()
Adds another input field for attaching a file.
-
clickAttachFiles
public void clickAttachFiles()
Open a file picker dialog.
-
getRowIndexByAttachmentName
public int getRowIndexByAttachmentName(String attachmentName)
Get the row index of an attachment knowing the filename, starting with position 1.- Parameters:
attachmentName
- the name of the attachment- Returns:
- the 1-based row index of the searched attachment, or 0 if it doesn't exist
- Since:
- 14.6RC1
-
getAttachmentNameByIndex
public String getAttachmentNameByIndex(int index)
Get the filename of an attachment knowing the index in the attachments liveData.- Parameters:
index
- the index of the attachment in the list of liveData displayed entries- Returns:
- the filename of the attachment
- Since:
- 14.6RC1
-
getAttachmentLink
public org.openqa.selenium.WebElement getAttachmentLink(String attachmentName)
Return thea
tag of an attachment link according to its name.- Parameters:
attachmentName
- the name of the attachment (for instance"my_doc.txt"
)- Returns:
- the
WebElement
of thea
tag with the requested name - Since:
- 3.2M3
-
deleteAttachmentByFileByName
public void deleteAttachmentByFileByName(String attachmentName)
Deletes the corresponding file name.- Parameters:
attachmentName
- the name of the attachment to be deleted
-
deleteFirstAttachment
public void deleteFirstAttachment()
Deletes the first attachment.
-
getNumberOfAttachments
public int getNumberOfAttachments()
- Returns:
- the number of attachments in this document.
-
getNumberOfAttachmentsDisplayed
public int getNumberOfAttachmentsDisplayed()
Get the number of displayed attachments, regardless of the total number.- Returns:
- the number of attachments displayed.
- Since:
- 14.6RC1
-
deleteAllAttachments
public void deleteAllAttachments()
Deletes ALL the attached files.
-
getUploaderOfAttachment
public String getUploaderOfAttachment(String attachmentName)
- Parameters:
attachmentName
- the name of the attachment- Returns:
- the user that uploaded the attachment
-
getLatestVersionOfAttachment
public String getLatestVersionOfAttachment(String attachmentName)
Return the version number for the requested attachment.- Parameters:
attachmentName
- the name of the attachment- Returns:
- the version number displayed for the attachment
-
goToAttachmentHistory
public AttachmentHistoryPage goToAttachmentHistory(String attachmentName)
Click on the attachment history link for a given attachment.- Parameters:
attachmentName
- the name of the attachment (e.g., "myfile.txt")- Returns:
- the attachment history page object
- Since:
- 14.2RC1
-
getSizeOfAttachment
public String getSizeOfAttachment(String attachmentName)
- Parameters:
attachmentName
- the name of the attachment- Returns:
- the size of the attachment
-
getDateOfLastUpload
public String getDateOfLastUpload(String attachmentName)
- Parameters:
attachmentName
- the name of the attachment- Returns:
- the date when the attachment was uploaded / modified last time
-
attachmentIsDisplayedByFileName
public boolean attachmentIsDisplayedByFileName(String attachmentName)
Check if the attachment exists for the currently displayed rows.- Parameters:
attachmentName
- the name of the searched attachment- Returns:
- whether the attachment exists or not in the list of currently displayed attachments
- Since:
- 14.6RC1
-
attachmentExistsByFileName
public boolean attachmentExistsByFileName(String attachmentName)
Check if the attachment exists, regardless of the page where it is displayed.- Parameters:
attachmentName
- the name of the searched attachment- Returns:
- whether the attachments exists or not in the list of all attachments
-
getAttachmentMoveElement
public org.openqa.selenium.WebElement getAttachmentMoveElement(String attachmentName)
- Parameters:
attachmentName
- the name of the targeted attachment- Returns:
- the button to trigger the attachment move action
- Since:
- 14.6RC1
-
filterColumn
public void filterColumn(int columnIndex, String filterValue)
Set the value in the filter of a column and wait for the results to be displayed.- Parameters:
columnIndex
- the 1-based index of the column to filterfilterValue
- the value to filter by- Since:
- 14.6RC1
-
-