package com.exedio.copernica;

import net.sourceforge.jwebunit.WebTestCase;

public class WebTest extends WebTestCase
{

	public WebTest(String name)
	{
		super(name);
	}

	public void setUp() throws Exception
	{
		super.setUp();
		getTestContext().setBaseUrl("http://localhost:8080/copernicatest/");
	}

	public void testSearch()
	{
		beginAt("copernica.jsp");
		assertTitleEquals("Copernica");
		assertLinkPresentWithText("de");

		clickLinkWithText("Attribute Item");
		assertTitleEquals("Attribute Item");
		assertTextPresent("Attribute Item");
		
		assertLinkPresentWithText("50");
		clickLinkWithText("50");
		assertTitleEquals("Attribute Item");
		assertLinkNotPresentWithText("50");

		clickLinkWithText("[X]");
		assertTitleEquals("AttributeItem.103");
		assertFormElementEquals("someNotNullString", "running100");

		setFormElement("someNotNullString", "running100changed");
		submit("SAVE");
	}
}

@@ -896,13 +896,300 @@
 SAVE%22);%0A
+%09%09assertTitleEquals(%22AttributeItem.103%22);%0A%09%09assertFormElementEquals(%22someNotNullString%22, %22running100changed%22);%0A%0A%09%09setFormElement(%22someNotNullString%22, %22running100%22);%0A%09%09submit(%22SAVE%22);%0A%09%09assertTitleEquals(%22AttributeItem.103%22);%0A%09%09assertFormElementEquals(%22someNotNullString%22, %22running100%22);%0A
 %09%7D%0A%7D%0A

change back to make test run more than once without dropping database