Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-1264

assertComponentOnAjaxResponse does not work with WicketTester.clickLink

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.3.0-final
    • 1.3.1
    • None
    • None
    • mac osx 10.4

    Description

      assertComponentOnAjaxResponse does not work with clickLink. Workaround are to call wickettester..executeAjaxEvent(ajaxLink,"onclick"); instead.

      Reason why this fails has something todo with that clickLink creates a servlet response which are empty hence this will always fail:

      // Get the AJAX response
      String ajaxResponse = getServletResponse().getDocument();

      // Test that the previous response was actually a AJAX response
      failMessage = "The Previous response was not an AJAX response. "
      + "You need to execute an AJAX event, using clickLink, before using this assert";
      boolean isAjaxResponse = ajaxResponse.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?><ajax-response>");

      proposed fix are to rewrite wicketTester.clicklink(string path,boolean ajax) to call executeAjaxEvent instead if possible?

      Attachments

        1. WicketTesterAjaxTrouble.zip
          37 kB
          Nino Martinez

        Activity

          People

            Unassigned Unassigned
            nino Nino Martinez
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: