Problem statement
Every acceptance tests use the XPlannerWebTester heavily. That class has become the kitchen sink of ATs, dealing with the entire application. XPlannerWebTester needs to be broken down per page and per domain object
There are heavy duplication of low level gui gestures all over. We must abstract these into meaningful business actions.
Solutions
- We need higher level actions to hide from every single test the gruesome work of navigating the pages. We need things like
- startIteration
- isIterationStarted
- newStory
- continueStory
public class IterationTester { public IterationTester(XPlannerWebTester tester); public void start() {...} public void isStarted() {...} }
- Each web page should have an accessor that has
- a set<field>, get<field> and has<field> for each field
- a get<label> for each dynamic label
- a click<link> for each link
Note: Could we generate this?public class IterationPageAccessor { public IterationPageAccessor(XPlannerWebTester tester); public void clickStart(){} public void assertHasStartAction{} {...} public void clickStories() {} public void assertHasStoriesAction() {...} ... } public class IterationStoriesPageAccessor extends IterationPageAccessor { public IterationStoriesPageAccessor (XPlannerWebTester tester); public String getName() {...} public int getId() {...} public boolean hasStories() {...} public TableAccessor getStories() {...} ... } public class IterationEditPageAccessor { public IterationEditPageAccessor (XPlannerWebTester tester); public int getId() {...} public String getName() {...} public void setName(String name) {...} public Date getStartDate() {...} public void setStartDate(Date start){...} ... }
- Labels and field id should be extracted into constant stored in an interface per page <DomainObject>Page like IterationPage
public interface IterationPage { String START_ACTION = "iteration.status.editor.start"; String CLOSE_ACTION = "iteration.status.editor.close"; ... }


