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 TypeClassDescriptionclass
A builder to buildClick
in a fluent way.class
A builder to buildCloseWindow
in a fluent way.class
A builder to buildCustom
in a fluent way.class
A builder to buildExtract
in a fluent way.class
A builder to buildGetUrl
in a fluent way.class
A builder to buildIfThenElse
in a fluent way.class
A builder to buildJustWait
in a fluent way.class
A builder to buildMouseOver
in a fluent way.class
A builder to buildOpenWindow
in a fluent way.class
A builder to buildPostForm
in a fluent way.class
A builder to buildReplyAlert
in a fluent way.class
A builder to buildScrollToView
in a fluent way.class
A builder to buildSelect
in a fluent way.class
A builder to buildSendKey
in a fluent way.class
A builder to buildUpload
in a fluent way.class
A builder to buildWaitUntil
in a fluent way. -
Constructor Summary
ConstructorsConstructorDescriptionActionSequenceBuilder
(ActionComposerBuilder parentComposerBuilder) Create a newActionComposerBuilder.ActionSequenceBuilder
with anActionComposerBuilder
as its parent builder.ActionSequenceBuilder
(ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder parentIfThenElseBuilder) Create a newActionComposerBuilder.ActionSequenceBuilder
with anActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder
as its parent builder. -
Method Summary
Modifier and TypeMethodDescriptionclick
(org.openqa.selenium.By by) Add aClick
to the sequence of actions.closeWindow
(boolean closeAllRegistered) Add aCloseWindow
to the sequence of actions.custom
(Consumer<ActionComposer> customAction) Add a single-phasedCustom
to the sequence of actions.customMultiPhase
(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Add a multiple-phasedCustom
to the sequence of actions.Finish building the sequence of actions so far and return control to parent builder (ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder
).Add aGetUrl
to the sequence of actions.justWait
(int totalTimeout) Add aJustWait
to the sequence of actions.mouseOver
(org.openqa.selenium.By by) Add aMouseOver
to the sequence of actions.Add aOpenWindow
to the sequence of actions.Add aPostForm
to 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 aReplyAlert
to 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 aScrollToView
to the sequence of actions.selectByIndex
(org.openqa.selenium.By by, Integer... options) Add aSelect
to the sequence of actions, which select by index.selectByText
(org.openqa.selenium.By by, String... options) Add aSelect
to the sequence of actions, which select by text.selectByValue
(org.openqa.selenium.By by, String... options) Add aSelect
to the sequence of actions, which select by value.sendKey
(org.openqa.selenium.By by, CharSequence... keysToSend) Add aSendKey
to the sequence of actions.Add aUpload
to the sequence of actions.Add aWaitUntil
to the sequence of actions.
-
Constructor Details
-
ActionSequenceBuilder
Create a newActionComposerBuilder.ActionSequenceBuilder
with anActionComposerBuilder
as its parent builder.- Parameters:
parentComposerBuilder
- parent builder
-
ActionSequenceBuilder
public ActionSequenceBuilder(ActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder parentIfThenElseBuilder) Create a newActionComposerBuilder.ActionSequenceBuilder
with anActionComposerBuilder.ActionSequenceBuilder.IfThenElseBuilder
as 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 aCloseWindow
to 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.CloseWindowBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
openWindow
Add aOpenWindow
to the sequence of actions.- Returns:
- self reference
-
prepareOpenWindow
Start building aOpenWindow
.- Returns:
- a new
ActionComposerBuilder.ActionSequenceBuilder.OpenWindowBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
waitUntil
public <V> ActionComposerBuilder.ActionSequenceBuilder waitUntil(Function<org.openqa.selenium.WebDriver, V> conditionFunc, int totalTimeout) Add aWaitUntil
to 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.WaitUntilBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
justWait
Add aJustWait
to 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.JustWaitBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
postForm
public ActionComposerBuilder.ActionSequenceBuilder postForm(String url, List<AbstractMap.SimpleImmutableEntry<String, String>> formData) Add aPostForm
to 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.PostFormBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
getUrl
Add aGetUrl
to 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.GetUrlBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
selectByIndex
public ActionComposerBuilder.ActionSequenceBuilder selectByIndex(org.openqa.selenium.By by, Integer... options) Add aSelect
to 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 aSelect
to 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 aSelect
to 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.SelectBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
sendKey
public ActionComposerBuilder.ActionSequenceBuilder sendKey(org.openqa.selenium.By by, CharSequence... keysToSend) Add aSendKey
to 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.SendKeyBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as 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.ExtractBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
click
Add aClick
to 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.ClickBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
mouseOver
Add aMouseOver
to 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.MouseOverBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
custom
Add a single-phasedCustom
to the sequence of actions.- Parameters:
customAction
- custom action- Returns:
- self reference
-
customMultiPhase
public ActionComposerBuilder.ActionSequenceBuilder customMultiPhase(Function<MultiPhased, Consumer<ActionComposer>> multiPhasedCustomAction) Add a multiple-phasedCustom
to 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.CustomBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as 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.CustomBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
scrollToView
public ActionComposerBuilder.ActionSequenceBuilder scrollToView(org.openqa.selenium.By by, boolean toTop) Add aScrollToView
to 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.ScrollToViewBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
upload
public ActionComposerBuilder.ActionSequenceBuilder upload(org.openqa.selenium.By by, String... pathOfFiles) Add aUpload
to 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.UploadBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-
replyAlert
Add aReplyAlert
to 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.ReplyAlertBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as 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.IfThenElseBuilder
with thisActionComposerBuilder.ActionSequenceBuilder
as parent builder
-