Annotation Type Page


@Retention(RUNTIME) @Target({FIELD,PARAMETER}) public @interface Page

This annotation marks the given object to be instantiated and injected as Page object

 public class LoginForm {

     @FindBy(css = ".login")
     WebElement login;

     @FindBy(css = ".password")
     WebElement password;

     @FindBy(css = ".confirmation")
     WebElement confirmation;

     public void login(String login, String password) {
         ...
     }
 }

 @RunWith(Arquillian.class)
 public class Test {

     @Page
     LoginForm loginForm;

     @Test
     public void test() {
         loginForm.login("login", "password");
     }

     //or as a method parameter
     @Test
     public void test(@Page LoginForm loginFormParam) {
         loginFormParam.login("login", "password");
     }
 }
 
Author:
Juraj Huska, Matous Jobanek