public class CompositeWebTask extends BaseWebTask implements Iterable<WebTask>
CompositeWebTask allows you to build trees of WebTask's. The idea is to have many atomic WebTask's (the leaves of the tree) focused on a very small user interaction. And then you start build up tasks by composition.
With CompositeWebTask you may even get rid of page objects (!), and have WebTask's talk directly to PageComponent's.
Exploiting the Composite design pattern.
logger, user
Constructor and Description |
---|
CompositeWebTask(List<WebTask> subtasks)
Set the given list as the list of components of this composite.
|
CompositeWebTask(WebTask... subtasks) |
Modifier and Type | Method and Description |
---|---|
CompositeWebTask |
append(WebTask... subtasks)
Append the given subtasks to the list of components.
|
Iterator<WebTask> |
iterator()
The iterator for iterating over the subtasks
this composite is made up of.
|
WebPage |
run(WebPage initialPage)
Runs each subtask in order, and finally return the
page that the last task was visiting.
|
browser, driver, getUser, setUser
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public CompositeWebTask(WebTask... subtasks)
CompositeWebTask(List)
public CompositeWebTask(List<WebTask> subtasks)
WebTasks.nullTask()
.public WebPage run(WebPage initialPage)
run
in interface WebTask
initialPage
- the page it is displayed before this task startsIllegalStateException
- if the user set in this composite is nullpublic Iterator<WebTask> iterator()
Backed by List.iterator()
.
public CompositeWebTask append(WebTask... subtasks)
subtasks
- Copyright © 2015. All rights reserved.