jdave.wicket.selenium
Class SeleniumSpecification<T extends org.apache.wicket.MarkupContainer>

java.lang.Object
  extended by jdave.ContainmentSupport
      extended by jdave.mock.MockSupport
          extended by jdave.Specification<T>
              extended by jdave.wicket.selenium.SeleniumSpecification<T>

public abstract class SeleniumSpecification<T extends org.apache.wicket.MarkupContainer>
extends jdave.Specification<T>

Author:
Janne Hietamäki

Field Summary
protected  com.thoughtworks.selenium.Selenium selenium
           
 WicketState wicket
           
 
Fields inherited from class jdave.Specification
be, context, does, must, should
 
Constructor Summary
SeleniumSpecification()
           
 
Method Summary
 void create()
           
 jdave.IContextObjectFactory<T> getContextObjectFactory()
           
 boolean needsThreadLocalIsolation()
           
protected abstract
<M> T
newComponent(java.lang.String id, org.apache.wicket.model.IModel<M> model)
          Create a new instance of a Wicket component to be specified.
 void onCreate()
           
<S extends org.apache.wicket.Component>
jdave.wicket.MultiSelection<S>
selectAll(java.lang.Class<S> type)
          Select all components whose model objects match given Hamcrest matcher:
<S extends org.apache.wicket.Component>
jdave.wicket.MultiSelection<S>
selectAll(java.lang.Class<S> type, java.lang.String wicketId)
          Select all components whose ids are given Wicket id:
<S extends org.apache.wicket.Component>
jdave.wicket.Selection<S>
selectFirst(java.lang.Class<S> type)
          Select first component whose model object matches given Hamcrest matcher:
<S extends org.apache.wicket.Component>
jdave.wicket.Selection<S>
selectFirst(java.lang.Class<S> type, java.lang.String wicketId)
          Select first component whose Wicket id is given String:
 T startComponent()
           
 T startComponent(org.apache.wicket.model.IModel<?> model)
           
 
Methods inherited from class jdave.Specification
addListener, destroy, equal, equal, equal, equal, fail, fireAfterContextCreation, fireAfterContextDestroy, fireAfterContextInstantiation, isNotNull, maps, not, raise, raise, raiseExactly, raiseExactly, satisfies, setContextObjectFactory, setStringComparisonFailure, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, specify, where
 
Methods inherited from class jdave.mock.MockSupport
checking, dummy, dummy, mock, mock, mockery, sequence, setDefaultResultForType, states, verifyMocks
 
Methods inherited from class jdave.ContainmentSupport
contain, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAll, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containAny, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containExactly, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, containInPartialOrder, contains, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAll, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsAny, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsExactly, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, containsInPartialOrder, newAllContainment, newAllContainment, newAllContainment, newAnyContainment, newAnyContainment, newAnyContainment, newExactContainment, newExactContainment, newExactContainment, newInOrderContainment, newInOrderContainment, newInOrderContainment, newInPartialOrderContainment, newInPartialOrderContainment, newInPartialOrderContainment, newObjectContainment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selenium

protected com.thoughtworks.selenium.Selenium selenium

wicket

public WicketState wicket
Constructor Detail

SeleniumSpecification

public SeleniumSpecification()
Method Detail

needsThreadLocalIsolation

public boolean needsThreadLocalIsolation()
Overrides:
needsThreadLocalIsolation in class jdave.Specification<T extends org.apache.wicket.MarkupContainer>

getContextObjectFactory

public jdave.IContextObjectFactory<T> getContextObjectFactory()
Overrides:
getContextObjectFactory in class jdave.Specification<T extends org.apache.wicket.MarkupContainer>

create

public final void create()
Overrides:
create in class jdave.Specification<T extends org.apache.wicket.MarkupContainer>

onCreate

public void onCreate()
              throws java.lang.Exception
Throws:
java.lang.Exception

newComponent

protected abstract <M> T newComponent(java.lang.String id,
                                      org.apache.wicket.model.IModel<M> model)
Create a new instance of a Wicket component to be specified.

The component must get given id. If the component is a Page, the id is null.

Parameters:
id - The id of a component, null if the component is a Page,
model - A model for the component which was passed in startComponent method.
See Also:
startComponent(IModel)

startComponent

public T startComponent(org.apache.wicket.model.IModel<?> model)

startComponent

public T startComponent()

selectFirst

public <S extends org.apache.wicket.Component> jdave.wicket.Selection<S> selectFirst(java.lang.Class<S> type)
Select first component whose model object matches given Hamcrest matcher:
Item item = selectFirst(Item.class).which(is(0)).from(context);


selectAll

public <S extends org.apache.wicket.Component> jdave.wicket.MultiSelection<S> selectAll(java.lang.Class<S> type)
Select all components whose model objects match given Hamcrest matcher:
List


selectFirst

public <S extends org.apache.wicket.Component> jdave.wicket.Selection<S> selectFirst(java.lang.Class<S> type,
                                                                                     java.lang.String wicketId)
Select first component whose Wicket id is given String:
Label itemName = selectFirst(Label.class, "name").from(context);


selectAll

public <S extends org.apache.wicket.Component> jdave.wicket.MultiSelection<S> selectAll(java.lang.Class<S> type,
                                                                                        java.lang.String wicketId)
Select all components whose ids are given Wicket id:
List



Copyright © 2009. All Rights Reserved.