Guest User

Untitled

a guest
Aug 10th, 2016
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 4.69 KB | None | 0 0
  1. <html>
  2.   <head>
  3.     <title>LS User Acceptance Test Configurator</title>
  4.     <!-- Latest compiled and minified CSS -->
  5.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  6.  
  7.     <!-- Optional theme -->
  8.     <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
  9.  
  10.     <script src="https://code.jquery.com/jquery-1.11.3.js"></script>
  11.  
  12.     <!-- Latest compiled and minified JavaScript -->
  13.     <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  14.   </head>
  15.  
  16.  
  17.   <body style="margin: 20px">
  18.    
  19.    
  20.     <div class="container">
  21.     <form action="/test_configurator_nemeth/index.cgi" method="GET" class="form-inline" role="form">
  22.          <div class="form-group">
  23.             <label for="name">Name:</label>
  24.             <input type="text" value="[% newname %]" name="newname" class="form-control" id="name" placeholder="Enter name">
  25.          </div>
  26.          <div class="form-group">
  27.             <label for="email">Email:</label>
  28.             <input type="email" value="[% newemail %]" name="newemail" class="form-control" id="email" placeholder="Enter email">
  29.          </div>
  30.          <div class="form-group">
  31.             <label for="pwd">Password:</label>
  32.             <input type="text" value="[% newpass %]" name="newpass" class="form-control" id="pass" placeholder="Enter password">
  33.          </div>
  34.          
  35.          <button action="[% newuser %]">New User</button>
  36.     </form>
  37.     </div>
  38.    <button onclick="[% openusers %]">Open User(s)</button>
  39.    
  40.    
  41.     <form action="/test_configurator_nemeth/index.cgi" method="GET">
  42.     <input type="hidden" name="command" value="save"/>
  43.     <div class="form-group">
  44.         <label for="host">Host:</label>
  45.         <input type="text" class="form-control" name="host" value="[% host %]">  <br>
  46.     </div>
  47.  
  48.     <table id="myTable" class="table table-bordered table-condensed table-hover table-striped" >
  49.    
  50.     <tr>
  51.         <td>Tests\User(s)</td>
  52.         [% FOREACH user IN users %]
  53.         <td data-username="[% user.name %]"><p align="center">[% user.name %]</p></td>
  54.         [% END %]
  55.     </tr>
  56.        
  57.     [% FOREACH test IN tests %]  
  58.         [% FOREACH testMethod IN test.testMethods %]
  59.         <tr>
  60.             <td data-testmethodname="[% test.name %].[% testMethod %]"><b>[% test.name %]</b> [% testMethod.name %]</td>
  61.             [% FOREACH user IN users %]
  62.             <td align="center"> Run: <input type="checkbox" id="[% test.name %]_[% user.name %]_run" name="expectedResult[[% test.name %]][run][[% user.name %]]" [% IF expectedResults.${test.name}.run.${user.name} %]checked[% END %]/> </td>
  63.             [% END %]
  64.         </tr>
  65.        
  66.             <td data-testmethodname="[% test.name %].shouldSucceed">shouldSucceed</td>
  67.             [% FOREACH user IN users %]
  68.             <td align="center"><input type="checkbox" id="[% test.name %]_[% user.name %]_-shouldSucceed" name="expectedResult[[% test.name %]][[% testMethod.name %]][shouldSucceed][[% user.name %]]" [% IF expectedResults.${test.name}.${testMethod.name}.shouldSucceed.${user.name} %]checked[% END %]/></td>
  69.             [% END %]
  70.  
  71.             [% FOREACH parameter IN testMethod.parameters %]
  72.             <tr>
  73.                 <td data-parametername="[% test.name %].[% testMethod.name %].[% parameter %]">[% parameter %]</td>
  74.                 [% FOREACH user IN users %]
  75.                 <td align="center"><input type="checkbox" id="[% test.name %]_[% user.name %]_-[% parameter %]" name="expectedResult[[% test.name %]][[% testMethod.name %]][[% parameter %]][[% user.name %]]" [% IF expectedResults.${test.name}.${testMethod.name}.${parameter}.${user.name} %]checked[% END %]/></td>
  76.                 [% END %]
  77.             </tr>
  78.    
  79.             [% END %]
  80.  
  81.         [% END %]
  82.     [% END %]
  83.     </table>
  84.  
  85.  
  86.     <input type="submit" value="Submit" class="btn btn-primary">
  87.     </form>
  88.    
  89.    
  90.    
  91. <script>
  92. $(document).ready(function()
  93. {
  94.     var runElements = $("[id*='run']");
  95.     for (i=0; i<runElements.size(); i++)
  96.     {
  97.         if (!runElements.eq(i).prop('checked'))
  98.         {      
  99.             var str = (runElements.eq(i)).attr('id');
  100.             var splitting = str.split("_", 2);
  101.             var testname = splitting[0]+"_"+splitting[1]+"_-";
  102.             $("[id*="+testname+"]").prop( "disabled", true );
  103.         }
  104.     }
  105.    
  106.     $("input[name*='[run]']").click(function()
  107.     {
  108.             var str = $(this).attr('id');
  109.             var splitting = str.split("_", 2);
  110.             var testname = splitting[0]+"_"+splitting[1]+"_-";
  111.             var checkbox = $("[id*="+testname+"]");
  112.             checkbox.prop( "disabled", !checkbox.prop("disabled") );
  113.             checkbox.prop( "checked", false );
  114.    });
  115. });
  116. </script>
  117.    
  118.    
  119.   </body>
  120. </html>
Add Comment
Please, Sign In to add comment