org.xwiki.test.ui.po.editor
Class UserPicker

java.lang.Object
  extended by org.xwiki.test.ui.po.BaseElement
      extended by org.xwiki.test.ui.po.editor.UserPicker

public class UserPicker
extends BaseElement

Represents the actions possible on the user picker.

Since:
4.5
Version:
$Id: 649f99696cbaf12308b7313618cb4ddbc26f3599 $

Nested Class Summary
static class UserPicker.UserElement
           
 
Constructor Summary
UserPicker(org.openqa.selenium.WebElement textInput)
          Exposes the user picker bound to the given text input;
 
Method Summary
 UserPicker clear()
          Clears the content of the text input.
 List<UserPicker.UserElement> getAcceptedSuggestions()
           
 org.openqa.selenium.WebElement getClearSelectionLink()
           
 List<UserPicker.UserElement> getSuggestions()
           
 String getValue()
           
 UserPicker moveMouseOver()
          Moves the mouse over the text input.
 UserPicker select(String userNameOrAlias)
          Clicks on the suggestion that contains the given text.
 UserPicker sendKeys(CharSequence... keysToSend)
          Types into the text input.
 UserPicker waitForSuggestions()
          Waits until the suggestions for the current value of the text input are retrieved.
 UserPicker waitForSuggestionsToDisappear()
          Waits for the list of suggestions to disappear.
 UserPicker waitForSuggestionsToFadeOut()
          Waits for the list of suggestions to fade out.
 UserPicker waitToLoad()
          Waits for the user picker to load.
 
Methods inherited from class org.xwiki.test.ui.po.BaseElement
executeJavascript, getDriver, getUtil, makeAlertDialogSilent, makeConfirmDialogSilent, makeElementVisible, makeElementVisible, setContext, waitForNotificationErrorMessage, waitForNotificationSuccessMessage, waitForNotificationWarningMessage, waitUntilElementDisappears, waitUntilElementEndsWithAttributeValue, waitUntilElementHasAttributeValue, waitUntilElementHasTextContent, waitUntilElementIsVisible, waitUntilElementsAreVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserPicker

public UserPicker(org.openqa.selenium.WebElement textInput)
Exposes the user picker bound to the given text input;

Parameters:
textInput - the text input that is enhanced with a user picker
Method Detail

sendKeys

public UserPicker sendKeys(CharSequence... keysToSend)
Types into the text input.

Parameters:
keysToSend - the keys to type into the text input
Returns:
this

clear

public UserPicker clear()
Clears the content of the text input.

Returns:
this

getValue

public String getValue()
Returns:
the value of the text input

getClearSelectionLink

public org.openqa.selenium.WebElement getClearSelectionLink()
Returns:
the link element used to clear the list of selected users

waitForSuggestions

public UserPicker waitForSuggestions()
Waits until the suggestions for the current value of the text input are retrieved.

Returns:
this

waitForSuggestionsToFadeOut

public UserPicker waitForSuggestionsToFadeOut()
Waits for the list of suggestions to fade out.

Returns:
this

waitForSuggestionsToDisappear

public UserPicker waitForSuggestionsToDisappear()
Waits for the list of suggestions to disappear.

Returns:
this

select

public UserPicker select(String userNameOrAlias)
Clicks on the suggestion that contains the given text.

Parameters:
userNameOrAlias - user name or alias
Returns:
this

getSuggestions

public List<UserPicker.UserElement> getSuggestions()
Returns:
the list of suggested users based on the value of the text input

getAcceptedSuggestions

public List<UserPicker.UserElement> getAcceptedSuggestions()
Returns:
the list of selected users

moveMouseOver

public UserPicker moveMouseOver()
Moves the mouse over the text input.

Returns:
this

waitToLoad

public UserPicker waitToLoad()
Waits for the user picker to load. You need to call this when the initial selection is not empty (because the user picker makes separate requests to retrieve information about the selected users).

Returns:
this


Copyright © 2004-2013 XWiki. All Rights Reserved.