0 Replies Latest reply on Jul 17, 2009 4:51 PM by Arno Mittelbach

    SeamTest strange conversation handling

    Arno Mittelbach Newbie

      SeamTest (Using Seam 2.1.1.GA) seems to throw away conversations when an action is invoked that either starts a pageflow (See my page on testing pageflows) or when that action returns a viewId:



        /**
         * Action that returns a view id
         */
        public String someAction(){
          return "/someViewId.xhtml";
        }
      



      And the corresponding test:



      String cid = new FacesRequest("/somepage.xhtml") {
                    
           @Override
           protected void invokeApplication(){
               invokeAction("#{someComponent.someAction}");
      
                  // assertion succeeds
                  assert isLongRunningConversation();
           }
                     
      }.run();
      
      new FacesRequest("/firstpageinflow.xhtml", cid) {
          @Override
           protected void invokeApplication(){
                  // assertion will fail!
               assert isLongRunningConversation();
           }
      }.run();
      
      



      This makes it utterly impossible to properly write integration tests, since I can only test individual views but not the complete user interaction. Even worse, views that require certain preconditions (created by a previous user interaction and stored in the conversation context) thereby become untestable.


      Is there any reason for this behavior? Is there any known workaround, or am I doing something completely wrong here? I'd be really grateful for help.


      Cheers
      Arno