@@ -22,6 +22,7 @@ $(function() {
2222 var msg = '' ;
2323 var collapse = '' ;
2424 var text = `<pre>${ escapeHTML ( data [ 'text' ] ) } </pre>` ;
25+ const collapseId = data [ 'config' ] [ 'operation_id' ] . replace ( / \. / g, '_' )
2526 if ( ! data [ 'success' ] ) {
2627 alertType = 'danger' ;
2728 msg = '<ul>' ;
@@ -30,10 +31,10 @@ $(function() {
3031 }
3132 msg += '</ul>' ;
3233 } else {
33- collapse = `<button type='button' class='btn btn-xs btn-success pull-right' data-toggle='collapse' data-target='#${ data [ 'config' ] [ 'operation_id' ] } ' aria-expanded='false'><span class='glyphicon glyphicon-chevron-right'></span><span class='glyphicon glyphicon-chevron-down'></span></button>"` ;
34- text = `<div id='${ data [ 'config' ] [ 'operation_id' ] } ' class='collapse'>${ text } </div>` ;
34+ collapse = `<button type='button' class='btn btn-xs btn-success pull-right' data-toggle='collapse' data-target='#${ collapseId } ' aria-expanded='false'><span class='glyphicon glyphicon-chevron-right'></span><span class='glyphicon glyphicon-chevron-down'></span></button>"` ;
35+ text = `<div id='${ collapseId } ' class='collapse'>${ data [ ' text' ] } </div>` ;
3536 }
36- var result = `<div class='alert alert-${ alertType } '><div class='row'><div class='col-xs-10 col-sm-11'>${ data [ 'config' ] [ 'summary' ] } <br />${ data [ 'config' ] [ 'urlpath' ] } <br />Took ${ data [ 'execution_time' ] } ms<br />${ msg } </div><div class='col-xs-2 col-sm-1'>${ collapse } </div></div>${ text } </div>` ;
37+ var result = `<div class='alert alert-${ alertType } '><div class='row'><div class='col-xs-10 col-sm-11'>${ data [ 'config' ] [ 'summary' ] } <br />${ data [ 'config' ] [ 'urlpath' ] } <br />Took ${ data [ 'execution_time' ] } ms<br />Status Code: ${ data [ 'status_code' ] } </div><div class='col-xs-2 col-sm-1'>${ collapse } </div></div>${ text } </div>` ;
3738 $ ( runner . find ( '.result' ) ) . append ( result ) ;
3839 } ) ;
3940 }
@@ -48,14 +49,14 @@ $(function() {
4849 remark = $ ( runner ) . find ( 'textarea[name="remark"]' ) . val ( ) ;
4950
5051 $ . post ( '/runtests/delete/json_body' , {
51- 'json_body' : jsonBody ,
52- 'operation_id' : operationId ,
53- 'profile_id' : window . CURRENT_PROFILE_ID ,
52+ 'json_body' : jsonBody ,
53+ 'operation_id' : operationId ,
54+ 'profile_id' : window . CURRENT_PROFILE_ID ,
5455 'order' : order ,
55- 'urlpath' : urlpath ,
56- 'replica_id' :replica_id ,
57- 'remark' :remark ,
58- 'csrfmiddlewaretoken' : window . CSRF
56+ 'urlpath' : urlpath ,
57+ 'replica_id' :replica_id ,
58+ 'remark' :remark ,
59+ 'csrfmiddlewaretoken' : window . CSRF
5960 } , function ( response ) {
6061 $ ( item_list ) . remove ( ) ;
6162 } ) ;
@@ -90,6 +91,7 @@ $(function() {
9091 urlpath = $ ( runner ) . find ( 'input[name="urlpath"]' ) . val ( ) ;
9192 replica_id = $ ( runner ) . find ( 'input[name="replica_id"]' ) . val ( ) ;
9293 remark = $ ( runner ) . find ( 'textarea[name="remark"]' ) . val ( ) ;
94+ testmethod = $ ( runner ) . find ( 'input[name="method"]' ) . val ( ) ;
9395
9496 $ . post ( '/runtests/save/json_body' , {
9597 'json_body' : jsonBody ,
@@ -99,9 +101,11 @@ $(function() {
99101 'urlpath' : urlpath ,
100102 'replica_id' :replica_id ,
101103 'remark' :remark ,
104+ 'method' :testmethod ,
102105 'csrfmiddlewaretoken' : window . CSRF
103106 } , function ( response ) {
104107 t . next ( ) . show ( ) . fadeOut ( 1000 ) ;
108+ location . reload ( ) ;
105109 } ) ;
106110 } ) ;
107111
@@ -115,6 +119,7 @@ $(function() {
115119 urlpath = $ ( runner ) . find ( 'input[name="urlpath"]' ) . val ( ) ;
116120 replica_id = $ ( runner ) . find ( 'input[name="replica_id"]' ) . val ( ) ;
117121 remark = $ ( runner ) . find ( 'textarea[name="remark"]' ) . val ( ) ;
122+ testmethod = $ ( runner ) . find ( 'input[name="method"]' ) . val ( ) ;
118123
119124 $ . post ( '/runtests/copy/json_body' , {
120125 'json_body' : jsonBody ,
@@ -124,6 +129,7 @@ $(function() {
124129 'urlpath' : urlpath ,
125130 'replica_id' :replica_id ,
126131 'remark' :remark ,
132+ 'method' :testmethod ,
127133 'csrfmiddlewaretoken' : window . CSRF
128134 } , function ( response ) {
129135 $ ( item_list ) . clone ( true ) . insertAfter ( $ ( item_list ) ) ;
0 commit comments