사용 getting started with selenium [Java] 프레임 워크를 사용하면 테스트 결과는 다음과 같습니다.
@Config(url="http://systemunder.test", browser=Browser.FIREFOX)
public class TestLogin extends AutomationTest {
@Test
public void testLoginWorks() {
setText(By.id("username"), "valid_username")
.setText(By.id("password"), "valid_password")
.click(By.id("btnLogin"))
.validatePresent(By.id("logout_link"));
}
@Test
public void testPasswordBlank() {
setText(By.id("username"), "invalid_username")
.setText(By.id("password"), "")
.validateText(By.id("error_message"), "Password is blank.");
}
@Test
public void testUrl() {
navigateTo("/profile")
.validateUrl("/login"); // make sure they get redirected to login page.
}
}