Started #0 phantom global object: should exist PASS #1 phantom global object: should have args property PASS #2 phantom global object: should have args as an array PASS #3 phantom global object: should have libraryPath property PASS #4 phantom global object: should have libraryPath as a string PASS #5 phantom global object: should not have an empty libraryPath PASS #6 phantom global object: should have scriptName property PASS #7 phantom global object: should have scriptName as a string PASS #8 phantom global object: should not have an empty scriptName PASS #9 phantom global object: should have outputEncoding property PASS #10 phantom global object: should have the default outputEncoding of UTF-8 PASS #11 phantom global object: should have version property PASS #12 phantom global object: should return 1 as the major version PASS #13 phantom global object: should return 9 as the minor version PASS #14 phantom global object: should return 0 as the patch version PASS #15 phantom global object: should have 'injectJs' function PASS #16 phantom global object: should have 'exit' function PASS #17 phantom global object: should have 'cookiesEnabled' property, and should be 'true' by default PASS #18 phantom global object: should be able to get the error signal handler that is currently set on it PASS #19 WebPage constructor: should exist in window PASS #20 WebPage constructor: should be a function PASS #21 WebPage object: should be creatable PASS #22 WebPage object: should be able to get any signal handler that are currently set on it PASS #23 WebPage object: should be able to get any callback handler that are currently set on it PASS #24 WebPage object: should be able to get the error signal handler that is currently set on it (currently a special 1-off case) PASS #25 WebPage object: should pass variables from/to window.callPhantom/page.onCallback PASS #26 WebPage object: should pass result from/to window.confirm/page.onConfirm PASS #27 WebPage object: should pass result from/to window.prompt/page.onPrompt PASS #28 WebPage object: should have 'clipRect' property PASS #29 WebPage object: should have clipRect with height 0 PASS #30 WebPage object: should have clipRect with left 0 PASS #31 WebPage object: should have clipRect with top 0 PASS #32 WebPage object: should have clipRect with width 0 PASS #33 WebPage object: should have 'content' property PASS #34 WebPage object: should have 'content' as a string PASS #35 WebPage object: should have 'plainText' property PASS #36 WebPage object: should have 'plainText' as a string PASS #37 WebPage object: should have 'libraryPath' property PASS #38 WebPage object: should have 'libraryPath' as a string PASS #39 WebPage object: should have 'offlineStoragePath' property PASS #40 WebPage object: should have 'offlineStoragePath' as a string PASS #41 WebPage object: should have 'offlineStorageQuota' property PASS #42 WebPage object: should have objectName as 'WebPage' PASS #43 WebPage object: should have 'paperSize' property PASS #44 WebPage object: should have paperSize as an empty object PASS #45 WebPage object: should have 'scrollPosition' property PASS #46 WebPage object: should have scrollPosition with left 0 PASS #47 WebPage object: should have scrollPosition with top 0 PASS #48 WebPage object: should have 'settings' property PASS #49 WebPage object: should have non-empty settings PASS #50 WebPage object: should have 'customHeaders' property PASS #51 WebPage object: should have customHeaders as an empty object PASS #52 WebPage object: should have 'zoomFactor' property PASS #53 WebPage object: should have zoomFactor of 1 PASS #54 WebPage object: should have 'event' property PASS #55 WebPage object: should have 'cookies' property PASS #56 WebPage object: should have 'viewportSize' property PASS #57 WebPage object: should have viewportSize with height 300 PASS #58 WebPage object: should have viewportSize with width 400 PASS #59 WebPage object: should have 'deleteLater' function PASS #60 WebPage object: should have 'destroyed' function PASS #61 WebPage object: should have 'evaluate' function PASS #62 WebPage object: should have 'initialized' function PASS #63 WebPage object: should have 'injectJs' function PASS #64 WebPage object: should have 'javaScriptAlertSent' function PASS #65 WebPage object: should have 'javaScriptConsoleMessageSent' function PASS #66 WebPage object: should have 'loadFinished' function PASS #67 WebPage object: should have 'loadStarted' function PASS #68 WebPage object: should have 'openUrl' function PASS #69 WebPage object: should have 'release' function PASS #70 WebPage object: should have 'close' function PASS #71 WebPage object: should have 'render' function PASS #72 WebPage object: should have 'resourceReceived' function PASS #73 WebPage object: should have 'resourceRequested' function PASS #74 WebPage object: should have 'resourceError' function PASS #75 WebPage object: should have 'uploadFile' function PASS #76 WebPage object: should have 'sendEvent' function PASS #77 WebPage object: should have 'childFramesCount' function PASS #78 WebPage object: should have 'childFramesName' function PASS #79 WebPage object: should have 'switchToChildFrame' function PASS #80 WebPage object: should have 'switchToMainFrame' function PASS #81 WebPage object: should have 'switchToParentFrame' function PASS #82 WebPage object: should have 'currentFrameName' function PASS #83 WebPage object: should have 'addCookie' function PASS #84 WebPage object: should have 'deleteCookie' function PASS #85 WebPage object: should have 'clearCookies' function PASS #86 WebPage object: should have 'setContent' function PASS #87 WebPage object: should set content and location PASS #88 WebPage object: should handle keydown event PASS #89 WebPage object: should handle keyup event PASS #90 WebPage object: should handle keypress event PASS #91 WebPage object: should handle keypress event with inputs PASS #92 WebPage object: should handle keypress event of string with inputs PASS #93 WebPage object: should handle key events with modifier keys PASS #94 WebPage object: should send proper key codes for text PASS #95 WebPage object: should handle keypress event of umlaut char with inputs PASS #96 WebPage object: should handle mousedown event PASS #97 WebPage object: should handle mouseup event PASS #98 WebPage object: should handle mousemove event PASS #99 WebPage object: should handle click event PASS #100 WebPage object: should handle doubleclick event PASS #101 WebPage object: should handle file uploads FAIL #102 WebPage object: should support console.log with multiple arguments FAIL #103 WebPage object: should not load any NPAPI plugins (e.g. Flash) PASS #104 WebPage object: reports unhandled errors FAIL #105 WebPage object: doesn't report handled errors PASS #106 WebPage object: reports the sourceURL and line of errors FAIL #107 WebPage object: reports the stack of errors FAIL ReferenceError: Can't find variable: zomg #108 WebPage object: reports errors that occur in the main context FAIL #109 WebPage object: should set custom headers properly PASS #110 WebPage object: should process request body properly for POST PASS #111 WebPage object: should return properly from a 401 status PASS #112 WebPage object: should set valid cookie properly, then remove it PASS #113 WebPage object: should not set invalid cookies PASS #114 WebPage object: should add a cookie PASS #115 WebPage object: should delete a cookie PASS #116 WebPage object: should pass variables to functions properly PASS #117 WebPage object: should open url using secure connection FAIL #118 WebPage object: should handle resource request errors PASS #119 WebPage object: should able to abort a network request PASS #120 WebPage object: should fail on secure connection to url with bad cert PASS #121 WebPage object: should change the url of the request PASS #122 WebPage construction with options: should accept an opts object PASS #123 specifying clipRect: should have 'clipRect' property PASS #124 specifying clipRect: should have clipRect with height 100 PASS #125 specifying clipRect: should have clipRect with left 10 PASS #126 specifying clipRect: should have clipRect with top 20 PASS #127 specifying clipRect: should have clipRect with width 200 PASS #128 specifying onConsoleMessage: should have onConsoleMessage that was specified PASS #129 specifying onLoadStarted: should have onLoadStarted that was specified PASS #130 specifying onLoadFinished: should have onLoadFinished that was specified PASS #131 specifying scrollPosition: should have 'scrollPosition' property PASS #132 specifying scrollPosition: should have scrollPosition with left 1 PASS #133 specifying scrollPosition: should have scrollPosition with top 2 PASS #134 specifying timeout: should have timeout as 100 PASS #135 specifying userAgent: should have userAgent as 'PHANTOMJS-TEST-USER-AGENT' PASS #136 specifying viewportSize: should have 'viewportSize' property PASS #137 specifying viewportSize: should have viewportSize with height 100 PASS #138 specifying viewportSize: should have viewportSize with width 200 PASS #139 Text codec support: Should support text codec Shift_JIS PASS #140 Text codec support: Should support text codec EUC-JP PASS #141 Text codec support: Should support text codec ISO-2022-JP PASS #142 Text codec support: Should support text codec Big5 PASS #143 Text codec support: Should support text codec GBK PASS #144 WebPage switch frame of execution (deprecated API): should load a page full of frames PASS #145 WebPage switch frame of execution (deprecated API): should be able to detect frames at level 0 PASS #146 WebPage switch frame of execution (deprecated API): should go down to a child frame at level 1 PASS #147 WebPage switch frame of execution (deprecated API): should go down to a child frame at level 2 PASS #148 WebPage switch frame of execution (deprecated API): should go up to the parent frame at level 1 PASS #149 WebPage switch frame of execution (deprecated API): should go down to a child frame at level 2 (again) PASS #150 WebPage switch frame of execution (deprecated API): should go up to the main (top) frame at level 0 PASS #151 WebPage switch frame of execution (deprecated API): should go down to (the other) child frame at level 1 PASS #152 WebPage switch frame of execution: should load a page full of frames PASS #153 WebPage switch frame of execution: should be able to detect frames at level 0 PASS #154 WebPage switch frame of execution: should go down to a child frame at level 1 PASS #155 WebPage switch frame of execution: should go down to a child frame at level 2 PASS #156 WebPage switch frame of execution: should go up to the parent frame at level 1 PASS #157 WebPage switch frame of execution: should go down to a child frame at level 2 (again) PASS #158 WebPage switch frame of execution: should go up to the main (top) frame at level 0 PASS #159 WebPage switch frame of execution: should go down to (the other) child frame at level 1 PASS #160 WebPage switch frame of execution: should have top level as focused frame PASS #161 WebPage switch frame of execution: should move focus to level 1 frame PASS #162 WebPage switch frame of execution: should move focus to level 2 frame PASS #163 WebPage switch frame of execution: should move focus back to main frame PASS #164 WebPage switch frame of execution: should maintain focus but move current frame PASS #165 WebPage switch frame of execution: should change current frame to focused frame PASS #166 WebPage opening and closing of windows/child-pages: should call 'onPageCreated' every time a call to 'window.open' is done PASS #167 WebPage opening and closing of windows/child-pages: should correctly resize the 'pages' array if a page gets closed PASS #168 WebPage opening and closing of windows/child-pages: should resize the 'pages' array even more, when closing a page directly PASS #169 WebPage timeout handling: should call 'onResourceTimeout' on timeout PASS #170 WebPage closing notification/alerting: should call 'onClosing' when 'page.close()' is called PASS #171 WebPage closing notification/alerting: should call 'onClosing' when a page closes on it's own PASS #172 WebPage closing notification/alerting: closing propagation control: should close all 4 pages if parent page is closed (default value for 'ownsPages') PASS #173 WebPage closing notification/alerting: closing propagation control: should NOT close all 4 pages if parent page is closed, just parent itself ('ownsPages' set to false) PASS #174 WebPage 'onFilePicker': should be able to set the file to upload when the File Picker is invoked (i.e. clicking on a 'input[type=file]') PASS #175 WebPage navigation events: should navigate to relative url using window.location FAIL #176 WebPage render image: should render PDF file FAIL #177 WebPage render image: should render PDF file with format option FAIL #178 WebPage render image: should render GIF file FAIL #179 WebPage render image: should render GIF file with format option FAIL #180 WebPage render image: should render PNG file FAIL #181 WebPage render image: should render PNG file with format option FAIL #182 WebPage render image: should render JPEG file with quality option FAIL #183 WebPage render image: should render JPEG file with format and quality option FAIL #184 WebPage loading/loadingProgress properties: should not be loading when page has just been created PASS #185 WebPage loading/loadingProgress properties: should be loading when 'page.open' is invoked FAIL #186 WebServer constructor: should not exist in window PASS #187 WebServer constructor: should be a function PASS #188 WebServer object: should be creatable PASS #189 WebServer object: should have objectName as 'WebServer' PASS #190 WebServer object: should have 'port' property PASS #191 WebServer object: should have port as string PASS #192 WebServer object: should not listen to any port by default PASS #193 WebServer object: should have 'listenOnPort' function PASS #194 WebServer object: should have 'newRequest' function PASS #195 WebServer object: should have 'close' function PASS #196 WebServer object: should fail to listen to blocked ports PASS #197 WebServer object: should be able to listen to some port PASS #198 WebServer object: should handle requests PASS request.post => { "answer": "42", "universe": "expanding" } expectedPostData => { "answer": "42", "universe": "expanding" } request.headers => { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding": "gzip", "Accept-Language": "en-AU,*", "Connection": "Keep-Alive", "Content-Length": "28", "Content-Type": "application/x-www-form-urlencoded", "Host": "localhost:12345", "Origin": "null", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.0 Safari/534.34" } #199 WebServer object: should handle post requests ('Content-Type' = 'application/x-www-form-urlencoded') PASS request.post => "universe=expanding&answer=42" expectedPostData => { "answer": "42", "universe": "expanding" } request.headers => { "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Encoding": "gzip", "Accept-Language": "en-AU,*", "Connection": "Keep-Alive", "Content-Length": "28", "Content-Type": "application/json;charset=UTF-8", "Host": "localhost:12345", "Origin": "null", "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.0 Safari/534.34" } #200 WebServer object: should handle post requests ('Content-Type' = 'ANY') PASS #201 WebServer object: should handle binary data PASS #202 Basic Files API (read, write, remove, ...): should be able to create and write a file PASS #203 Basic Files API (read, write, remove, ...): should be able to create (touch) an empty file PASS #204 Basic Files API (read, write, remove, ...): should be able to read content from a file PASS #205 Basic Files API (read, write, remove, ...): should be able to read specific number of bytes from a specific position in a file PASS #206 Basic Files API (read, write, remove, ...): should be able to read/write/append content from a file PASS #207 Basic Files API (read, write, remove, ...): should be able to copy a file PASS #208 Basic Files API (read, write, remove, ...): should be able to move a file PASS #209 Basic Files API (read, write, remove, ...): should be able to remove a (moved) file PASS #210 Basic Files API (read, write, remove, ...): should be able to remove a (copied) file PASS #211 Basic Files API (read, write, remove, ...): should be able to remove an empty file PASS #212 Basic Files API (read, write, remove, ...): should throw an exception when trying to open for read a non existing file PASS #213 Basic Files API (read, write, remove, ...): should throw an exception when trying to copy a non existing file PASS #214 Basic Files API (read, write, remove, ...): should be read/write utf8 text by default PASS #215 Basic Files API (read, write, remove, ...): should be read/write binary data PASS #216 Basic Files API (read, write, remove, ...): should be read/write binary data (shortcuts) PASS #217 Attributes Files API: should throw an exception when trying to read the size of a non existing file PASS #218 Attributes Files API: should return a null Date object when trying to read the last modified date of a non existing file PASS #219 Attributes Files API: should create temporary file 'temp-02.test' and writes some content in it PASS #220 Attributes Files API: should be able to read the size of a temporary file 'temp-02.test' PASS #221 Attributes Files API: should be able to read the Date on which a temporary file 'temp-02.test' was last modified PASS #222 Attributes Files API: should remove temporary file 'temp-02.test' PASS #223 Files and Directories API: should create a new temporary directory and change the Current Working Directory to it PASS #224 Files and Directories API: should create a file in the Current Working Directory and check it's absolute path PASS #225 Files and Directories API: should return to previous Current Working Directory and remove temporary directory PASS #226 Files and Directories API: should copy Content of the '/test/' Directory in a temporary directory, compare with the original and then remove PASS #227 Files and Directories API: should have readLink function PASS #228 fs.join(...): empty parts PASS #229 fs.join(...): one part (empty string) PASS #230 fs.join(...): one part (array) PASS #231 fs.join(...): empty string and one part PASS #232 fs.join(...): empty string and multiple parts PASS #233 fs.join(...): empty string and multiple parts with empty strings PASS #234 fs.join(...): multiple parts PASS #235 fs.join(...): multiple parts with empty strings PASS #236 fs.split(path): should split absolute path with trailing separator PASS #237 fs.split(path): should split absolute path without trailing separator PASS #238 fs.split(path): should split non-absolute path with trailing separator PASS #239 fs.split(path): should split non-absolute path without trailing separator PASS #240 fs.split(path): should split path with consecutive separators PASS #241 Tests Files API: should create some temporary file and directory PASS #242 Tests Files API: should confirm that test file and test dir exist, while the absent ones don't PASS #243 Tests Files API: should confirm that the temporary directory is infact a directory, while the absent one doesn't PASS #244 Tests Files API: should confirm that the temporary file is infact a file, while the absent one doesn't PASS #245 Tests Files API: should confirm that a relative path is not absolute, while an absolute one is PASS #246 Tests Files API: should confirm that temporary file is readable, writable and non-executable, while absent file is none of those PASS #247 Tests Files API: should confirm that temporary directory is readable, writable and executable, while absent dir is none of those PASS #248 Tests Files API: should confirm that neither temporary file/dir or absent file/dir are links PASS #249 Tests Files API: should delete the temporary directory and file PASS #250 System object: should exist PASS #251 System object: should have pid property PASS #252 System object: should have pid as a number PASS #253 System object: should have pid that is an integer PASS #254 System object: should have pid greater than 0 PASS #255 System object: should have platform as string PASS #256 System object: should have platform set to 'phantomjs' PASS #257 System object: should have args as array PASS #258 System object: should have args with at least one item PASS #259 System object: should have args[0] as the this test runner PASS #260 System object: should have env as object PASS #261 System object: should have os as object PASS #262 System object: should have isSSLSupported as boolean PASS #263 System object: should have stdout as object PASS #264 System object: should have stderr as object PASS #265 System object: should have stdin as object PASS #266 WebKit: should construct date in mm-dd-yyyy format FAIL #267 WebKit: should parse date in ISO8601 format (yyyy-mm-dd) FAIL #268 WebKit: should not crash when failing to dirty lines while removing a inline. PASS #269 Module: has filename property containing its absolute path PASS #270 Module: has id property equal to filename PASS #271 Module: has dirname property containing absolute path to its directory PASS #272 Module: its require() can be used externally PASS #273 require(): loads 'webpage' native module PASS #274 require(): loads 'fs' native module PASS #275 require(): loads 'webserver' native module PASS #276 require(): loads 'system' native module PASS #277 require(): loads CoffeeScript modules PASS #278 require(): doesn't expose CoffeeScript PASS #279 require(): loads JSON modules PASS #280 require(): loads modules with specified extension PASS #281 require(): caches modules PASS #282 require(): supports cycles (circular dependencies) PASS #283 require(): has cache object attached containing cached modules PASS #284 require(): throws an error with appropriate message when module not found PASS #285 require(): maintains proper .stack when module not found FAIL #286 require(): maintains proper .stack when an error is thrown in module's exports FAIL #287 stub(): stubs modules in given context PASS #288 stub(): stubs modules in child context PASS #289 stub(): doesn't stub in parent context PASS #290 when invoked with a factory function: initializes the module lazily PASS #291 when invoked with a factory function: doesn't reinitialize the module each time it's required PASS #292 when the path is relative: loads modules from the same directory PASS #293 when the path is relative: loads modules from the parent directory PASS #294 when the path is relative: loads modules from a child directory PASS #295 when the path is relative: loads modules from a deeper directory PASS #296 when the path is relative: loads modules when path has intertwined '..' PASS #297 when the path is relative: loads modules when path has intertwined '.' PASS #298 when loading from node_modules: first tries to load from ./node_modules PASS #299 when loading from node_modules: loads from ../node_modules PASS #300 when loading from node_modules: loads from further up the directory tree PASS #301 when module is a directory: first tries to load the path from package.json PASS #302 when module is a directory: loads index.js if package.json not found PASS WebPage object should handle file uploads WebPage object should support console.log with multiple arguments WebPage object reports unhandled errors WebPage object reports the sourceURL and line of errors WebPage object reports the stack of errors WebPage object reports errors that occur in the main context WebPage object should open url using secure connection WebPage navigation events should navigate to relative url using window.location WebPage render image should render PDF file WebPage render image should render PDF file with format option WebPage render image should render GIF file WebPage render image should render GIF file with format option WebPage render image should render PNG file WebPage render image should render PNG file with format option WebPage render image should render JPEG file with quality option WebPage render image should render JPEG file with format and quality option WebPage loading/loadingProgress properties should be loading when 'page.open' is invoked WebKit should construct date in mm-dd-yyyy format WebKit should parse date in ISO8601 format (yyyy-mm-dd) require() maintains proper .stack when module not found require() maintains proper .stack when an error is thrown in module's exports Finished in 28.689 seconds 303 specs, 29 failures