1{title help="tests"}{tr}TikiTests Replay Configuration{/tr}{/title}
2
3<h2 class='pagetitle'>TikiTest:{$filename}</h2>
4<br/>
5{if $summary eq 'y' and is_array($result) and sizeof($result) gt 0}
6	{if $test_success eq $test_count}
7		<b><font color="green">{tr}Success{/tr}</font></b>
8	{else}
9		<b><font color="red">{tr}Failure{/tr}</font></b> {$test_success}/{$test_count}
10	{/if}
11{else}
12	{include file='tiki-tests_menubar.tpl'}
13	<fieldset>
14		<legend>{tr}Options{/tr}</legend>
15		<form action="tiki_tests/tiki-tests_replay.php" method="post">
16			<div class="form-check">
17			<label class="form-check-label">{tr}Summary mode{/tr}<input type="checkbox" class="form-check-input" name="summary" value="y" {if $summary eq 'y'} checked="checked"{/if}></label><br>
18			<label class="form-check-label">{tr}Show Page Differences{/tr}<input type="checkbox" class="form-check-input" name="show_page" value="y" {if $show_page eq 'y'} checked="checked"{/if}><br>
19			<label class="form-check-label">{tr}Show Tidy Errors and Warnings{/tr}<input type="checkbox" class="form-check-input" name="show_tidy" value="y" {if $show_tidy eq 'y'} checked="checked"{/if}><br>
20			<label class="form-check-label">{tr}Show POST Data{/tr}<input type="checkbox" class="form-check-input" name="show_post" value="y" {if $show_post eq 'y'} checked="checked"{/if}><br>
21			<label class="form-check-label">{tr}Use Current Session/Log out{/tr}<input type="checkbox" class="form-check-input" name="current_session" value="y" {if $current_session eq 'y'} checked="checked"{/if}><br>
22			</div>
23			<input type="hidden" name="filename" value="{$filename}">
24			<center><input type="submit" class="btn btn-primary btn-sm" name="action" value="{tr}Replay{/tr}"></center>
25		</form>
26	</fieldset>
27	{if is_array($result) and sizeof($result) gt 0}
28		<fieldset>
29			<legend>{tr}Results{/tr}</legend>
30			<div class="table-responsive">
31				<table class="table">
32					{foreach from=$result item=r}
33						<tr>
34							<th style="width:10%">{tr}Request:{/tr}&nbsp;{$r.method}</th><td>{$r.url}</td>
35						</tr>
36						{if isset($r.post) and $show_post}
37							<tr>
38								<th colspan="4">{tr}Post Variables{/tr}</th>
39							</tr>
40							{foreach from=$r.post item=p key=k}
41								<tr>
42									<td colspan="2">{$k}</td><td colspan="2">{$p}</td>
43								</tr>
44							{/foreach}
45						{/if}
46						<tr>
47							<td colspan="4">
48								<div class="table-responsive">
49									<table class="table">
50										{if $show_tidy}
51											<tr><th colspan="2">{tr}Tidy Results{/tr}&nbsp;{tr}Reference{/tr}</th><th colspan="2">{tr}Tidy Results{/tr}&nbsp;{tr}Replay{/tr}</th></tr>
52											<tr>
53												<td colspan="2" style="width:50%"><pre>{$r.ref_error_msg|escape:"html"}</pre></td>
54												<td colspan="2" style="width:50%"><pre>{$r.replay_error_msg|escape:"html"}</pre></td>
55											</tr>
56										{/if}
57										{if $r.html}
58											{if $show_page}
59												<tr><th colspan="4" border="1">{tr}Results{/tr}</th></tr>
60												{$r.html}
61											{else}
62												<tr>
63													<th colspan="1">{tr}Results{/tr}</th>
64													<td colspan="3" style="color: red; font-weight: bold">{tr}The pages are different{/tr}</td>
65												</tr>
66											{/if}
67										{else}
68											<tr>
69												<th colspan="1">{tr}Results{/tr}</th>
70												<td colspan="3" style="color: green; font-weight: bold">{tr}The pages are identical{/tr}</td>
71											</tr>
72										{/if}
73									</table>
74								</div>
75							</td>
76						</tr>
77					{/foreach}
78				</table>
79			</div>
80		</fieldset>
81	{/if}
82{/if}
83