<commit_before>
{% extends "layout.html" %}
{% block content %}
<script type="text/javascript">
    $(function() {
        {% if data['test_batch'].ending_timestamp is none %}
            $('#testprogress').puiprogressbar();
        {% endif %}
     
        $('#accordion').puiaccordion({multiple:true});
        $('#accordion').puiaccordion('select', 1);

        {% if data['test_batch'].ending_timestamp is none %}
            var interval_id = setInterval(function() {
                var runner_log_length = $('#runnerlog > h6').length,
                    current_progress = $('.pui-progressbar-label').html();

                Sijax.request('update_info', [{{ testbatch_id }}, interval_id, runner_log_length, current_progress]);

            }, 2000);
        {% endif %}

    });
</script>
<div>
    {% if data['test_batch'].ending_timestamp is none %}
        <a class="btn btn-danger" href="javascript://" onclick="onTestBatchStop({{ testbatch_id }});" title="Stop this test batch" style="float: right; margin-right: 10px;">
           <i class="fa fa-stop"></i>
        </a>
    {% else %}
        <a class="btn btn-danger" href="javascript://" onclick="onTestBatchDelete({{ testbatch_id }});" title="Delete this test batch" style="float: right; margin-right: 10px;">
            <i class="fa fa-remove"></i>
        </a>
    {% endif %}
    <h1>Test Batch id: {{ testbatch_id }}</h1>
</div>
<div>
    {% if data['test_batch'].ending_timestamp is none %}
        <div id="testprogressdiv">
            <label>Test batch progress:</label>
            <div id="testprogress"></div>
        </div>
    {% endif %}
    <!-- <div id="testexecutiontimediv" {%if data['test_batch'].ending_timestamp is none %} style="display: none;" {% endif %}> -->
    <div id="testexecutiontimediv">
        <label>Total execution time:</label>
        <span id="testexecutiontimespan">
            <strong>{{ data['test_batch'].total_execution_time }}</strong>
        </span>
    </div>
    <div class="container-fluid">
        <div class="row-fluid text-center">
                <strong style="padding-left:20px;">Total tests:</strong> <span>{{ data['test_batch'].total_tests}}</span>
                <strong style="padding-left:20px;">Total finished tests:</strong> <span id="total_finished_tests">{{ data['test_batch'].total_finished_tests }}</span>
                <strong style="padding-left:20px;">Total executing tests:</strong> <span id="total_executing_tests">{{ data['test_batch'].total_executing_tests}}</span>
        </div>
    </div>
