<commit_before>{% extends '::base.html.twig' %}

{% block body %}
    <main>
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <h4>Your testcases</h4>
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="panel panel-info">
                                <p class="panel-body">
                                    Hover over (on mobile: tap) each block in the timeline for
                                    access to the Selenium <b>logs</b>, web performance
                                    <b>metrics</b> (detailed waterfall for each page requested), and
                                    failure <b>screenshots</b>.
                                </p>
                            </div>
                        </div>
                    </div>
                    <a class="pull-right" {% if (not isDemoMode) %} href="{{ path('testcases.new') }}" {% else %} data-toggle="tooltip" data-placement="top" title="Not available in demo mode" {% endif %}>
                        ＋ Add another testcase</a>
                    <table class="table testcases">
                        {% for testcase in testcases %}
                            <tr class="journeymonitor-testcase-entry-row">
                                <td class="journeymonitor-testcase-entry-cell">
                                    <h4>
                                        <a {% if (not isDemoMode) %} href="{{ path('testcases.edit', {'testcaseId': testcase.id}) }}" {% else %} data-toggle="tooltip" data-placement="top" title="Not available in demo mode" {% endif %}>{{ testcase.title }}</a>
                                    </h4>
                                    <div class="pull-right journeymonitor-testcase-entry-metainfo">
                                        <span class="label label-default">{{ testcase.cadence }}</span>
                                        {% if (testcase.enabled) %}
                                            <span class="label label-success">Enabled</span>
                                        {% else %}
                                            <span class="label label-default">Disabled</span>
                                        {% endif %}
                                    </div>
                                    <div class="well well-sm journeymonitor-testcase-entry-timeline-container">
                                        {% if (testcase.limitedtestresults(100)|length > 0) %}
                                            {% spaceless %}
                                                <div class="inline-block">
                                                {% for testresult in testcase.limitedtestresults(100)|slice(0, 30)|reverse %}
                                                    {% if loop.first %}
                                                        <small>
                                                            ┌
                                                            {% if "now"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                today at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% elseif "-1 day"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                yesterday at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% else %}
                                                                {{ testresult.datetimeRun|date("Y-m-d \\a\\t H:i") }}
                                                            {% endif %}
                                                        </small>
                                                        <br>
                                                    {% endif %}
                                                    <a class="journeymonitor-testresult-dot-anchor label-{% if (testresult.exitCode == 0) %}success{% elseif (testresult.exitCode == 2 or testresult.exitCode == 3) %}danger{% else %}warning{% endif %}"
                                                       title="{{ testresult.datetimeRun|date("Y-m-d H:i") }}"
                                                       data-content="
                                                           {% if (testresult.exitCode == 0) %}
                                                               Journey completed without error.
                                                           {% elseif (testresult.exitCode == 2 or testresult.exitCode == 3) %}
                                                               Journey could not be completed.
                                                           {% else %}
                                                               There was a problem with the test case script.
                                                           {% endif %}
                                                           <br>
                                                           <br>
                                                           <span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span>&nbsp;
                                                           <a href='{% if (isDemoMode) %}/demo{% endif %}{{ path('testresults.show', {'testresultId': testresult.id}) }}'>Click for Selenium log</a>
                                                           {% if (testresult.har) %}
                                                               <br>
                                                               <span class='glyphicon glyphicon-align-left' aria-hidden='true'></span>&nbsp;
                                                               <a target='_blank' href='http://www.softwareishard.com/har/viewer/?inputUrl={{ app.request.getSchemeAndHttpHost() }}{{ path('testresult-show-har', {'testresultId': testresult.id}) }}'>Click for performance metrics</a>
                                                           {% endif %}
                                                           {% if (testresult.failScreenshotFilename) %}
                                                               <br>
                                                               <span class='glyphicon glyphicon-camera' aria-hidden='true'></span>&nbsp;
                                                               <a target='_blank' href='{{ path('testresult-screenshots', {'filename': testresult.failScreenshotFilename}) }}.png'>Click for failure screenshot</a>
                                                           {% endif %}
                                                       "
                                                       href="{% if (isDemoMode) %}/demo{% endif %}{{ path('testresults.show', {'testresultId': testresult.id}) }}"></a>

                                                    {% if loop.last and not loop.first %}

                                                        {% if loop.last and loop.index > 6 %}
                                                            <br>
                                                        {% endif %}

                                                        <small class="until pull-right">
                                                            {% if loop.index <= 6 %}
                                                                &nbsp;&nbsp;─&nbsp;
                                                            {% endif %}

                                                            {% if "now"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                today at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% elseif "-1 day"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                yesterday at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% else %}
                                                                {{ testresult.datetimeRun|date("Y-m-d \\a\\t H:i") }}
                                                            {% endif %}

                                                            {% if loop.index > 6 %}
                                                                ┘
                                                            {% endif %}
                                                        </small>

                                                    {% endif %}

                                                {% endfor %}
                                                </div>
                                            {% endspaceless %}
                                        {% else %}
                                            <small>No test run results yet.</small>
                                        {% endif %}
                                        {% if (testcase.limitedtestresults(100)|length > 30) %}
                                            <br>
                                            <br>
                                            <small>
                                                <a data-toggle="collapse" data-target="#testresults-{{ testcase.id }}">Show last 100 results</a>
                                            </small>
<commit_msg>Bug https://trello.com/c/6CZuhTe9:<commit_after>{% extends '::base.html.twig' %}

