Open minsooshin opened 7 years ago
Another hanging case is missing parent
property from tests
object
// component
import Component from 'can/component/';
import Map from 'can/map/';
import './breadcrumb.less!';
import template from './breadcrumb.stache!';
export const ViewModel = Map.extend({
isVisible: false,
paths: []
});
export default Component.extend({
tag: 'sc-breadcrumb',
viewModel: ViewModel,
template
});
// stache
<div {{^isVisible}} class="sc-hidden"{{/isVisible}}>
{{#if isVisible}}
{{#each paths}}
{{#if @index}}
<span class="sc-icon-caret-right"></span>
{{/if}}
{{#if isLink}}
<a href="{{link}}">{{name}}</a>
{{else}}
<p>{{name}}</p>
{{/if}}
{{/each}}
{{/if}}
</div>
// test
import QUnit from 'steal-qunit';
import can from 'can';
import $ from 'jquery';
import F from 'funcunit';
import './breadcrumb';
// ViewModel unit tests
QUnit.module('apoc/components/breadcrumb');
QUnit.test('Breadcrumb', function() {
// given
const mock = {
isVisible: true,
paths: [
{
isLink: true,
link: '#depth-1',
name: 'Depth 1'
},
{
isLink: true,
link: '#depth-1/depth-2',
name: 'Depth 2'
},
{
isLink: false,
link: '#depth-1/depth-2/depth-3',
name: 'Depth 3'
}
]
};
// when
const template = can.stache('<sc-breadcrumb {is-visible}="isVisible" {paths}="paths" />');
$('#qunit-fixture').html(template(mock));
this.$component = F('#qunit-fixture').find('sc-breadcrumb');
this.vm = can.viewModel(this.$component);
// then
F('sc-breadcrumb').find('.sc-icon-caret-right')
.css('color', 'rgb(153, 153, 153)', 'show have gray colored arrow')
.size(this.vm.paths.length - 1, 'should have 1 less number of depth arrow');
F('sc-breadcrumb').find('a')
.size(this.vm.paths.length - 1, 'should have 1 less number of depth link');
});
DEBUG:testee
command with phantom
browsertestee:main running test for [ 'test/test.html' ] [ 'phantom' ] {} +0ms
testee:main bootstrapping Testee +12ms
testee:main starting Testee server { port: 3996,
root: '/Users/mshin/Workspace/spirent/apoc',
reporter: 'Dot',
adapter: '/testee/',
timeout: 120,
delay: 1000,
tunnel: { type: 'local', port: 3996 },
launch: { type: 'local' } } +1ms
testee:server initializing Feathers API +1ms
testee:hosting intializing static file server /Users/mshin/Workspace/spirent/apoc +17ms
testee:main testee server started and listening +28ms
testee:main hooking up services to Mocha reporter +0ms
testee:reporter setting up Mocha command line reporter +0ms
testee:reporter start +1ms
testee:main starting up localhost tunnel { type: 'local', port: 3996 } +0ms
testee:main localhost tunnel started on http://localhost:3996 +1ms
testee:main using browser launcher local { type: 'local' } +0ms
testee:main browser launcher initialized +1ms
testee:main setting up test runner +0ms
testee:main server bootstrapped, running tests. +0ms
testee:runner running tests for [ 'test/test.html' ] [ 'phantom' ] +0ms
testee:runner initializing sequential test runs for browser phantom +1ms
testee:runner running individual test http://localhost:3996/test/test.html?__token=fllnja { browser: 'phantom' } +2ms
testee:runner browser instance started { browser: 'phantom' } +21ms
testee:runner tracking test run http://localhost:3996/test/test.html?__token=fllnja { browser: 'phantom' } +0ms
testee:html-injector injecting scripts into file /test/test.html?__token=fllnja +541ms
testee:runner CONSOLE: WARN: Use %index in place of @index.
http://localhost:3996/test/test.html?__token=fllnja { browser: 'phantom' } +1s
testee:runner CONSOLE: WARN: Use %index in place of @index.
http://localhost:3996/test/test.html?__token=fllnja { browser: 'phantom' } +2ms
testee:runner CONSOLE: WARN: Use %index in place of @index.
http://localhost:3996/test/test.html?__token=fllnja { browser: 'phantom' } +1ms
testee:reporter starting test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: '761cc02b747823cec8292d9df17272bd',
title: 'show have gray colored arrow' } +106ms
testee:reporter updating test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: '761cc02b747823cec8292d9df17272bd',
title: 'show have gray colored arrow',
status: 'passed' } +3ms
testee:reporter starting test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: '03a208679c0b6389c32a8700cce59364',
title: 'should have 1 less number of depth arrow' } +9ms
testee:reporter updating test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: '03a208679c0b6389c32a8700cce59364',
title: 'should have 1 less number of depth arrow',
status: 'passed' } +4ms
testee:reporter starting test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: 'ca9ac5ab2e5d7c5155f60a3513bc4834',
title: 'should have 1 less number of depth link' } +17ms
testee:reporter updating test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: 'ca9ac5ab2e5d7c5155f60a3513bc4834',
title: 'should have 1 less number of depth link',
status: 'passed' } +9ms
testee:runner test http://localhost:3996/test/test.html?__token=fllnja timed out +2m
testee:runner stopping browser instance { browser: 'phantom' } +1ms
testee:reporter adding error to reporter { [Error: Browser timed out within 120 seconds]
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at testTimedOut [as _onTimeout] (/Users/mshin/Workspace/spirent/apoc/node_modules/testee/lib/runner.js:43:42)\n at Timer.listOnTimeout (timers.js:92:15)',
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' } +5ms
testee:main shutting down reporter +1ms
testee:reporter end +0ms
testee:reporter reportErrors 1 +0ms
testee:reporter starting run { id: 'c88c0b68-39f2-4c7d-a5ab-a623d2700837',
title: 'General error' } +0ms
testee:reporter reporting error { [Error: Browser timed out within 120 seconds]
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at testTimedOut [as _onTimeout] (/Users/mshin/Workspace/spirent/apoc/node_modules/testee/lib/runner.js:43:42)\n at Timer.listOnTimeout (timers.js:92:15)',
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' } +1ms
testee:reporter starting test { id: '05927667-edd5-493e-bbdc-267d47aa96f3',
parent: 'c88c0b68-39f2-4c7d-a5ab-a623d2700837',
status: 'failed',
err:
{ [Error: Browser timed out within 120 seconds]
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at testTimedOut [as _onTimeout] (/Users/mshin/Workspace/spirent/apoc/node_modules/testee/lib/runner.js:43:42)\n at Timer.listOnTimeout (timers.js:92:15)',
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' },
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' } +0ms
testee:reporter updating test { id: '05927667-edd5-493e-bbdc-267d47aa96f3',
parent: 'c88c0b68-39f2-4c7d-a5ab-a623d2700837',
status: 'failed',
err:
{ [Error: Browser timed out within 120 seconds]
message: 'Browser timed out within 120 seconds',
stack: 'Error: Browser timed out within 120 seconds\n at testTimedOut [as _onTimeout] (/Users/mshin/Workspace/spirent/apoc/node_modules/testee/lib/runner.js:43:42)\n at Timer.listOnTimeout (timers.js:92:15)',
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' },
title: 'http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}' } +0ms
․ testee:reporter updating run { status: 'finished',
id: 'c88c0b68-39f2-4c7d-a5ab-a623d2700837',
title: 'General error' } +1ms
0 passing (2m)
1 failing
1) General error http://localhost:3996/test/test.html?__token=fllnja on {"browser":"phantom"}:
Error: Browser timed out within 120 seconds
at testTimedOut [as _onTimeout] (/Users/mshin/Workspace/spirent/apoc/node_modules/testee/lib/runner.js:43:42)
at Timer.listOnTimeout (timers.js:92:15)
testee:main closing server +2ms
If take a look at the debugging object when the test starts
testee:reporter starting test { file: 'http://localhost:3996/test/test.html?__token=fllnja',
id: '761cc02b747823cec8292d9df17272bd',
title: 'show have gray colored arrow' } +106ms
There is no parent property...
Update
testee:html-injector injecting scripts into file /test/test.html?__token=d5r1bn +475ms
testee:reporter startRun ---------------------------------------------------- +1s
testee:reporter { status: 'running', file: 'http://localhost:3996/test/test.html?__token=d5r1bn', id: '6a473ffcf2036a579b013a9746505665', environment: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36', runner: 'QUnit', time: 1479942101214 } +1ms
testee:html-injector injecting scripts into file /test/test.html?__token=lr1i20 +472ms
testee:reporter starting test { file: 'http://localhost:3996/test/test.html?__token=lr1i20',
id: 'eba2407b07bf1a93b29a31630d919ea5',
title: 'show have gray colored arrow' } +1s
Even it doesn't trigger startRun
and startSuite
from lib/reporter/index.js
Environment
node: v4.5.0 npm: 2.15.9 testee: 0.2.5 phantomjs: 2.1.1
log from
DEBUG:testee
command withphantom
browserlog from
DEBUG:testee
command withfirefox
browser