You are here

Webform Service QUnit Tests in Webform Service 7.4

    File

    tests/index.html
    View source
    <!DOCTYPE html>
    <html>
      <head>
        <title>Webform Service QUnit Tests</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel='stylesheet' type='text/css' href='http://code.jquery.com/qunit/qunit-1.10.0.css' />
        <script type='text/javascript' src="http://code.jquery.com/jquery.min.js"></script>
        <script type='text/javascript' src='http://code.jquery.com/qunit/qunit-1.10.0.js'></script>
    
        <!-- Include the ajaxTests. -->
        <script type='text/javascript' src='../js/webform_service_crud.js'></script>
        <script type='text/javascript' src='webform_service.test.js'></script>
        <script type="text/javascript">
          $(function() {
            $("input#submit").click(function(event) {
              event.preventDefault();
              var endpoint = $("input#endpoint").val();
              if (endpoint.indexOf('http') !== 0) {
                endpoint = 'http://' + endpoint;
              }
    
              // Make sure the endpoint exists.
              if (endpoint) {
    
                // Perform the tests!!!
                testCreateWebform(endpoint, function(webform) {
                  testGetWebform(endpoint, webform, function(webform) {
                    testUpdateWebform(endpoint, webform, function(webform) {
                      testCreateSubmission(endpoint, webform, function(submission) {
                        testGetSubmission(endpoint, submission, function(submission) {
                          testUpdateSubmission(endpoint, submission, function(submission) {
                            testDeleteSubmission(endpoint, submission, function(status) {
                              testDeleteWebform(endpoint, webform, function(status) {
                              });
                            });
                          });
                        });
                      });
                    });
                  });
                });
              }
            });
          });
        </script>
      </head>
      <body>
        <form>
          <label for="endpoint">Endpoint URL</label>
          <input type="text" id="endpoint" value="" size="60" maxlength="1024"><br/>
          <input type="submit" id="submit" name="op" value="Run Tests">
        </form>
        <h1 id="qunit-header">Webform Service QUnit tests</h1>
        <h2 id="qunit-banner"></h2>
        <div id="qunit-testrunner-toolbar"></div>
        <h2 id="qunit-userAgent"></h2>
        <ol id="qunit-tests"></ol>
        <div id="qunit-fixture"></div>
      </body>
    </html>