1 package org.paneris.jammyjoes.functional; 2 3 import net.sourceforge.jwebunit.WebTestCase; 4 5 public class TestCaseFunctionalAffiliate extends WebTestCase { 6 7 public TestCaseFunctionalAffiliate(String name) { 8 super(name); 9 } 10 11 public void setUp() { 12 getTestContext().setBaseUrl("http://localhost/html"); 13 } 14 15 public void testSignup() throws Exception { 16 beginAt("/Affiliate.html"); 17 assertTextPresent("Jammy Joes Affiliate Programme"); 18 clickLinkWithText("Create an affiliate account here"); 19 assertTextPresent("Please complete this form"); 20 setFormElement("email", "timj@hoop.co.uk"); 21 submit(); 22 assertTextPresent("Thank you"); 23 } 24 25 public void testLogin() throws Exception { 26 beginAt("/Affiliate.html"); 27 assertTextPresent("Jammy Joes Affiliate Programme"); 28 clickLinkWithText("login here"); 29 assertTextPresent("Login to Jammy Joes"); 30 setFormElement("field_login", "Test"); 31 setFormElement("field_password", "test"); 32 submit(); 33 assertTextPresent("logo"); 34 } 35 36 } 37 38