From f5ccdbdeccd010b47840cd90f2f8f88c59f4c1da Mon Sep 17 00:00:00 2001 From: Milosz Wasilewski Date: Tue, 25 Oct 2016 18:49:20 +0100 Subject: plans: added test plan rendering script Change-Id: I3765f688be40dc6fe0a91a9ed6ed72cc3dfd88db Signed-off-by: Milosz Wasilewski --- plans/templates/_test_details.html | 22 +++++++++ plans/templates/test.html | 96 ++++++++++++++++++++++++++++++++++++++ plans/templates/testplan.html | 73 +++++++++++++++++++++++++++++ 3 files changed, 191 insertions(+) create mode 100644 plans/templates/_test_details.html create mode 100644 plans/templates/test.html create mode 100644 plans/templates/testplan.html (limited to 'plans/templates') 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 @@ + + {% if 'filename' in test and test.filename != "" %} +

details

+ {% endif %} + + {% for key,value in test.items() %} + {% if key != 'missing' and key != 'filename' %} + + + + {% endif %} + {% endfor %} + +
{{ key }} + {% if value is mapping %} + {% for subkey,subvalue in value.items() %} + {{ subkey }}: {{ subvalue }}
+ {% endfor %} + {% else %} + {{ value }} + {% endif %} +
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 @@ + + + + + + + + + + + +
+

{{ obj.metadata.name }}

+

Metadata

+ + + {% for key,value in obj.metadata.items() %} + {% if key != 'name' %} + + + + + {% endif %} + {% endfor %} + +
{{ key }} + {% if value is sequence and value is not string %} +
    + {% for item in value %} +
  • {{ item }} + {% endfor %} +
+ {% else %} + {{ value }} + {% endif %} +
+ {% if 'params' in obj %} +

Parameters

+ + + {% for key,value in obj.params.items() %} + {% if key != 'name' %} + + + + + {% endif %} + {% endfor %} + +
{{ key }} + {% if value is mapping %} + {% for subkey,subvalue in value.items() %} + {{ subkey }}: {{ subvalue }}
+ {% endfor %} + {% else %} + {{ value }} + {% endif %} +
+ {% endif %} + {% if 'install' in obj %} +

Installation

+ + + {% for value in obj.install.steps %} + + + + {% endfor %} + +
{{ value }}
+ {% endif %} +

Run

+ + + {% for value in obj.run.steps %} + + + + {% endfor %} + +
{{ value }}
+ {% if 'expected' in obj.run %} +

Expected

+ + + {% for value in obj.run.expected %} + + + + {% endfor %} + +
{{ value }}
+ {% endif %} +
+ + 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 @@ + + + + + + + + + + +
+
+

Metadata

+ + + + + + + + + {% for key,value in obj.metadata.items() %} + + + + + {% endfor %} + +
KeyValue
{{ key }} + {% if value is sequence and value is not string %} +
    + {% for item in value %} +
  • {{ item }} + {% endfor %} +
+ {% else %} + {{ value }} + {% endif %} +
+
+
+

Requirements

+ {% for req in obj.requirements %} + {% set outer_loop = loop %} +
+

{{ loop.index}} {{ req.name }}

+

Owner: {{ req.owner }}

+ {% if req.tests %} + {% if req.tests.manual is defined and req.tests.manual is not none %} +

Manual tests

+ {% for test in req.tests.manual %} +
+
{{ outer_loop.index }}.{{ loop.index }}
+ {% include "_test_details.html" %} +
+ {% endfor %} + {% endif %} + {% if req.tests.automated is defined and req.tests.automated is not none %} +

Automated tests

+ {% for test in req.tests.automated %} +
+
{{ outer_loop.index }}.{{ loop.index }}
+ {% include "_test_details.html" %} +
+ {% endfor %} + {% endif %} + {% endif %} +
+ {% endfor %} +
+
+ + -- cgit v1.2.3