</div>
<div id="accordion">
    <h3>Report:</h3>
    <div>
        <ul class="list-unstyled">
            {% if show_network_capture %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.network_capture', testbatch_id = testbatch_id) }}"><i class="fa fa-cubes"></i> Network Capture</a>
                </li>
            {% endif %}
            {% if show_video_capture %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.video_recording_list', testbatch_id = testbatch_id) }}"><i class="fa fa-television"></i> Video recordings</a>
                </li>
            {% endif %}
            {% if show_bot_diary %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.bot_diary_list', testbatch_id = testbatch_id) }}"><i class="fa fa-pencil"></i> Bot diaries</a>
                </li>
            {% endif %}
            {% if show_test_instances %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.test_instances', testbatch_id = testbatch_id) }}"><i class="fa fa-list"></i> Test instances</a>
                </li>
            {% endif %}
            {% if show_quality_screenshot %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.quality_screenshot', testbatch_id = testbatch_id) }}"><i class="fa fa-eye"></i> Quality Screenshot</a>
                </li>
            {% endif %}
            <li>
                <a class="unlink" href="{{ url_for('testbatch.screenshot', testbatch_id = testbatch_id) }}"><i class="fa fa-file-image-o"></i> Screenshots (<span id="total_screenshots">{{ data['test_batch'].total_screenshots}}</span>)</a>
            </li>
            <li>
                <a class="unlink" href="{{ url_for('testbatch.testresult', testbatch_id = testbatch_id) }}">
                    <i class="fa fa-bar-chart"></i> 
                    Test results (<span id="total_test_results">{{ data['test_batch'].total_test_results}}</span>) Failed (<span id="total_failed_tests" style="color:red;"> {{ data['test_batch'].total_failed_tests }} </span>)
                </a>
            </li>
            <li>
                <a class="unlink" href="{{ url_for('testbatch.crash', testbatch_id = testbatch_id) }}"><i class="fa fa-exclamation-triangle"></i> Crash reports (<span id="total_crashes">{{ data['test_batch'].total_crashes}}</span>)</a>
            </li>
        </ul>
    </div>
 
    <h3>Runner's log:</h3>
    <div>
        <div id="runnerlog" style="overflow: auto; max-height: 500px;">
            {% for line in data['runner_log'] %}
                <h6>{{ line }}</h6>
            {% endfor %}
        </div>
    </div>

    <h3>Test instance's log:</h3>
    <div>
        {% if not data['logs']|count %}
            <div>
                <p>No logs</p>
            </div>
        {% else %}
            <div style="overflow: auto; max-height: 500px;">
                <ul class="list-unstyled">
                    {% for log in data['logs'] %}
                        <li>
                            <a class="unlink" target="_blank" href="{{ url_for('testbatch.test_batch_report_file', filename = log['path']) }}"><i class="fa fa-sticky-note"></i> {{ log['name'] }}</a>
                        </li>
                    {% endfor %}
                </ul><commit_msg>Put nb crash in red;<commit_after>
{% extends "layout.html" %}
{% block content %}
<script type="text/javascript">
    $(function() {
        {% if data['test_batch'].ending_timestamp is none %}
            $('#testprogress').puiprogressbar();
        {% endif %}
     
        $('#accordion').puiaccordion({multiple:true});
        $('#accordion').puiaccordion('select', 1);

        {% if data['test_batch'].ending_timestamp is none %}
            var interval_id = setInterval(function() {
                var runner_log_length = $('#runnerlog > h6').length,
                    current_progress = $('.pui-progressbar-label').html();

                Sijax.request('update_info', [{{ testbatch_id }}, interval_id, runner_log_length, current_progress]);

            }, 2000);
        {% endif %}

    });
</script>
<div>
    {% if data['test_batch'].ending_timestamp is none %}
        <a class="btn btn-danger" href="javascript://" onclick="onTestBatchStop({{ testbatch_id }});" title="Stop this test batch" style="float: right; margin-right: 10px;">
           <i class="fa fa-stop"></i>
        </a>
    {% else %}
        <a class="btn btn-danger" href="javascript://" onclick="onTestBatchDelete({{ testbatch_id }});" title="Delete this test batch" style="float: right; margin-right: 10px;">
            <i class="fa fa-remove"></i>
        </a>
    {% endif %}
    <h1>Test Batch id: {{ testbatch_id }}</h1>
</div>
<div>
    {% if data['test_batch'].ending_timestamp is none %}
        <div id="testprogressdiv">
            <label>Test batch progress:</label>
            <div id="testprogress"></div>
        </div>
    {% endif %}
    <!-- <div id="testexecutiontimediv" {%if data['test_batch'].ending_timestamp is none %} style="display: none;" {% endif %}> -->
    <div id="testexecutiontimediv">
        <label>Total execution time:</label>
        <span id="testexecutiontimespan">
            <strong>{{ data['test_batch'].total_execution_time }}</strong>
        </span>
    </div>
    <div class="container-fluid">
        <div class="row-fluid text-center">
                <strong style="padding-left:20px;">Total tests:</strong> <span>{{ data['test_batch'].total_tests}}</span>
                <strong style="padding-left:20px;">Total finished tests:</strong> <span id="total_finished_tests">{{ data['test_batch'].total_finished_tests }}</span>
                <strong style="padding-left:20px;">Total executing tests:</strong> <span id="total_executing_tests">{{ data['test_batch'].total_executing_tests}}</span>
        </div>
    </div>
</div>
<div id="accordion">
    <h3>Report:</h3>
    <div>
        <ul class="list-unstyled">
            {% if show_network_capture %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.network_capture', testbatch_id = testbatch_id) }}"><i class="fa fa-cubes"></i> Network Capture</a>
                </li>
            {% endif %}
            {% if show_video_capture %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.video_recording_list', testbatch_id = testbatch_id) }}"><i class="fa fa-television"></i> Video recordings</a>
                </li>
            {% endif %}
            {% if show_bot_diary %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.bot_diary_list', testbatch_id = testbatch_id) }}"><i class="fa fa-pencil"></i> Bot diaries</a>
                </li>
            {% endif %}
            {% if show_test_instances %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.test_instances', testbatch_id = testbatch_id) }}"><i class="fa fa-list"></i> Test instances</a>
                </li>
            {% endif %}
            {% if show_quality_screenshot %}
                <li>
                    <a class="unlink" href="{{ url_for('testbatch.quality_screenshot', testbatch_id = testbatch_id) }}"><i class="fa fa-eye"></i> Quality Screenshot</a>
                </li>
            {% endif %}
            <li>
                <a class="unlink" href="{{ url_for('testbatch.screenshot', testbatch_id = testbatch_id) }}"><i class="fa fa-file-image-o"></i> Screenshots (<span id="total_screenshots">{{ data['test_batch'].total_screenshots}}</span>)</a>
            </li>
            <li>
                <a class="unlink" href="{{ url_for('testbatch.testresult', testbatch_id = testbatch_id) }}">
                    <i class="fa fa-bar-chart"></i> 
                    Test results (<span id="total_test_results">{{ data['test_batch'].total_test_results}}</span>) Failed (<span id="total_failed_tests" style="color:red;"> {{ data['test_batch'].total_failed_tests }} </span>)
                </a>
            </li>
            <li>
                <a class="unlink" href="{{ url_for('testbatch.crash', testbatch_id = testbatch_id) }}"><i class="fa fa-exclamation-triangle"></i> Crash reports (<span id="total_crashes" style="color:red;">{{ data['test_batch'].total_crashes}}</span>)</a>
            </li>
        </ul>
    </div>
 
    <h3>Runner's log:</h3>
    <div>
        <div id="runnerlog" style="overflow: auto; max-height: 500px;">
            {% for line in data['runner_log'] %}
                <h6>{{ line }}</h6>
            {% endfor %}
        </div>
    </div>

    <h3>Test instance's log:</h3>
    <div>
        {% if not data['logs']|count %}
            <div>
                <p>No logs</p>
            </div>
        {% else %}
            <div style="overflow: auto; max-height: 500px;">
                <ul class="list-unstyled">
                    {% for log in data['logs'] %}
                        <li>
                            <a class="unlink" target="_blank" href="{{ url_for('testbatch.test_batch_report_file', filename = log['path']) }}"><i class="fa fa-sticky-note"></i> {{ log['name'] }}</a>
                        </li>
                    {% endfor %}
                </ul>
{'fraction_non_alphanumeric': 0.18155765340525962, 'fraction_numerical': 0.005394470667565745, 'mean_word_length': 2.2137053087757312, 'pattern_counts': {'":': 0, '<': 273, '<?xml version=': 0, '>': 275, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '363073', 'n_tokens_mistral': 3821, 'n_tokens_neox': 3476, 'n_words': 704}