From 565f29dfe600ca22094923ac40a33fc5377b1c64 Mon Sep 17 00:00:00 2001
From: Emanuele Aina <emanuele.aina@collabora.com>
Date: Thu, 11 Jul 2019 16:23:49 +0200
Subject: [PATCH] atc: Render links and images in the steps list

The lack of links support in the `steps:` list caused the `sdk-persistent-disk`
to lack important instructions, making testers more confused than necessary.

Signed-off-by: Emanuele Aina <emanuele.aina@collabora.com>
---
 atc_renderer/templates/test_case.html    |  2 ++
 atc_renderer/tests_files/test_file1.html |  8 +++++
 atc_renderer/tests_files/test_file2.html | 38 ++++++++++++++++++++++++
 atc_renderer/tests_files/test_file2.yaml |  2 ++
 atc_renderer/tests_files/test_file3.html | 20 +++++++++++++
 atc_renderer/tests_files/test_file4.html |  8 +++++
 atc_renderer/tests_files/test_file5.html |  8 +++++
 7 files changed, 86 insertions(+)

diff --git a/atc_renderer/templates/test_case.html b/atc_renderer/templates/test_case.html
index d3e1511..b958413 100644
--- a/atc_renderer/templates/test_case.html
+++ b/atc_renderer/templates/test_case.html
@@ -60,6 +60,8 @@
       {% if comment %}<li class="mb-sm-2">{{ comment|e }}</li>{% endif %}
       {% if command %}<p><kbd>{{ command|e }}</kbd></p>{% endif %}
       {% if output %}{% for l in output %}<p class="mb-sm-0 pl-sm-3"><samp>{{ l|e }}</samp></p>{% endfor %}{% endif %}
+      {% if image %}<img src="images/{{ image }}" class="img-fluid">{% endif %}
+      {% if link %}<p><a href="{{ link }}">{{ link }}</a></p>{% endif %}
       {% endfor %}
       </ol>
 
diff --git a/atc_renderer/tests_files/test_file1.html b/atc_renderer/tests_files/test_file1.html
index 841526b..e13ecbb 100644
--- a/atc_renderer/tests_files/test_file1.html
+++ b/atc_renderer/tests_files/test_file1.html
@@ -87,17 +87,25 @@
       
       
       
+      
+      
       <p><kbd>$ cd apertis-tests</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2"> Execute the following command:</li>
       
       
       
       
+      
+      
       <p><kbd>$ common/sanity-check</kbd></p>
       
       
+      
+      
       </ol>
 
       <hr />
diff --git a/atc_renderer/tests_files/test_file2.html b/atc_renderer/tests_files/test_file2.html
index 9ab091a..ee3a327 100644
--- a/atc_renderer/tests_files/test_file2.html
+++ b/atc_renderer/tests_files/test_file2.html
@@ -64,53 +64,91 @@
       
       
       
+      
+      
       <p><kbd>$ env CLUTTER_PAINT=paint-volumes GtkClutterLauncher file:///usr/share/webkit2gtk/testing/actor-tiles-test.html</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2">Check that the rendering of the page matches the reference in the results section.</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Click the link that will scroll the page a bit</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Check that the rendering of the page matches the reference in the results section</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Click the link that will scroll to the very bottom</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Check that the rendering of the page matches the reference in the results section</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Click the first link that will take you to a different page</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Check that the rendering of the page matches the reference in the results section</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Click the back button of the browser</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Check that the rendering of the page matches the reference in the results section</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Click the second link, that will send you to the bottom</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Follow the links again until you get to the end of the page again, always making sure the rendering matches the reference rendering</li>
       
       
       
+      
+      
+      <li class="mb-sm-2">Open the following link and verify the page is loaded with no glaring errors:</li>
+      
+      
+      
+      
+      
+      
+      
+      
+      
+      <p><a href="https://apertis.org">https://apertis.org</a></p>
+      
       </ol>
 
       <hr />
diff --git a/atc_renderer/tests_files/test_file2.yaml b/atc_renderer/tests_files/test_file2.yaml
index 9fe1fa6..36fea06 100644
--- a/atc_renderer/tests_files/test_file2.yaml
+++ b/atc_renderer/tests_files/test_file2.yaml
@@ -60,3 +60,5 @@ run:
     - "Click the second link, that will send you to the bottom"
     - "Follow the links again until you get to the end of the page again, always
        making sure the rendering matches the reference rendering"
+    - "Open the following link and verify the page is loaded with no glaring errors:"
+    - "~https://apertis.org"
diff --git a/atc_renderer/tests_files/test_file3.html b/atc_renderer/tests_files/test_file3.html
index a918c4b..817ad7b 100644
--- a/atc_renderer/tests_files/test_file3.html
+++ b/atc_renderer/tests_files/test_file3.html
@@ -68,41 +68,61 @@
       
       
       
+      
+      
       <p><kbd>$ pactl stat</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2">Run btmon before any connection happens:</li>
       
       
       
       
+      
+      
       <p><kbd>$ sudo btmon  | grep -A4 &#39;AV/C: Control&#39;</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2">Start simple agent:</li>
       
       
       
       
+      
+      
       <p><kbd>$ /usr/lib/chaiwala-tests/bluez/simple-agent -y</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2">Pair both devices initiating from the phone side</li>
       
       
       
+      
+      
       <li class="mb-sm-2">Pay attention to the simple-agent window as it requires input during the pairing process.</li>
       
       
       
+      
+      
       <li class="mb-sm-2">In another terminal, execute (You can get the Bluetooth device address by running hcitool scan):</li>
       
       
       
       
+      
+      
       <p><kbd>$ /usr/lib/chaiwala-tests/bluez/test-avrcp.py -i hci0 device_address</kbd></p>
       
       
+      
+      
       </ol>
 
       <hr />
diff --git a/atc_renderer/tests_files/test_file4.html b/atc_renderer/tests_files/test_file4.html
index 5695d51..bcf72de 100644
--- a/atc_renderer/tests_files/test_file4.html
+++ b/atc_renderer/tests_files/test_file4.html
@@ -57,17 +57,25 @@
       
       
       
+      
+      
       <p><kbd>$ cd apparmor</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2"> Execute the following command:</li>
       
       
       
       
+      
+      
       <p><kbd>$ common/run-test-in-systemd --basename --timeout 3000 ./apparmor.sh</kbd></p>
       
       
+      
+      
       </ol>
 
       <hr />
diff --git a/atc_renderer/tests_files/test_file5.html b/atc_renderer/tests_files/test_file5.html
index d5afb13..a2d0743 100644
--- a/atc_renderer/tests_files/test_file5.html
+++ b/atc_renderer/tests_files/test_file5.html
@@ -69,17 +69,25 @@
       
       
       
+      
+      
       <p><kbd>$ cd apertis-tests</kbd></p>
       
       
+      
+      
       <li class="mb-sm-2"> Execute the following command:</li>
       
       
       
       
+      
+      
       <p><kbd>$ common/run-test-in-systemd --timeout=900 --chdir /tmp/ribchester-* --user=user --name=ribchester -- sadt --verbose</kbd></p>
       
       
+      
+      
       </ol>
 
       <hr />
-- 
GitLab