2024-05-20 10:30:30 +00:00
|
|
|
title: $:/core/ui/testcases/DefaultTemplate
|
2024-07-24 12:02:41 +00:00
|
|
|
code-body: yes
|
2024-05-20 10:30:30 +00:00
|
|
|
|
|
|
|
\whitespace trim
|
2024-08-18 21:35:36 +00:00
|
|
|
|
2024-08-20 15:29:16 +00:00
|
|
|
\function tf.state() "$:/state/testcase"
|
2024-08-18 21:35:36 +00:00
|
|
|
|
2024-05-20 10:30:30 +00:00
|
|
|
\procedure linkcatcherActions()
|
|
|
|
<%if [<navigateTo>has[title]] %>
|
2024-08-18 21:35:36 +00:00
|
|
|
<$action-setfield $tiddler=<<tf.state>> text=<<navigateTo>>/>
|
2024-05-20 10:30:30 +00:00
|
|
|
<%endif%>
|
|
|
|
\end
|
|
|
|
|
2024-08-18 21:35:36 +00:00
|
|
|
\procedure testcase-header()
|
|
|
|
<div class="tc-test-case-header">
|
|
|
|
<h2>
|
|
|
|
<$genesis $type={{{ [<linkTarget>!match[]then[$link]else[span]] }}} to=<<testcaseTiddler>>>
|
|
|
|
<%if [<testResult>!match[]] %>
|
|
|
|
<span class={{{ tc-test-case-result-icon
|
|
|
|
[<testResult>!match[fail]then[tc-test-case-result-icon-pass]]
|
|
|
|
[<testResult>match[fail]then[tc-test-case-result-icon-fail]]
|
|
|
|
+[join[ ]] }}}
|
|
|
|
>
|
|
|
|
<%if [<testResult>!match[fail]] %>
|
|
|
|
{{$:/core/images/done-button}}
|
|
|
|
<%else%>
|
|
|
|
{{$:/core/images/close-button}}
|
2024-05-20 10:30:30 +00:00
|
|
|
<%endif%>
|
2024-06-26 09:23:54 +00:00
|
|
|
</span>
|
2024-08-18 21:35:36 +00:00
|
|
|
<%endif%>
|
|
|
|
<$view tiddler="Description" mode="inline"/>
|
|
|
|
</$genesis>
|
|
|
|
<span class="tc-test-case-toolbar">
|
|
|
|
<<testcase-toolbar>>
|
|
|
|
</span>
|
|
|
|
</h2>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-toolbar()
|
|
|
|
<$button popup=`$(tf.state)$-more`
|
|
|
|
tooltip={{$:/language/Buttons/More/Hint}}
|
|
|
|
aria-label={{$:/language/Buttons/More/Caption}}
|
|
|
|
class="tc-btn-invisible"
|
|
|
|
selectedClass="tc-selected"
|
|
|
|
>
|
|
|
|
{{$:/core/images/down-arrow}}
|
|
|
|
</$button>
|
|
|
|
<$let
|
|
|
|
tv-config-toolbar-icons="yes"
|
|
|
|
tv-config-toolbar-text="yes"
|
|
|
|
tv-config-toolbar-class="tc-btn-invisible"
|
|
|
|
>
|
|
|
|
<$reveal state=`$(tf.state)$-more` type="popup" position="belowleft" animate="yes">
|
|
|
|
<div class="tc-drop-down">
|
|
|
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/TestCase/Actions]!has[draft.of]]"
|
|
|
|
variable="listItem"
|
|
|
|
>
|
|
|
|
<$transclude $tiddler=<<listItem>> $mode="inline"/>
|
|
|
|
</$list>
|
2024-05-20 10:30:30 +00:00
|
|
|
</div>
|
2024-08-18 21:35:36 +00:00
|
|
|
</$reveal>
|
2024-05-20 10:30:30 +00:00
|
|
|
</$let>
|
2024-08-18 21:35:36 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-narrative()
|
|
|
|
<div class="tc-test-case-narrative">
|
|
|
|
<$transclude $tiddler="Narrative" $mode="block"/>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-fail()
|
|
|
|
<div class="tc-test-case-result-fail">
|
|
|
|
<div class="tc-test-case-result-fail-header">
|
|
|
|
TEST FAILED
|
|
|
|
</div>
|
|
|
|
<div class="tc-test-case-result-fail-body">
|
|
|
|
<$diff-text source=<<expectedHTML>> dest=<<outputHTML>>/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-output-wikified()
|
|
|
|
<$linkcatcher actions=<<linkcatcherActions>>>
|
|
|
|
<$tiddler tiddler="Output">
|
|
|
|
<$transclude $tiddler="Output" $mode="block"/>
|
|
|
|
</$tiddler>
|
|
|
|
</$linkcatcher>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-output()
|
|
|
|
<div class="tc-test-case-output">
|
|
|
|
<%if [<displayFormat>!match[]else[wikitext]match[plaintext]] %>
|
|
|
|
<pre><$view tiddler="Output" format="plainwikified" mode="block"/></pre>
|
|
|
|
<%else%>
|
|
|
|
<<testcase-output-wikified>>
|
|
|
|
<%endif%>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-tabsList()
|
|
|
|
[all[tiddlers]sort[]] Output +[putfirst[]]
|
|
|
|
-Description
|
|
|
|
-Narrative
|
2024-08-20 15:29:16 +00:00
|
|
|
-[[$:/temp/testcase/draft-title]]
|
2024-08-18 21:35:36 +00:00
|
|
|
-[has[plugin-type]]
|
|
|
|
-[prefix<tf.state>]
|
|
|
|
-[prefix[$:/state/popup/export]]
|
2024-08-20 15:29:16 +00:00
|
|
|
-[prefix[$:/HistoryList]]
|
|
|
|
-[prefix[$:/StoryList]]
|
2024-08-18 21:35:36 +00:00
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-source()
|
|
|
|
<div class="tc-test-case-source">
|
|
|
|
<$macrocall $name="tabs"
|
|
|
|
tabsList=<<testcase-tabsList>>
|
|
|
|
explicitState=<<tf.state>>
|
|
|
|
default="Output"
|
|
|
|
template="$:/core/ui/testcases/DefaultTemplate/SourceTabs"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-panes()
|
|
|
|
<div class="tc-test-case-panes">
|
|
|
|
<<testcase-source>>
|
|
|
|
<div class="tc-test-case-divider"></div>
|
|
|
|
<<testcase-output>>
|
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\procedure testcase-body()
|
|
|
|
<div class="tc-test-case-wrapper">
|
|
|
|
<<testcase-header>>
|
2024-08-20 15:29:16 +00:00
|
|
|
<$let testcase-source-state = <<tf.state>>>
|
|
|
|
<$navigator story="$:/StoryList" history="$:/HistoryList">
|
|
|
|
<%if [[Narrative]is[tiddler]] %>
|
|
|
|
<<testcase-narrative>>
|
|
|
|
<%endif%>
|
|
|
|
<%if [<testResult>match[fail]] %>
|
|
|
|
<<testcase-fail>>
|
|
|
|
<%endif%>
|
|
|
|
<<testcase-panes>>
|
|
|
|
</$navigator>
|
|
|
|
</$let>
|
2024-08-18 21:35:36 +00:00
|
|
|
</div>
|
|
|
|
\end
|
|
|
|
|
|
|
|
<<testcase-body>>
|