2 Replies Latest reply on Oct 25, 2012 3:51 AM by Lukáš Fryč

    Warp: API proposal for complex executions

    Lukáš Fryč Master

      Hey guys,

       

      I have just finished raw proposal of Warp's new API:

      https://gist.github.com/3933633

       

      which is targetting advanced situations as described in ARQ-967.

       

       

      I would love to hear your feedback!

       

       

      What will be probably also highly interesting is fluent API for defining request filters,

      which is coming (very) soon.

       

       

      ~ Lukas

        • 1. Re: Warp: API proposal for complex executions
          Aslak Knutsen Master

          Cool stuff, just a few questions.

           

          Will there be a no arg v of group following the registration order?

           

          group().verify(); 
          result.getGroup(0) or result.getGroups().get(0) 
          

           

          Will there be support for multiple ServerAssertions?

           

          execute(ca).verify(sa1, sa2)
          

           

          Is order guaranteeded between registration and verification? e.g. multiple filters matching the same, are their verify pair executed in order?

           

          Is there a group associated with a 'non grouped' api call? e.g. Would something like this work:

           

          WarpResult result = Warp.execute(ca).verify(sa).verifyAll();
          

           

          (getting hold of the WarpResult object without defining a Group)

           

           

          Any thoughts on a simple declerative version of the API. If you're only doing one request within the Test body, or multiple that require the same assertions.

           

          @Test @Warp(assertion = VerifyXYZ.class, filter = JSFRequest.class)
          public void should() {
             driver.open(xyz);
          }
          
          • 2. Re: Warp: API proposal for complex executions
            Lukáš Fryč Master

            Thanks for feedback, Aslak.

            Aslak Knutsen wrote:

             

            Cool stuff, just a few questions.

             

            Will there be a no arg v of group following the registration order?

             

            group().verify(); 
            result.getGroup(0) or result.getGroups().get(0) 
            

             

            Will there be support for multiple ServerAssertions?

             

            execute(ca).verify(sa1, sa2)

            Yes, group() syntax with no key will be surely allowed, using sequence numbering.

             

            Multiple assertions is great idea, I will definitely do that, preserving order of registration/verification.

             

             

            Is there a group associated with a 'non grouped' api call? e.g. Would something like this work:

             

            WarpResult result = Warp.execute(ca).verify(sa).verifyAll();
            

             

            (getting hold of the WarpResult object without defining a Group)

            Definitely there will be group associated with default call (DefaultExecutionGroup.KEY), but I would not overload verify(sa) method,

            rather use something like

             

            Warp.execute(ca).verifyAndReturnResult(sa);
            

             

             

            Any thoughts on a simple declerative version of the API. If you're only doing one request within the Test body, or multiple that require the same assertions.

             

            @Test @Warp(assertion = VerifyXYZ.class, filter = JSFRequest.class)
            public void should() {
               driver.open(xyz);
            }
            

             

            Great idea.

             

            @Test
            @Verify(VerifyXYZ.class)
            @Filters(JSFRequest.class)
            public void should() {
                 driver.open(xyz);
            }
            

             

            @Test
            @Filters(JSFRequest.class)
            public void should() {
                 Warp.execute(ca).verify(VerifyXYZ.class);
            }