Skip to content

Instantly share code, notes, and snippets.

@andrenatal
Created January 5, 2016 02:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrenatal/2db697aa8083a117dd5d to your computer and use it in GitHub Desktop.
Save andrenatal/2db697aa8083a117dd5d to your computer and use it in GitHub Desktop.
Unit test log
mozillas-MacBook-Pro-8:gaia-andre anatal$ npm run refresh; PROFILE_FOLDER=profile ./tests/jsmarionette/run_tests.js
> gaia@0.0.3 refresh /Users/anatal/projects/mozilla/gaia-andre
> npmr install
connection-manager
initialization
✓ should initialize .connections
.remove
✓ should remove connection from list
.get
✓ should return an open connection
.open
✓ should initialize socket and stream
✓ should increment currentId
✓ should return id and stream
on socket close
✓ should remove itself from connections
on socket end
✓ should remove itself from connections
marionette/drivers/abstract
initialization
✓ should setup ._sendQueue
✓ should not be ready
✓ should setup ._responseQueue
✓ should have timeout set to 10000
✓ should be _waiting
event: device response
when response is for different device
✓ should trigger response callbacks
when response is for device id
✓ should trigger response callbacks
✓ should clear response queue
✓ should not be waiting
.close
✓ should call _close
✓ should not be ready
✓ should clean up _responseQueue
.connect with protocol 1
✓ should set .marionetteProtocol
✓ should set .applicationType
✓ should set .traits
✓ should call _connect
✓ should not be waiting
✓ should be ready
.connect with protocol 2
✓ should set .marionetteProtocol
✓ should set .applicationType
✓ should call _connect
✓ should not be waiting
✓ should be ready
._nextCommand
when waiting
✓ should not send command to server
when not waiting
✓ should be waiting
✓ should send command to server
when there are no comamnds and we are not waiting
✓ should not be waiting
.send
when device is not ready
✓ should throw an error
when not waiting for a response
✓ should send command
✓ should be waiting
when waiting for a response
✓ should call next
✓ should add send command to queue
✓ should add calback to response queue
marionette/drivers/tcp
✓ should accept port and host
._sendCommand
✓ should send request to socket
client event: command
- should call onDeviceResponse
._connect
retrying
✓ should eventually connect (261ms)
._close
✓ should close socket
marionette/drivers/promises
✓ should return a fulfilled promise on connect (254ms)
✓ should send an object and receive a promise (258ms)
marionette/drivers/tcp-sync
✓ can wait for marionette socket
marionette/actions
initialization
✓ should set client
.press
✓ should have a press action in the chain
.release
✓ should have a release action in the chain
.move
✓ should have a move action in the chain
.moveByOffset
✓ should have a move by offset action in the chain
.wait
✓ should have a wait action in the chain
.cancel
✓ should have a cancel action in the chain
.tap
✓ should have a tap action in the chain
.doubleTap
✓ should have a double tap action in the chain
.flick
✓ should have a flick action in the chain
✓ should have a flick action in the chain when the duration param is 300
.longPress
✓ should have a long press action in the chain
.perform
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive value in response
marionette/client
initialization
✓ should save .driver
without driver
✓ should not explode
hooks
✓ should not fail running missing hooks
✓ should handle errors in hooks
success
✓ should handle adding a hook in a hook
✓ should run in context of client
✓ should run all hooks
.plugin
✓ should allow chaining
✓ should invoke plugin without name
✓ should assign result to the given name
✓ should work with .setup
._handleCallback
✓ should handle number errors
✓ should handle string errors
✓ should use callback when provided
✓ should call onScriptTimeout on script timeout
with default
✓ should use default when no callback is provided
✓ should handle number errors
✓ should handle string errors
✓ should use callback when provided
✓ should call onScriptTimeout on script timeout
.searchMethods
✓ should have a list of methods
protocol 1 .send
when session: is present
✓ should be chainable
✓ should add session to cmd
when to: is not given
with an actor
✓ should add to:
without an actor
✓ should add to
protocol 2 .send
✓ should be chainable
✓ sends exact packet
.scope
first subscope
✓ should update .scriptTimeout
✓ should update .searchTimeout
✓ should update .context
✓ should update the ._scope when state changes in scoped
✓ should not update sibling scope
.startSession protocol version 1
✓ should be chainable
✓ should have an actor property
✓ should have a sessionId property
✓ should have protocol version 1
.startSession protocol version 2
✓ should be chainable
✓ should have an empty actor property
✓ should have sessionId property
✓ should have a capabilities property
✓ should send newSession
✓ should send callback response
✓ should have protocol version 2
._getActorId
✓ should be chainable
✓ should send name
✓ should receive id in response
✓ should save actor ID
._sendCommand
on success
✓ should send given command and format the result
✓ should send command through _unmarshalWebElement
on number error from protocol 1
✓ should pass error to callback
on string error from protocol 1
✓ should pass error to callback
on modern error from protocol 2
✓ should pass error to callback
.deleteSession
✓ should set actorId to null
✓ should set sessionId to null
✓ should set capabilities to null
✓ should be chainable
✓ should close the connection
.setSearchTimeout
✓ should have default .searchTimeout
after setting with protocol 1
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
✓ should set timeout
after setting with protocol 2
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
✓ should set timeout
.sessionCapabilities with protocol 1
✓ should be chainable
✓ should send name
✓ should receive value in response
.sessionCapabilities with protocol 2
✓ should be chainable
✓ should send name
✓ should receive capabilities in response
.getWindow
✓ should be chainable
✓ should send name
✓ should receive value in response
.setContext with protocol 1
✓ should have a default context
after setting context
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
✓ should remember context
.setContext with protocol 2
✓ should have a default context
after setting context
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
✓ should remember context
.getWindows with protocol 1
✓ should be chainable
✓ should send name
✓ should receive value in response
.getWindows with protocol 2
✓ should be chainable
✓ should send name
✓ should receive whole body response
.switchToWindow with protocol 1
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
.switchToWindow with protocol 2
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
.getWindowType
✓ should be chainable
✓ should send name
✓ should receive value in response
.switchToFrame
when given nothing
✓ should be chainable
✓ should send name
✓ should receive whole body response
when given a callback
✓ should send name
✓ should receive whole body response
when given an element
✓ should send name
✓ should send parameters
✓ should receive whole body response
when given an object with ELEMENT
✓ should send name
✓ should send parameters
✓ should receive whole body response
when switch to a frame with options
✓ should send name
✓ should send parameters
✓ should receive whole body response
when switch to a frame with multiple options
✓ should send name
✓ should send parameters
✓ should receive whole body response
.switchToShadowRoot
when given nothing
✓ should be chainable
✓ should send name
✓ should receive whole body response
when given a callback
✓ should send name
✓ should receive whole body response
when given an element
✓ should send name
✓ should send parameters
✓ should receive whole body response
.importScript
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
.setScriptTimeout
✓ should have a default timeout
after setting timeout
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
✓ should update .scriptTimeout
✓ driver should have gotten it
.title
✓ should be chainable
✓ should send name
✓ should receive value in response
.goUrl
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
.getUrl
✓ should be chainable
✓ should send name
✓ should receive value in response
.goForward
✓ should be chainable
✓ should send name
✓ should receive whole body response
.goBack
✓ should be chainable
✓ should send name
✓ should receive whole body response
script executing commands
.executeScript
✓ should call _executeScript
.executeJsScript
✓ should call _executeScript
.executeAsyncScript
✓ should call _executeScript
.refresh
✓ should be chainable
✓ should send name
✓ should receive whole body response
.log
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive whole body response
.getLogs with protocol 1
✓ should be chainable
✓ should send name
✓ should receive value in response
.getLogs with protocol 2
✓ should be chainable
✓ should send name
✓ should receive whole body response
.pageSource
✓ should be chainable
✓ should send name
✓ should receive value in response
.screenshot
without options
✓ should be chainable
✓ should send name
✓ should receive value in response
with options
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive value in response
._findElement
with overriden Element
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should return an instance of MyElement
simple find with defaults
✓ should be chainable
✓ should send name
✓ should send parameters
callback argument
✓ should be an instance of Marionette.Element
find with all options
✓ should be chainable
✓ should send name
✓ should send parameters
callback argument
✓ should be an instance of Marionette.Element
trying to find with invalid 'using'
✓ should fail
element finders
.findElement
✓ should call _findElement
.findElements
✓ should call _findElement
._executeScript
with args
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive value in response
without args
✓ should be chainable
✓ should send name
✓ should send parameters
✓ should receive value in response
._newSession
✓ should send newSession
✓ should save session ID
✓ should send callback response
._convertFunction
✓ should format function to call immediately
✓ should not format strings
._unmarshalWebElement
when it is an element
✓ should return an instance of element
when it is not an element
✓ should return same object
._prepareArguments
✓ should process Marionette.Element instances into uuids
marionette/command-stream
initialization
✓ should save socket
✓ should be an event emitter
socket event: data
✓ should call add
.stringify
when given an object
✓ should return json (n:json)
when given a string
✓ should return json (n:json)
.send
when using socket.send
✓ should write to socket
when using socket.write
✓ should write to socket
✓ should write in utf8
.add
when given the entire command
✓ should emit success command at #0
✓ should have 1 of commands
when given single command in multiple chunks
✓ should emit success command at #0
✓ should have 1 of commands
when given multiple commands in two chunks
✓ should emit success command at #0
✓ should emit fail command at #1
✓ should have 2 of commands
when given both commands in one chunk
✓ should emit fail command at #0
✓ should emit success command at #1
✓ should have 2 of commands
marionette/error
✓ should expose .ERRORS
#error
✓ should populate message
✓ should populate stacktrace
✓ should populate type
✓ should recognise known error code
✓ should fall back to GenericError for unknown error code
✓ should support all errors
✓ should contain client
✓ should use GenericError error when unknown error code
marionette/index
✓ should have paths
marionette/multi-actions
initialization
✓ should set client
.add
✓ should have a action chain
.perform
✓ should be chainable
✓ should send type
✓ should send value
✓ should send max_length
✓ should receive whole body response
json wire protocol
✓ .separator
#stringify
✓ ASCII only
✓ invalid strings
✓ with multibyte chars
#parse
✓ working string
.Stream
#write
✓ multiple chunks until length
multiple commands over two buffers
✓ result after writing to stream
entire buffer
✓ read entire buffer
socket retry connect
✓ socket is open
events.js:141
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::1234
at Object.exports._errnoException (util.js:874:11)
at exports._exceptionWithHostPort (util.js:897:20)
at Server._listen2 (net.js:1234:14)
at listen (net.js:1270:10)
at Server.listen (net.js:1366:5)
at runServer (/Users/anatal/projects/mozilla/gaia-andre/node_modules/marionette-client/test/marionette/drivers/tcp-sync-test-server.js:21:10)
at Object.<anonymous> (/Users/anatal/projects/mozilla/gaia-andre/node_modules/marionette-client/test/marionette/drivers/tcp-sync-test-server.js:29:5)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
✓ waits before connection is open (1013ms)
✓ fails to connect after retires (512ms)
sockit-to-me
#connect
✓ successful connections
✓ error is thrown when connection cannot be established
✓ connection will timeout when expected when using setPollTimeout (1005ms)
✓ calling connect twice will fail
argument shape errors
✓ not enough arguments
✓ argument of wrong type
✓ argument without string "host" attribute
✓ argument without number "port" attribute
#read
✓ correct data is returned
✓ error is thrown when not connected
✓ error is thrown when a number is not specified
✓ 1s timeout if no data (1006ms)
✓ socket closing
#write
✓ specified data is written
✓ error is thrown when not connected
✓ error is thrown when no argument is specified
✓ error is thrown when invalid argument is specified
#setDebugLog
[sockit-to-me] debug log enabled
✓ succeeds
✓ error is thrown with invalid argument count
✓ error is thrown with bad argument type
apply-manifest
✓ manifest-blacklist.json (140ms)
✓ manifest-whitelist.json (122ms)
error_ipc
✓ roundtrip
optsfile
✓ parsing valid optsfile
✓ optsfile with newlines
rpc
✓ noArgs (108ms)
✓ args
✓ objects
✓ error
ProfileBuilder
✓ initialization
#build
✓ profile path
✓ options given to mozprofile.create
#destroy
✓ without profile
✓ with profile
createprofile
✓ .tmp
.gaia
✓ copied files from profile
.baseProfile
✓ exists
✓ is a new path
✓ copies webapps/a.js
✓ copies webapps/webapps.json
✓ copies settings.json
✓ symlinks webapps/app1
✓ symlinks webapps/app2
.profile
✓ missing
✓ exists
#gaiaProfile
✓ mac
✓ linux
mozprofilebuilder
✓ without options
✓ with options
pref
✓ string
✓ boolean
✓ object
✓ array
✓ given a single object
profile
initialize
✓ .path
#destroy
✓ removal
reporter
Dot
․․․
3 passing (6ms)
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (148ms)
․․․
1 passing (8ms)
2 failing
1) fail sync:
+ expected - actual
rror: sync
at Context.<anonymous> (node_modules/marionette-js-runner/node_modules/mocha-json-proxy/test/fixtures/fail.js:4:11)
2) fail async:
+ expected - actual
rror: async
at Context.<anonymous> (node_modules/marionette-js-runner/node_modules/mocha-json-proxy/test/fixtures/fail.js:8:10)
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (139ms)
0 passing (3ms)
1 pending
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (132ms)
Spec
pass
✓ sync
✓ async
pass 2
✓ sync 2
3 passing (6ms)
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (135ms)
fail
1) sync
2) async
✓ uncaught
1 passing (9ms)
2 failing
1) fail sync:
+ expected - actual
rror: sync
at Context.<anonymous> (node_modules/marionette-js-runner/node_modules/mocha-json-proxy/test/fixtures/fail.js:4:11)
2) fail async:
+ expected - actual
rror: async
at Context.<anonymous> (node_modules/marionette-js-runner/node_modules/mocha-json-proxy/test/fixtures/fail.js:8:10)
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (140ms)
pending
- mepending
0 passing (4ms)
1 pending
✓ function (title, fn) {
var suite = suites[0];
if (suite.pending) {
fn = null;
}
var test = new Test(title, fn);
test.file = file;
suite.addTest(test);
return test;
} (134ms)
reporter
✓ got messages
consumer
✓ .suite
✓ suite end
✓ test
✓ pass
✓ test end
suite
✓ is runnable
✓ child suite should have reference to parent
objects with ._ids are the same
✓ tests async
✓ suite
reporter
✓ event: test (226ms)
✓ event: test end (227ms)
✓ event: suite (end) (227ms)
fail
✓ event: fail (222ms)
✓ event: ids (230ms)
pass
✓ event: pass (232ms)
✓ event: ids (247ms)
pending
✓ event: pending (219ms)
✓ event: ids (222ms)
detectbinary
✓ mac with -bin
✓ mac without -bin
✓ linux with -bin
✓ linux without -bin
✓ missing binary
run
✓ launch mulet
✓ launch mulet with different screen
1) check env overrides
2) explicit env
3) env is expected default if not specified
launch mulet read dump
✓ go to url (2838ms)
DesktopClientFileManager
#add
✓ should add a file in the pictures directory
✓ should add files in the pictures directory
✓ should add all files of a directory in the pictures directory
#remove
✓ should remove a file in the videos directory
#removeAllFiles
✓ should have device storage directory
✓ should work when no file in device storage
✓ should remove all files in device storage
date formatter
✓ basic functionality
time formatter
✓ basic functionality
padZeros
✓ one digit
✓ two digits
✓ three digits
TBPL
✓ #constructor
*~*~* Results *~*~*
passed: 0
failed: 0
todo: 0
0 passing (undefinedms)
✓ #onEnd
TEST-UNEXPECTED-FAIL | doge_such_broke_test.js | some title
Error: xfoo
at Context.<anonymous> (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha-tbpl-reporter/test/tbpl_test.js:47:15)
at callFn (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runnable.js:286:21)
at Test.Runnable.run (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runnable.js:279:7)
at Runner.runTest (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:421:10)
at /Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:528:12
at next (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:341:14)
at /Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:351:7
at next (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:283:14)
at /Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runner.js:314:7
at done (/Users/anatal/projects/mozilla/gaia-andre/node_modules/mocha/lib/runnable.js:247:5)
✓ #onFail
TEST-PASS | file.js | some title
✓ #onPass
TEST-PENDING | file.js | some title
✓ #onPending
TEST-START | file.js | some title
✓ #onTest
TEST-END | file.js | some title took 100 ms
✓ #onTestEnd
✓ #getFile - relative
✓ #getFile - relative different pwd
✓ #getFile - absolute
✓ #getTitle
✓ #sanitize
438 passing (14s)
1 pending
3 failing
1) run check env overrides:
Uncaught cannot find "echostuff" binary in /Users/anatal/projects/mozilla/gaia-andre/node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
+ expected - actual
-false
+true
AssertionError: cannot find "echostuff" binary in node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
at node_modules/marionette-js-runner/node_modules/mozilla-runner/test/run.js:76:14
at foundBinary (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/run.js:119:21)
at next (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:56:14)
at node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:49:7
at FSReqWrap.cb [as oncomplete] (fs.js:212:19)
2) run explicit env:
Uncaught cannot find "echostuff" binary in /Users/anatal/projects/mozilla/gaia-andre/node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
+ expected - actual
-false
+true
AssertionError: cannot find "echostuff" binary in node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
at node_modules/marionette-js-runner/node_modules/mozilla-runner/test/run.js:102:14
at foundBinary (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/run.js:119:21)
at next (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:56:14)
at node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:49:7
at FSReqWrap.cb [as oncomplete] (fs.js:212:19)
3) run env is expected default if not specified:
Uncaught cannot find "echostuff" binary in /Users/anatal/projects/mozilla/gaia-andre/node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
+ expected - actual
-false
+true
AssertionError: cannot find "echostuff" binary in node_modules/marionette-js-runner/node_modules/mozilla-runner/test/fixtures/env-echoer
at node_modules/marionette-js-runner/node_modules/mozilla-runner/test/run.js:124:14
at foundBinary (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/run.js:119:21)
at next (node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:56:14)
at node_modules/marionette-js-runner/node_modules/mozilla-runner/lib/detectbinary.js:49:7
at FSReqWrap.cb [as oncomplete] (fs.js:212:19)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment