@Ignore @Test public void test() { // try to type correct login and password. beginAt("logOn.jsp"); // start on logOn.jsp clickLink("enLocale"); // switch on ru locale setTextField("login", "user6"); setTextField("password", "12341234"); submit(); assertTitleEquals("Manager home page"); clickLink("showWorkers"); assertTitleEquals("Workers list"); }
@Test public void testLogin() { beginAt("/default.jsp"); // Open the browser on // http://localhost:8080/test/home.xhtml assertTitleEquals("Movies"); assertElementPresent("janrainModal"); String element = getElementAttributeByXPath("//div[@id='janrainModal']", "style"); assertTrue(element.contains("display: none")); clickLink("login"); element = getElementAttributeByXPath("//div[@id='janrainModal']", "style"); assertTrue(element.contains("display: block")); assertElementPresent("janrain-yahoo"); clickElementByXPath("//li[@id='janrain-yahoo']"); assertWindowCountEquals(2); assertWindowPresentWithTitle("Sign in to Yahoo!"); gotoWindowByTitle("Sign in to Yahoo!"); setTextField("login", "*****@*****.**"); setTextField("passwd", "Test12345"); submit(".save"); try { Thread.sleep(20000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } // beginAt("/default.jsp"); // gotoWindowByTitle("Movies"); assertTextPresent("Logout"); assertElementPresent("username"); IElement username = getElementById("username"); assertTrue(username.getTextContent().contains("movie hunter")); assertElementNotPresent("login"); assertElementPresent("logout"); clickLink("logout"); assertElementPresent("login"); }