Skip to content

Instantly share code, notes, and snippets.

@maggandalf
Created April 20, 2011 17:13
Page frontend for insert stock webpage.
public class InsertStockPage {
private static final String STOCK_FORM_ID = "name";
private static final String THRESHOLD_FORM_ID = "threshold";
private static final String TRADEAT_FORM_ID = "tradeAt";
private static final String SUBMIT_FORM_ID = "submit";
private String stockUrl;
@Autowired
private PageUtils pageUtils;
public void open() {
pageUtils.open(this.stockUrl);
}
public void fillForm(String stockName, String threshold, String tradeAt) {
pageUtils.fillFormField(STOCK_FORM_ID, stockName);
pageUtils.fillFormField(THRESHOLD_FORM_ID, threshold);
pageUtils.fillFormField(TRADEAT_FORM_ID, tradeAt);
}
public void submitForm() {
pageUtils.submitForm(SUBMIT_FORM_ID);
}
public void setStockUrl(String url) {
this.stockUrl = url;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment