Package org.kquiet.browser
Class ActionComposerBuilder.ActionSequenceBuilder
java.lang.Object
org.kquiet.browser.ActionComposerBuilder.ActionSequenceBuilder
- Enclosing class:
- ActionComposerBuilder
A builder to build the
actions into a sequence.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassA builder to buildClickin a fluent way.classA builder to buildCloseWindowin a fluent way.classA builder to buildCustomin a fluent way.classA builder to buildExtractin a fluent way.classA builder to buildGetUrlin a fluent way.classA builder to buildIfThenElsein a fluent way.classA builder to buildJustWaitin a fluent way.classA builder to buildMouseOverin a fluent way.classA builder to buildOpenWindowin a fluent way.classA builder to buildPostFormin a fluent way.classA builder to buildReplyAlertin a fluent way.classA builder to buildScrollToViewin a fluent way.classA builder to buildSelectin a fluent way.classA builder to buildSendKeyin a fluent way.classA builder to buildUploadin a fluent way.classA builder to buildWaitUntilin a fluent way. -
Constructor Summary
ConstructorsConstructorDescriptionActionSequenceBuilder(ActionComposerBuilder parentComposerBuilder) Create a newActionComposerBuilder.ActionSequenceBuilderwith anActionComposerBuilderas its parent builder.ActionSequenceBuilder(ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder parentIfThenElseBuilder) Create a newActionComposerBuilder.ActionSequenceBuilderwith anActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderas its parent builder. -
Method Summary
Modifier and TypeMethodDescriptionclick(org.openqa.selenium.By by) Add aClickto the sequence of actions.closeWindow(boolean closeAllRegistered) Add aCloseWindowto the sequence of actions.custom(Consumer<ActionComposer> customAction) Add a single-phasedCustomto the sequence of actions.customMultiPhase(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Add a multiple-phasedCustomto the sequence of actions.Finish building the sequence of actions so far and return control to parent builder (ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder).Add aGetUrlto the sequence of actions.justWait(int totalTimeout) Add aJustWaitto the sequence of actions.mouseOver(org.openqa.selenium.By by) Add aMouseOverto the sequence of actions.Add aOpenWindowto the sequence of actions.Add aPostFormto the sequence of actions.prepareClick(org.openqa.selenium.By by) Start building aClick.prepareCloseWindow(boolean closeAllRegistered) Start building aCloseWindow.prepareCustom(Consumer<ActionComposer> customAction) Start building a single-phasedCustom.prepareCustomMultiPhase(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Start building a multiple-phasedCustom.prepareExtract(org.openqa.selenium.By by) Start building aExtract.prepareGetUrl(String url) Start building aGetUrl.prepareIfThenElse(Function<ActionComposer, ?> evalFunction) Start building anIfThenElse.prepareJustWait(int totalTimeout) Start building aJustWait.prepareMouseOver(org.openqa.selenium.By by) Start building aMouseOver.Start building aOpenWindow.preparePostForm(String url, List<AbstractMap.SimpleImmutableEntry<String, String>> formData) Start building aPostForm.prepareReplyAlert(ReplyAlert.Decision decision) Start building aReplyAlert.prepareScrollToView(org.openqa.selenium.By by, boolean toTop) Start building aScrollToView.prepareSelect(org.openqa.selenium.By by) Start building aSelect.prepareSendKey(org.openqa.selenium.By by, CharSequence... keysToSend) Start building aSendKey.prepareUpload(org.openqa.selenium.By by, String... pathOfFiles) Start building aUpload.prepareWaitUntil(Function<org.openqa.selenium.WebDriver, V> conditionFunc, int totalTimeout) Start building aWaitUntil.replyAlert(ReplyAlert.Decision decision) Add aReplyAlertto the sequence of actions.Finish building the sequence of actions so far and return control to root builder (ActionComposerBuilder).scrollToView(org.openqa.selenium.By by, boolean toTop) Add aScrollToViewto the sequence of actions.selectByIndex(org.openqa.selenium.By by, Integer... options) Add aSelectto the sequence of actions, which select by index.selectByText(org.openqa.selenium.By by, String... options) Add aSelectto the sequence of actions, which select by text.selectByValue(org.openqa.selenium.By by, String... options) Add aSelectto the sequence of actions, which select by value.sendKey(org.openqa.selenium.By by, CharSequence... keysToSend) Add aSendKeyto the sequence of actions.Add aUploadto the sequence of actions.Add aWaitUntilto the sequence of actions.
-
Constructor Details
-
ActionSequenceBuilder
Create a newActionComposerBuilder.ActionSequenceBuilderwith anActionComposerBuilderas its parent builder.- Parameters:
parentComposerBuilder- parent builder
-
ActionSequenceBuilder
public ActionSequenceBuilder(ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder parentIfThenElseBuilder) Create a newActionComposerBuilder.ActionSequenceBuilderwith anActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderas its parent builder.- Parameters:
parentIfThenElseBuilder- parent builder
-
-
Method Details
-
returnToComposerBuilder
Finish building the sequence of actions so far and return control to root builder (ActionComposerBuilder).- Returns:
- root builder(
ActionComposerBuilder)
-
endActionSequence
Finish building the sequence of actions so far and return control to parent builder (ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder).- Returns:
- parent builder(
ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder) - Throws:
UnsupportedOperationException- if parent builder is notActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder.
-
closeWindow
Add aCloseWindowto the sequence of actions.- Parameters:
closeAllRegistered-true: close all regisetered windows;false: close only the focus window.- Returns:
- self reference
-
prepareCloseWindow
public ActionComposerBuilder.ActionSequenceBuilder.CloseWindowBuilder prepareCloseWindow(boolean closeAllRegistered) Start building aCloseWindow.- Parameters:
closeAllRegistered-true: close all regisetered windows;false: close only the focus window- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.CloseWindowBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
openWindow
Add aOpenWindowto the sequence of actions.- Returns:
- self reference
-
prepareOpenWindow
Start building aOpenWindow.- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.OpenWindowBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
waitUntil
public <V> ActionComposerBuilder.ActionSequenceBuilder waitUntil(Function<org.openqa.selenium.WebDriver, V> conditionFunc, int totalTimeout) Add aWaitUntilto the sequence of actions.- Type Parameters:
V- the expected return type of condition function- Parameters:
conditionFunc- the condition function for evaluation by phasestotalTimeout- the maximum amount of time to wait totally- Returns:
- self reference
-
prepareWaitUntil
public <V> ActionComposerBuilder.ActionSequenceBuilder.WaitUntilBuilder<V> prepareWaitUntil(Function<org.openqa.selenium.WebDriver, V> conditionFunc, int totalTimeout) Start building aWaitUntil.- Type Parameters:
V- the expected return type of condition function- Parameters:
conditionFunc- the condition function for evaluation by phasestotalTimeout- the maximum amount of time to wait totally- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.WaitUntilBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
justWait
Add aJustWaitto the sequence of actions.- Parameters:
totalTimeout- the maximum amount of time to wait totally- Returns:
- self reference
-
prepareJustWait
public ActionComposerBuilder.ActionSequenceBuilder.JustWaitBuilder prepareJustWait(int totalTimeout) Start building aJustWait.- Parameters:
totalTimeout- the maximum amount of time to wait totally- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.JustWaitBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
postForm
public ActionComposerBuilder.ActionSequenceBuilder postForm(String url, List<AbstractMap.SimpleImmutableEntry<String, String>> formData) Add aPostFormto the sequence of actions.- Parameters:
url- the address where to submit the formformData- the form data to submit- Returns:
- self reference
-
preparePostForm
public ActionComposerBuilder.ActionSequenceBuilder.PostFormBuilder preparePostForm(String url, List<AbstractMap.SimpleImmutableEntry<String, String>> formData) Start building aPostForm.- Parameters:
url- the address where to submit the formformData- the form data to submit- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.PostFormBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
getUrl
Add aGetUrlto the sequence of actions.- Parameters:
url- the url of web page- Returns:
- self reference
-
prepareGetUrl
Start building aGetUrl.- Parameters:
url- the url of web page- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.GetUrlBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
selectByIndex
public ActionComposerBuilder.ActionSequenceBuilder selectByIndex(org.openqa.selenium.By by, Integer... options) Add aSelectto the sequence of actions, which select by index.- Parameters:
by- the element locating mechanismoptions- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options- Returns:
- self reference
-
selectByText
public ActionComposerBuilder.ActionSequenceBuilder selectByText(org.openqa.selenium.By by, String... options) Add aSelectto the sequence of actions, which select by text.- Parameters:
by- the element locating mechanismoptions- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options- Returns:
- self reference
-
selectByValue
public ActionComposerBuilder.ActionSequenceBuilder selectByValue(org.openqa.selenium.By by, String... options) Add aSelectto the sequence of actions, which select by value.- Parameters:
by- the element locating mechanismoptions- the option to select; all options are deselected when no option is supplied and the SELECT element supports selecting multiple options- Returns:
- self reference
-
prepareSelect
public ActionComposerBuilder.ActionSequenceBuilder.SelectBuilder prepareSelect(org.openqa.selenium.By by) Start building aSelect.- Parameters:
by- the element locating mechanism- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.SelectBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
sendKey
public ActionComposerBuilder.ActionSequenceBuilder sendKey(org.openqa.selenium.By by, CharSequence... keysToSend) Add aSendKeyto the sequence of actions.- Parameters:
by- the element locating mechanismkeysToSend- character sequence to send to the element- Returns:
- self reference
-
prepareSendKey
public ActionComposerBuilder.ActionSequenceBuilder.SendKeyBuilder prepareSendKey(org.openqa.selenium.By by, CharSequence... keysToSend) Start building aSendKey.- Parameters:
by- the element locating mechanismkeysToSend- character sequence to send to the element- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.SendKeyBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
prepareExtract
public ActionComposerBuilder.ActionSequenceBuilder.ExtractBuilder prepareExtract(org.openqa.selenium.By by) Start building aExtract.- Parameters:
by- the element locating mechanism- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.ExtractBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
click
Add aClickto the sequence of actions.- Parameters:
by- the element locating mechanism- Returns:
- self reference
-
prepareClick
public ActionComposerBuilder.ActionSequenceBuilder.ClickBuilder prepareClick(org.openqa.selenium.By by) Start building aClick.- Parameters:
by- the element locating mechanism- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.ClickBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
mouseOver
Add aMouseOverto the sequence of actions.- Parameters:
by- the element locating mechanism- Returns:
- self reference
-
prepareMouseOver
public ActionComposerBuilder.ActionSequenceBuilder.MouseOverBuilder prepareMouseOver(org.openqa.selenium.By by) Start building aMouseOver.- Parameters:
by- the element locating mechanism- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.MouseOverBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
custom
Add a single-phasedCustomto the sequence of actions.- Parameters:
customAction- custom action- Returns:
- self reference
-
customMultiPhase
public ActionComposerBuilder.ActionSequenceBuilder customMultiPhase(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Add a multiple-phasedCustomto the sequence of actions.- Parameters:
multiPhasedCustomAction- multiple-phased custom action- Returns:
- self reference
-
prepareCustom
public ActionComposerBuilder.ActionSequenceBuilder.CustomBuilder prepareCustom(Consumer<ActionComposer> customAction) Start building a single-phasedCustom.- Parameters:
customAction- custom action- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.CustomBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
prepareCustomMultiPhase
public ActionComposerBuilder.ActionSequenceBuilder.CustomBuilder prepareCustomMultiPhase(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Start building a multiple-phasedCustom.- Parameters:
multiPhasedCustomAction- multiple-phased custom action- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.CustomBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
scrollToView
public ActionComposerBuilder.ActionSequenceBuilder scrollToView(org.openqa.selenium.By by, boolean toTop) Add aScrollToViewto the sequence of actions.- Parameters:
by- the element locating mechanismtoTop-true: scroll to top;false: scroll to bottom- Returns:
- self reference
-
prepareScrollToView
public ActionComposerBuilder.ActionSequenceBuilder.ScrollToViewBuilder prepareScrollToView(org.openqa.selenium.By by, boolean toTop) Start building aScrollToView.- Parameters:
by- the element locating mechanismtoTop-true: scroll to top;false: scroll to bottom- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.ScrollToViewBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
upload
public ActionComposerBuilder.ActionSequenceBuilder upload(org.openqa.selenium.By by, String... pathOfFiles) Add aUploadto the sequence of actions.- Parameters:
by- the element locating mechanismpathOfFiles- the paths of files to upload- Returns:
- self reference
-
prepareUpload
public ActionComposerBuilder.ActionSequenceBuilder.UploadBuilder prepareUpload(org.openqa.selenium.By by, String... pathOfFiles) Start building aUpload.- Parameters:
by- the element locating mechanismpathOfFiles- the paths of files to upload- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.UploadBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
replyAlert
Add aReplyAlertto the sequence of actions.- Parameters:
decision- the way to deal with alert box- Returns:
- self reference
-
prepareReplyAlert
public ActionComposerBuilder.ActionSequenceBuilder.ReplyAlertBuilder prepareReplyAlert(ReplyAlert.Decision decision) Start building aReplyAlert.- Parameters:
decision- the way to deal with alert box- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.ReplyAlertBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-
prepareIfThenElse
public ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder prepareIfThenElse(Function<ActionComposer, ?> evalFunction) Start building anIfThenElse.- Parameters:
evalFunction- the function to evaluate- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilderwith thisActionComposerBuilder.ActionSequenceBuilderas parent builder
-