Files
meteor/packages/test-in-browser/driver.html
Avital Oliver ac5a4bc809 WIP: Implement a meteor test-app command.
This command builds the app with a different directory for
`.meteor/local`, including built packages and the app database. This
allows running `meteor test-app` and `meteor test` in parallel
for a given app, with DB isolation.

Also, we've changed how test driver packages work (as used for
`meteor test-packages`, like "test-in-browser"). Instead of automatically
running tests when they load, they export a `runTests` function that
you should call when you're ready to run tests.

When running `meteor test-app` or `meteor test-packages` a new additional
last line of code is added that calls `Meteor.startup(...runTests()...)`

TODO:
* Implement `testOnly` packages. The current pattern of reading a global
  from `package.js` won't work for published packages, which are stored
  as metadata, not code.
* Let you choose a test driver package as an argument to `meteor test-app`
* Demonstrate that a Mocha test and driver package are possible to write.
* Expose Meteor.isTest, Meteor.isIntegrationTest, Meteor.isUnitTest
* Implement `meteor test-app --unit` which only loads test files
* `meteor test-app` should load ALL *.tests?.* files, including ones
  inside imports/ directories
2016-01-22 15:18:10 -08:00

168 lines
4.0 KiB
HTML

<template name="testInBrowserBody">
<div class="container-fluid">
{{> navBars}}
{{> failedTests}}
{{> testTable}}
</div>
</template>
<template name="navBars">
<div class="navbar navbar-fixed-top navbar-inverse">
<div class="navbar-inner">
<div class="row-fluid">
<div class="span3"><a class="brand" href="#">
&nbsp;
{{#if running}}
Testing in progress...
{{else}}
{{#if passed}}
All tests pass!
{{else}}
There are failures.
{{/if}}
{{/if}}
</a></div>
<div class="span2">
{{#unless running}}
<p class="navbar-text">{{total_test_time}} ms</p>
{{/unless}}
</div>
<div class="span6">
{{> progressBar}}
</div>
<div class="span1"></div>
</div>
</div>
</div>
{{> groupNav}}
</template>
<template name="progressBar">
<div id="testProgressBar" class="progress {{barOuterClass}}">
<span class="in-progress">Passed {{passedCount}} of {{totalCount}}</span>
<div class="bar bar-danger" style="width: {{percentFail}}%;"></div>
<div class="bar {{barInnerClass}}" style="width: {{percentPass}}%;"></div>
</div>
</template>
<template name="groupNav">
<div class="navbar navbar-fixed-bottom navbar-inverse">
<div class="navbar-inner">
<ul class="nav">
{{#each groupPaths}}
<li class="navbar-text">&nbsp;-&nbsp;</li>
<li><a class="group" href="#">{{name}}</a></li>
{{/each}}
</ul>
<form class="navbar-form pull-right">
<span id="current-client-test"></span>
<a class="btn rerun">
{{#if rerunScheduled}}
<i class="icon-time"></i>
Rerun scheduled...
{{else}}
<i class="icon-repeat"></i>
Rerun
{{/if}}
</a>
</form>
&nbsp;
</div>
</div>
</template>
<template name="failedTests">
<div class="row-fluid"><div class="span12">
<ul class="failedTests">
{{#each failedTests}}
<li>{{this}}</li>
{{/each}}
</ul>
</div></div>
</template>
<template name="testTable">
<div class="row-fluid"><div class="span12">
<div class="test_table">
{{#each testdata}}
{{> test_group thisWithDep}}
{{/each}}
</div>
</div></div>
</template>
<template name="test_group">
<div class="group">
<div class="groupname"><a>{{name}}</a></div>
{{#each tests}}
{{> test thisWithDep}}
{{/each}}
{{#each groups}}
{{> test_group thisWithDep}}
{{/each}}
</div>
</template>
<template name="test">
<div class="test {{test_class}}">
<div class="testrow">
<div class="teststatus">
{{test_status_display}}
</div>
<div class="testtime">
{{test_time_display}}
</div>
<div class="testname">
{{#if server}}S:{{else}}C:{{/if}}
{{name}}
</div>
</div>
{{#if expanded}}
{{#each eventsArray}}
{{> event}}
{{else}}
<div class="event"><div class="nodata">(no data)</div></div>
{{/each}}
{{/if}}
</div>
</template>
<template name="event">
<div class="event">
<div class="{{type}}">
<span>
- {{type}}
{{#if times}}
<span class="xtimes">({{times}} times)</span>
{{/if}}
{{#with get_details}}
{{#if this}}
{{!
`type` can be any of the following or a
custom assertion type
* assert_equal
* instanceOf
* throws
* true
* null
* undefined
* NaN
* include
* length
}}
{{#if type}}&mdash; {{type}}{{/if}}
{{#each details}}
- <span class="failkey">{{key}}</span> {{val}}
{{/each}}
{{/if}}
{{#if stack}}<pre>{{stack}}</pre>{{/if}}
{{/with}}
{{#if is_debuggable}}
<span class="debug">[Debug]</span>
{{/if}}
</span>
</div>
</div>
</template>