title: Codeception - how to render(or process) html returned from sendPost request
body: <p>I need to test POST endpoint that returns html with autosubmit form(js script submits it after small delay). Current behaviour is that after <code>sendPost</code> nothing happens, <code>wait</code> does not help too, but I can retrieve full html with <code>grabResponse</code> method. Is there any way I can either make Codeception process returned html so that form will be submitted automatically or render html manually? In the end I will need to check that returned html form was submitted, that I was redirected to the correct url and then I will need to check some elements on the page I was redirected to.</p>
  <p>Returned html example</p>
  <pre><code>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
  &lt;body onLoad=&quot;autoSubmit(300)&quot;&gt;
  
  &lt;form id=&quot;redirectForm&quot; name=&quot;form&quot; action=&quot;/redirect-url&quot; method=&quot;post&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;input1&quot; value=&quot;value&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;input2&quot; value=&quot;value&quot;&gt;
      &lt;input type=&quot;hidden&quot; name=&quot;input3&quot; value=&quot;value&quot;&gt;
  
      &lt;noscript&gt;
          &lt;center&gt;
              &lt;h3&gt;Please click the Continue button if you are not automatically redirected.&lt;/h3&gt;
              &lt;input type=&quot;submit&quot; value=&quot;Continue&quot;&gt;
          &lt;/center&gt;
      &lt;/noscript&gt;
  &lt;/form&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;
      function autoSubmit(timeout) {
          setTimeout(function () {
              form.submit();
          }, timeout);
      }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>What I want to do</p>
  <pre><code>   $data = $this-&gt;prepareData(I);
  
     $I-&gt;haveHttpHeader('Content-Type', 'application/x-www-form-urlencoded', true);    
     $I-&gt;sendPost($url, $data); // returns html with form
     
     // some magic happens here
  
     $I-&gt;canSeeCurrentUrlMatches('my-url');
     $I-&gt;canSeeElement('element indicating that form values were valid');
  </code></pre>