Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
{{!
2
    This file is part of Moodle - https://moodle.org/
3
 
4
    Moodle is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU General Public License as published by
6
    the Free Software Foundation, either version 3 of the License, or
7
    (at your option) any later version.
8
 
9
    Moodle is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
 
14
    You should have received a copy of the GNU General Public License
15
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
}}
17
{{!
18
    @template tool_generator/parsingresult
19
 
20
    Display the result of parsing or executing a behat testing scenario.
21
 
22
    Example context (json):
23
    {
24
        "isvalid": true,
25
        "generalerror": "Error message",
26
        "haslines": true,
27
        "scenarios": [
28
            {
29
                "type": "Scenario",
30
                "title": "Scenario title",
31
                "hassteps": true,
32
                "steps": [
33
                    {
34
                        "text": "Step text",
35
                        "isvalid": true,
36
                        "isexecuted": true,
37
                        "hasarguments": true,
38
                        "arguments": "Argument text",
39
                        "error": "Error message"
40
                    }
41
                ]
42
            }
43
        ]
44
    }
45
}}
46
{{^isvalid}}
47
<div class="alert alert-danger mb-3" role="alert">
48
    <span class="fa fa-times"></span>
49
    {{generalerror}}
50
</div>
51
{{/isvalid}}
52
{{#haslines}}
53
    <p>{{#str}} testscenario_steps, tool_generator {{/str}}</p>
54
{{/haslines}}
55
{{#scenarios}}
56
<h3>{{type}}: {{name}}</h3>
57
<div>
58
    {{#scenarioerror}}
59
    <div class="alert alert-danger mb-3" role="alert">
60
        <span class="fa fa-times"></span>
61
        {{scenarioerror}}
62
    </div>
63
    {{/scenarioerror}}
64
    {{^hassteps}}
65
    <div class="alert alert-info mb-3" role="alert">
66
        <span class="fa fa-info-circle"></span>
67
        {{#str}} testscenario_scenarionosteps, tool_generator {{/str}}
68
    </div>
69
    {{/hassteps}}
70
    {{#hassteps}}
71
    <ul class="list-group mb-3">
72
        {{#steps}}
73
        <li class="list-group-item">
74
            <div>
75
                {{text}}
76
                {{^isvalid}}
77
                <span class="badge badge-pill badge-danger">
78
                    <span class="fa fa-times"></span>
79
                    {{#str}} error {{/str}}
80
                </span>
81
                {{/isvalid}}
82
                {{#isvalid}}
83
                    {{#isexecuted}}
84
                    <span class="badge badge-pill badge-success">
85
                        <span class="fa fa-check "></span>
86
                        {{#str}} success {{/str}}
87
                    </span>
88
                    {{/isexecuted}}
89
                {{/isvalid}}
90
            </div>
91
            {{#hasarguments}}
92
            <div class="alert alert-info mb-0 mt-2" role="alert" style="overflow: auto;">
93
                <pre class="mb-0">{{arguments}}</pre>
94
            </div>
95
            {{/hasarguments}}
96
            {{^isvalid}}
97
            <div class="alert alert-danger mb-0 mt-2" role="alert" style="overflow: auto;">
98
                {{error}}
99
            </div>
100
            {{/isvalid}}
101
        </li>
102
        {{/steps}}
103
    </ul>
104
    {{/hassteps}}
105
</div>
106
{{/scenarios}}