2 Replies Latest reply on Mar 4, 2016 5:39 AM by Christian Schulz

    Warp - WarpSynchronizationException: The Warp failed to observe requests or match them with response.

    István Gere Newbie

      Hi,

       

      I've had a little problem testing with Arquillian Warp extension. I think it is a wonderful tool for session bean testing.

      My problem is when I run a Warp test that should be success, it will be success 1 of 2 runs (50%).

      I have been debuged a it for 2 days and my suspiction is the initialization process miss an event handling, but I don't know why.

       

      Here is my code, which is very simple:

       

      Warp.initiate(new Activity() {

             @Override

             public void perform() {

                  driver.findElement(By.id("loginForm:loginForm:register")).click();

             }

        })

        .observe(request().uri().contains("registrationPage.xhtml").method().equal(HttpMethod.GET))

        .inspect(new Inspection() {

             /** */

             private static final long serialVersionUID = 8263151943736119199L;

       

             @AfterPhase(Phase.RENDER_RESPONSE)

             public void testInitialState() {

                  // verify we are on right viewId

                  assertThat(FacesContext.getCurrentInstance().getViewRoot().getViewId(), is("/registrationPage.xhtml"));

                  assertThat(FacesContext.getCurrentInstance().getApplication().getDefaultLocale(), is(new Locale("en", "EN")));

                  assertThat(FacesContext.getCurrentInstance().getMessageList().isEmpty(), is(true));

             }

        });

       

      The arquillian debug log is different when it runs successfully and failed (I don't want to paste here the full log, just the diff):

       

      Success@Failed

      (E) BeforeRules

           (I) TestContextHandler.createSuiteContext

           (I) TestContextHandler.createTestContext

         (I) TestContextHandler.createClassContext

           (E) TestClass

            ....

            (E) Before

                      (I) TestContextHandler.createSuiteContext

                      (I) TestContextHandler.createTestContext

                     (I) TestContextHandler.createClassContext

                      (E) TestClass

                       ......

                      (E) BeforeEnrichment

                                 (O) ContextRootStoreInitializer.setupLocationForClass

                                 (E) RequireProxy

       

       

                                            (O) ProxyObserver.requireProxy

                                            (E) StartProxy

                                                       (O) ProxyObserver.startProxy

                                            (O) ProxyUsageTracker.registerOperationalContextToUrl

                                 (E) ContextRootStore

                      (E) RequireProxy

                                 (O) ProxyObserver.requireProxy

                                 (O) ProxyUsageTracker.registerOperationalContextToUrl

      (E) BeforeRules

           (I) TestContextHandler.createClassContext

           (E) TestClass

           (I) TestContextHandler.createSuiteContext

           (I) TestContextHandler.createTestContext

            ....

            (E) Before

                     (I) TestContextHandler.createClassContext

                      (E) TestClass

                      (I) TestContextHandler.createSuiteContext

                      (I) TestContextHandler.createTestContext

                       ......

                      (E) BeforeEnrichment

                                 (O) ContextRootStoreInitializer.setupLocationForClass

                                 (E) RequireProxy

       

       

                                            (O) ProxyObserver.requireProxy

                                            (E) StartProxy

                                                       (O) ProxyObserver.startProxy

                                            (O) ProxyUsageTracker.registerOperationalContextToUrl

                                 (E) ContextRootStore