4 Replies Latest reply on Oct 5, 2012 9:11 AM by Martin Kouba

    Arquillian warp, changing component state during a phase

    Anthony Patricio Master

      I want to test some complex navigation rules depending on a component

      state, is that supposed to work:

      What disturbs me is the method name "verify" + the interface name

      ServerAssertion which tend to imply we should not update any server

      state there.

       

           @Test 
           @RunAsClient 
           public void testWin() { 
               Warp.execute(new ClientAction() { 
                   @Override 
                   public void action() { 
                       browser.navigate().to(deploymentURL + "aPage.jsf"); 
                       WebElement button = 
      browser.findElement(By.id("characterGuessForm:submitCharacter")); 
                       // very simple UI interaction 
                       button.click(); 
                   } 
               }).verify(new ServerSideAction()); 
      
               // Assertion on where I am now 
           } 
      
           public static class ServerSideAction extends ServerAssertion { 
      
               private static final long serialVersionUID = 1L; 
      
               @Inject 
              ImportantComponent component; 
      
      
               @AfterPhase(Phase.UPDATE_MODEL_VALUES) 
               public void updateComponentState() { 
                   component.setXXX("YYY") 
               } 
           }