Add data-testid to test relevant elements (fixes #244)
Change-Id: Id908e38f01e426543ed98975544204a9a632294d
diff --git a/templates/exception.html.ep b/templates/exception.html.ep
index f85edc6..abff9aa 100644
--- a/templates/exception.html.ep
+++ b/templates/exception.html.ep
@@ -1,6 +1,6 @@
% my $msg = stash('msg') // stash('exception')->message // '500: Internal Server Error';
% layout 'main', title => 'KorAP: ' . $msg;
-<p class="no-results"><%= $msg %></p>
+<p class="no-results" data-testid="error-message"><%= $msg %></p>
% notify('error' => $msg);
diff --git a/templates/failure.html.ep b/templates/failure.html.ep
index e1f6fb3..c644e3a 100644
--- a/templates/failure.html.ep
+++ b/templates/failure.html.ep
@@ -9,5 +9,5 @@
<p class="no-results"><%= loc('notIssued') %></p>
% if (stash('err_msg')) {
-<p class="no-results"><%== loc(stash('err_msg'),stash('err_msg')) %></p>
+<p class="no-results" data-testid="error-message"><%== loc(stash('err_msg'),stash('err_msg')) %></p>
% }
diff --git a/templates/not_found.html.ep b/templates/not_found.html.ep
index 8410580..87d649b 100644
--- a/templates/not_found.html.ep
+++ b/templates/not_found.html.ep
@@ -1,6 +1,6 @@
% my $msg = stash('msg') // loc('notFound');
% layout 'main', title => 'KorAP: ' . loc('notFound');
-<p class="no-results"><%= $msg %></p>
+<p class="no-results" data-testid="error-message"><%= $msg %></p>
% notify('warn' => $msg);
diff --git a/templates/partial/header.html.ep b/templates/partial/header.html.ep
index 966401e..5a2189a 100644
--- a/templates/partial/header.html.ep
+++ b/templates/partial/header.html.ep
@@ -1,5 +1,5 @@
% content_block 'headerButtonGroup', { position => 50 }, begin
- <h3 class="nav-link"><a class="link-guided-tour">Tour</a></h3>
+ <h3 class="nav-link"><a class="link-guided-tour" data-testid="tour-start">Tour</a></h3>
% end
% content_block 'headerButtonGroup', { position => 100 }, begin
@@ -7,7 +7,7 @@
% end
<nav class="navbar">
- <%= link_to 'index', class => 'logo', begin %><h1><span><%= title() // loc('korap_desc') %></span><% if (loc('title_addon')) { %><div class="logoaddon"><%= loc('title_addon') %></div><% } %></h1><% end %>
+ <%= link_to 'index', class => 'logo', 'data-testid' => 'home', begin %><h1><span><%= title() // loc('korap_desc') %></span><% if (loc('title_addon')) { %><div class="logoaddon"><%= loc('title_addon') %></div><% } %></h1><% end %>
<div class="navbar-group">
%= content_block 'headerButtonGroup'