{% block body %}
    <main>
        <div class="container">
            <div class="row">
                <div class="col-xs-12">
                    <h4>Your testcases</h4>
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="panel panel-info">
                                <p class="panel-body">
                                    Hover over (on mobile: tap) each block in the timeline for
                                    access to the Selenium <b>logs</b>, web performance
                                    <b>metrics</b> (detailed waterfall for each page requested), and
                                    failure <b>screenshots</b>.
                                </p>
                            </div>
                        </div>
                    </div>
                    <a class="pull-right" {% if (not isDemoMode) %} href="{{ path('testcases.new') }}" {% else %} data-toggle="tooltip" data-placement="top" title="Not available in demo mode" {% endif %}>
                        ＋ Add another testcase</a>
                    <table class="table testcases">
                        {% for testcase in testcases %}
                            <tr class="journeymonitor-testcase-entry-row">
                                <td class="journeymonitor-testcase-entry-cell">
                                    <h4>
                                        <a {% if (not isDemoMode) %} href="{{ path('testcases.edit', {'testcaseId': testcase.id}) }}" {% else %} data-toggle="tooltip" data-placement="top" title="Not available in demo mode" {% endif %}>{{ testcase.title }}</a>
                                    </h4>
                                    <div class="pull-right journeymonitor-testcase-entry-metainfo">
                                        <span class="label label-default">{{ testcase.cadence }}</span>
                                        {% if (testcase.enabled) %}
                                            <span class="label label-success">Enabled</span>
                                        {% else %}
                                            <span class="label label-default">Disabled</span>
                                        {% endif %}
                                    </div>
                                    <div class="well well-sm journeymonitor-testcase-entry-timeline-container">
                                        {% if (testcase.limitedtestresults(100)|length > 0) %}
                                            {% spaceless %}
                                                <div class="inline-block">
                                                {% for testresult in testcase.limitedtestresults(100)|slice(0, 30)|reverse %}
                                                    {% if loop.first %}
                                                        <small>
                                                            ┌
                                                            {% if "now"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                today at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% elseif "-1 day"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                yesterday at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% else %}
                                                                {{ testresult.datetimeRun|date("Y-m-d \\a\\t H:i") }}
                                                            {% endif %}
                                                        </small>
                                                        <br>
                                                    {% endif %}
                                                    <a class="journeymonitor-testresult-dot-anchor label-{% if (testresult.exitCode == 0) %}success{% elseif (testresult.exitCode == 2 or testresult.exitCode == 3) %}danger{% else %}warning{% endif %}"
                                                       title="{{ testresult.datetimeRun|date("Y-m-d H:i") }}"
                                                       data-content="
                                                           {% if (testresult.exitCode == 0) %}
                                                               Journey completed without error.
                                                           {% elseif (testresult.exitCode == 2 or testresult.exitCode == 3) %}
                                                               Journey could not be completed.
                                                           {% else %}
                                                               There was a problem with the test case script.
                                                           {% endif %}
                                                           <br>
                                                           <br>
                                                           <span class='glyphicon glyphicon-eye-open' aria-hidden='true'></span>&nbsp;
                                                           <a href='{% if (isDemoMode) %}/demo{% endif %}{{ path('testresults.show', {'testresultId': testresult.id}) }}'>Click for Selenium log</a>
                                                           {% if (testresult.har) %}
                                                               <br>
                                                               <span class='glyphicon glyphicon-align-left' aria-hidden='true'></span>&nbsp;
                                                               <a target='_blank' href='http://www.softwareishard.com/har/viewer/?inputUrl={{ app.request.getSchemeAndHttpHost() }}{{ path('testresult-show-har', {'testresultId': testresult.id}) }}'>Click for performance metrics</a>
                                                           {% endif %}
                                                           {% if (testresult.failScreenshotFilename) %}
                                                               <br>
                                                               <span class='glyphicon glyphicon-camera' aria-hidden='true'></span>&nbsp;
                                                               <a target='_blank' href='{{ path('testresult-screenshots', {'filename': testresult.failScreenshotFilename}) }}.png'>Click for failure screenshot</a>
                                                           {% endif %}
                                                       "
                                                       href="{% if (isDemoMode) %}/demo{% endif %}{{ path('testresults.show', {'testresultId': testresult.id}) }}"></a>

                                                    {% if loop.last and not loop.first %}

                                                        {% if loop.last and loop.index > 6 %}
                                                            <br>
                                                        {% endif %}

                                                        <small class="until pull-right">
                                                            {% if loop.index <= 6 %}
                                                                &nbsp;&nbsp;─&nbsp;
                                                            {% endif %}

                                                            {% if "now"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                today at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% elseif "-1 day"|date("Y-m-d") == testresult.datetimeRun|date("Y-m-d") %}
                                                                yesterday at {{ testresult.datetimeRun|date("H:i") }}
                                                            {% else %}
                                                                {{ testresult.datetimeRun|date("Y-m-d \\a\\t H:i") }}
                                                            {% endif %}

                                                            {% if loop.index > 6 %}
                                                                ┘
                                                            {% endif %}
                                                        </small>

                                                    {% endif %}

                                                {% endfor %}
                                                </div>
                                            {% endspaceless %}
                                        {% else %}
                                            <small>No test run results yet.</small>
                                        {% endif %}
                                        {% if (testcase.limitedtestresults(100)|length > 30) %}
                                            <br>
                                            <br>
                                            <small>
                                                <a href="javascript:return false;" data-toggle="collapse" data-target="#testresults-{{ testcase.id }}">Show last 100 results</a>
                                            </small>

{'fraction_non_alphanumeric': 0.10186774881639873, 'fraction_numerical': 0.003954008636387285, 'mean_word_length': 0.6302264438978882, 'pattern_counts': {'":': 0, '<': 149, '<?xml version=': 0, '>': 155, 'https://': 1, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 352, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '932761', 'n_tokens_mistral': 3518, 'n_tokens_neox': 3117, 'n_words': 703}