diff options
author | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-10-25 18:49:20 +0100 |
---|---|---|
committer | Milosz Wasilewski <milosz.wasilewski@linaro.org> | 2016-11-01 11:46:01 +0000 |
commit | f5ccdbdeccd010b47840cd90f2f8f88c59f4c1da (patch) | |
tree | 6812036ab71b0c40300c8b9d924a2211da320b43 /plans/templates | |
parent | df73087277c1062ae6d1d7f781d5a5a386681ced (diff) |
plans: added test plan rendering script
Change-Id: I3765f688be40dc6fe0a91a9ed6ed72cc3dfd88db
Signed-off-by: Milosz Wasilewski <milosz.wasilewski@linaro.org>
Diffstat (limited to 'plans/templates')
-rw-r--r-- | plans/templates/_test_details.html | 22 | ||||
-rw-r--r-- | plans/templates/test.html | 96 | ||||
-rw-r--r-- | plans/templates/testplan.html | 73 |
3 files changed, 191 insertions, 0 deletions
diff --git a/plans/templates/_test_details.html b/plans/templates/_test_details.html new file mode 100644 index 0000000..ed7d41d --- /dev/null +++ b/plans/templates/_test_details.html @@ -0,0 +1,22 @@ +<table class="table table-striped"> + {% if 'filename' in test and test.filename != "" %} + <h4><a href="{{ test.filename }}">details</a></h4> + {% endif %} + <tbody> + {% for key,value in test.items() %} + {% if key != 'missing' and key != 'filename' %} + <tr> + <td>{{ key }}</td> + <td> + {% if value is mapping %} + {% for subkey,subvalue in value.items() %} + <strong>{{ subkey }}</strong>: {{ subvalue }}<br/> + {% endfor %} + {% else %} + {{ value }} + {% endif %} + </tr> + {% endif %} + {% endfor %} + </tbody> +</table> diff --git a/plans/templates/test.html b/plans/templates/test.html new file mode 100644 index 0000000..f3d57b7 --- /dev/null +++ b/plans/templates/test.html @@ -0,0 +1,96 @@ +<!DOCTYPE html> +<html lang=en> + <head> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> + <!-- Optional theme --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> + <!-- Latest compiled and minified JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + + </head> + <body> + <div class="container"> + <h1>{{ obj.metadata.name }}</h1> + <h3>Metadata</h3> + <table class="table table-striped"> + <tbody> + {% for key,value in obj.metadata.items() %} + {% if key != 'name' %} + <tr> + <td>{{ key }}</td> + <td> + {% if value is sequence and value is not string %} + <ul> + {% for item in value %} + <li>{{ item }} + {% endfor %} + </ul> + {% else %} + {{ value }} + {% endif %} + </td> + </tr> + {% endif %} + {% endfor %} + </tbody> + </table> + {% if 'params' in obj %} + <h3>Parameters</h3> + <table class="table table-striped"> + <tbody> + {% for key,value in obj.params.items() %} + {% if key != 'name' %} + <tr> + <td>{{ key }}</td> + <td> + {% if value is mapping %} + {% for subkey,subvalue in value.items() %} + <strong>{{ subkey }}</strong>: {{ subvalue }}<br/> + {% endfor %} + {% else %} + {{ value }} + {% endif %} + </td> + </tr> + {% endif %} + {% endfor %} + </tbody> + </table> + {% endif %} + {% if 'install' in obj %} + <h3>Installation</h3> + <table class="table table-striped"> + <tbody> + {% for value in obj.install.steps %} + <tr> + <td>{{ value }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} + <h3>Run</h3> + <table class="table table-striped"> + <tbody> + {% for value in obj.run.steps %} + <tr> + <td>{{ value }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% if 'expected' in obj.run %} + <h3>Expected</h3> + <table class="table table-striped"> + <tbody> + {% for value in obj.run.expected %} + <tr> + <td>{{ value }}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} + </div> + </body> +</html> diff --git a/plans/templates/testplan.html b/plans/templates/testplan.html new file mode 100644 index 0000000..6551b2c --- /dev/null +++ b/plans/templates/testplan.html @@ -0,0 +1,73 @@ +<!DOCTYPE html> +<html lang=en> + <head> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> + <!-- Optional theme --> + <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous"> + <!-- Latest compiled and minified JavaScript --> + <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> + </head> + <body> + <div class="container"> + <div id="metadata"> + <h1>Metadata</h1> + <table class="table table-striped"> + <thead> + <tr> + <th>Key</th> + <th>Value</th> + </tr> + </thead> + <tbody> + {% for key,value in obj.metadata.items() %} + <tr> + <td>{{ key }}</td> + <td> + {% if value is sequence and value is not string %} + <ul> + {% for item in value %} + <li>{{ item }} + {% endfor %} + </ul> + {% else %} + {{ value }} + {% endif %} + </td> + </tr> + {% endfor %} + </tbody> + </table> + </div> + <div id="requirements"> + <h1>Requirements</h1> + {% for req in obj.requirements %} + {% set outer_loop = loop %} + <div {% if req.covered %}class="covered"{% else %}class="alert alert-danger"{% endif %}> + <h2>{{ loop.index}} {{ req.name }}</h2> + <h4>Owner: {{ req.owner }}</h4> + {% if req.tests %} + {% if req.tests.manual is defined and req.tests.manual is not none %} + <h3>Manual tests</h3> + {% for test in req.tests.manual %} + <div {% if test.missing %}class="alert alert-danger"{% endif %}> + <h5>{{ outer_loop.index }}.{{ loop.index }}</h5> + {% include "_test_details.html" %} + </div> + {% endfor %} + {% endif %} + {% if req.tests.automated is defined and req.tests.automated is not none %} + <h3>Automated tests</h3> + {% for test in req.tests.automated %} + <div {% if test.missing %}class="alert alert-danger"{% endif %}> + <h5>{{ outer_loop.index }}.{{ loop.index }}</h5> + {% include "_test_details.html" %} + </div> + {% endfor %} + {% endif %} + {% endif %} + </div> + {% endfor %} + </div> + </div> + </body> +</html> |