package selenium;

import com.thoughtworks.selenium.*;

public class SeleniumExampleTest extends SeleneseTestCase {
	public void setUp() throws Exception {
		setUp("http://localhost:8081/", "*iexplore");
	}

	public void testNew() throws Exception {
		selenium.showContextualBanner();
		selenium.open("/academicNet/index.jsp");

        selenium.type("username", "admin");
		selenium.type("password", "admin");
		selenium.click("//input[@value='Entrar']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Docentes");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Adicionar");
		selenium.waitForPageToLoad("30000");
		selenium.type("nome", "Professor Selenium");
		selenium.type("matr", "2009001");
		selenium.click("//input[@value='Inserir']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Docentes");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Remover");
		selenium.waitForPageToLoad("30000");
		selenium.click("//input[@value='Remover Professor']");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Docentes");
		selenium.waitForPageToLoad("30000");
		selenium.click("link=Logout");
		selenium.waitForPageToLoad("30000");

        // no need for you to keep this sleep. Delete it to speed things up
        //Thread.sleep(30 * 1000);
	}
}