Coder Social home page Coder Social logo

karma-safari-launcher's Introduction

karma-safari-launcher

Launcher for Safari.

Installation

The easiest way is to keep karma-safari-launcher as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-safari-launcher": "~0.1"
  }
}

You can simple do it by:

npm install karma-safari-launcher --save-dev

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    browsers: ['Safari']
  });
};

You can pass list of browsers as a CLI argument too:

karma start --browsers Safari

For more information on Karma see the homepage.

karma-safari-launcher's People

Contributors

dignifiedquire avatar vojtajina avatar zzo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

karma-safari-launcher's Issues

windows

i was unable to install the karma-safari-launcher on windows, i got the following message:
npm ERR! notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: win32
npm ERR! notsup Actual Arch: x64

is there a possible workaround for this problem? all i want is to test my application on safari for windows

Safari vs PhantomJS ReferenceError

I have recently bumped my Karma version from 0.10.x to 0.12.x. There now appears to be an inconsistency between the Safari runs and the PhantomJS runs. Safari always gives the following error. (I should also point out if I do not use both PhantomJS and Safari in the config. Then Karma hangs after these ReferenceError messages).

Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/webview/specs/fixtures/thumbnailer/registrar.html.js:1

This is weird to me because none of my code relies on AngularJS. Therefore, it is not surprising it cannot be found in my HTML fixtures (obviously one of the Karma frameworks may include it).

Obviously, I am seeking a solution to the problem. But I am not opposed to providing a patch either. I just really do not know how to track down this issue. Help?

Below is my karma.conf.js file and the full Karma output using config.LOG_DEBUG.

// Karma configuration
// Generated on Thu Mar 20 2014 13:41:27 GMT-0400 (EDT)

module.exports = function(config) {
  config.set({

    // base path, that will be used to resolve files and exclude
    basePath: '',


    // frameworks to use
    frameworks: ['jasmine', 'requirejs'],


    preprocessors: {
      'specs/**/*.html': ['html2js']
    },


    // list of files / patterns to load in the browser
    files: [
      // Need to do this to make sure jasmine-jquery is setup
      // This is because jasmine-jquery does not support AMD/RequireJS
      'support/js/libs/jquery-1.9.1.js',
      'support/js/libs/jasmine-jquery.js',

      // Start setup of the test environment
      'specs/fixtures/**/*.html',
      'specs/js/spec-main.js',
      {pattern: 'support/js/libs/**/*.js', included: false},
      {pattern: 'support/js/refman/**/*.js', included: false},
      {pattern: 'specs/js/**/*Spec.js', included: false}
    ],


    // list of files to exclude
    exclude: [
      'support/js/app.js'
    ],


    // test results reporter to use
    // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
    reporters: ['progress'],


    // web server port
    port: 9876,


    // enable / disable colors in the output (reporters and logs)
    colors: true,


    // level of logging
    // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
    logLevel: config.LOG_DEBUG,


    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,


    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera (has to be installed with `npm install karma-opera-launcher`)
    // - Safari (only Mac; has to be installed with `npm install karma-safari-launcher`)
    // - PhantomJS
    // - IE (only Windows; has to be installed with `npm install karma-ie-launcher`)
    browsers: ['Safari', 'PhantomJS'],


    // If browser does not capture in given timeout [ms], kill it
    captureTimeout: 60000,


    // Continuous Integration mode
    // if true, it capture browsers, run tests and exit
    singleRun: false
  });
};
DEBUG [config]: autoWatch set to false, because of singleRun
DEBUG [plugin]: Loading karma-* from /Users/ryan/Source/ecp-fsr-webview/node_modules
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-html2js-preprocessor.
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine.
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-junit-reporter.
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-phantomjs-launcher.
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-requirejs.
DEBUG [plugin]: Loading plugin /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-safari-launcher.
INFO [karma]: Karma v0.12.1 server started at http://localhost:9876/
INFO [launcher]: Starting browser Safari
DEBUG [temp-dir]: Creating temp dir at /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-63678209
INFO [launcher]: Starting browser PhantomJS
DEBUG [temp-dir]: Creating temp dir at /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-66097753
DEBUG [launcher]: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-phantomjs-launcher/node_modules/phantomjs/lib/phantom/bin/phantomjs /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-66097753/capture.js
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/injector.html".
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay.html".
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay-video.html".
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/registrar.html".
DEBUG [launcher]: /Applications/Safari.app/Contents/MacOS/Safari /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-63678209/redirect.html
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/touching.html".
DEBUG [preprocessor.html2js]: Processing "/Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/view.html".
DEBUG [watcher]: Resolved files:
    /Users/ryan/Source/ecp-fsr-webview/node_modules/requirejs/require.js
    /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-requirejs/lib/adapter.js
    /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/jasmine.js
    /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/boot.js
    /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/adapter.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jquery-1.9.1.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jasmine-jquery.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/injector.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay-video.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/registrar.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/touching.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/view.html.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/spec-main.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/Squire.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jquery.panzoom.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/mustache.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/libs/require.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/lightbox/injector.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/lightbox/overlay.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/native/bridge.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/lastTouched.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/registrar.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/scrollStopper.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/touching.js
    /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/view.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/lightbox/injectorSpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/lightbox/overlaySpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/lastTouchedSpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/registrarSpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/scrollStopperSpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/touchingSpec.js
    /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/viewSpec.js
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/client.html
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/karma.js
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/client.html
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/karma.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/Oa-2w7xo4_OW0knJxni6
DEBUG [karma]: A browser has connected on socket Oa-2w7xo4_OW0knJxni6
INFO [PhantomJS 1.9.7 (Mac OS X)]: Connected on socket Oa-2w7xo4_OW0knJxni6 with id 66097753
DEBUG [launcher]: PhantomJS (id 66097753) captured in 1.278 secs
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/context.html
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/node_modules/requirejs/require.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-requirejs/lib/adapter.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/injector.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jasmine-jquery.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/boot.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/jasmine.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/node_modules/karma-jasmine/lib/adapter.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jquery-1.9.1.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay-video.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/registrar.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/touching.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/view.html.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/spec-main.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/lightbox/injectorSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/lightbox/overlaySpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/lastTouchedSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/registrarSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/scrollStopperSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/touchingSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/specs/js/refman/thumbnailer/viewSpec.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/lastTouched.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/libs/Squire.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/lightbox/overlay.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/scrollStopper.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/touching.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/libs/jquery.panzoom.js
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/libs/mustache.js
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/context.html
PhantomJS 1.9.7 (Mac OS X): Executed 12 of 59 SUCCESS (0 secs / 0.004 secs)
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/lightbox/injector.js
PhantomJS 1.9.7 (Mac OS X): Executed 14 of 59 SUCCESS (0 secs / 0.035 secs)
DEBUG [web-server]: serving: /Users/ryan/Source/ecp-fsr-webview/node_modules/karma/static/context.html
PhantomJS 1.9.7 (Mac OS X): Executed 15 of 59 SUCCESS (0 secs / 0.04 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/registrar.js
PhantomJS 1.9.7 (Mac OS X): Executed 16 of 59 SUCCESS (0 secs / 0.063 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 17 of 59 SUCCESS (0 secs / 0.071 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
PhantomJS 1.9.7 (Mac OS X): Executed 18 of 59 SUCCESS (0 secs / 0.076 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 19 of 59 SUCCESS (0 secs / 0.082 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 20 of 59 SUCCESS (0 secs / 0.088 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 21 of 59 SUCCESS (0 secs / 0.1 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
DEBUG [web-server]: serving (cached): /Users/ryan/Source/ecp-fsr-webview/support/js/refman/thumbnailer/view.js
DEBUG [web-server]: upgrade /socket.io/1/websocket/L_R5ah_S6neAUEjOxni5
DEBUG [karma]: A browser has connected on socket L_R5ah_S6neAUEjOxni5
INFO [Safari 7.0.2 (Mac OS X 10.9.2)]: Connected on socket L_R5ah_S6neAUEjOxni5 with id 63678209
DEBUG [launcher]: Safari (id 63678209) captured in 1.48 secs
PhantomJS 1.9.7 (Mac OS X): Executed 22 of 59 SUCCESS (0 secs / 0.14 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 23 of 59 SUCCESS (0 secs / 0.15 secs)
WARN [web-server]: 404: /images/1_Front_matter/Wings.jpg
WARN [web-server]: 404: /images/1_Front_matter/Wings.jpg
PhantomJS 1.9.7 (Mac OS X): Executed 24 of 59 SUCCESS (0 secs / 0.159 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
WARN [web-server]: 404: /images/1_Front_matter/Wings.jpg
PhantomJS 1.9.7 (Mac OS X): Executed 25 of 59 (skipped 1) SUCCESS (0 secs / 0.167 secs)
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 26 of 59 (skipped 1) SUCCESS (0 secs / 0.181 secs)
WARN [web-server]: 404: /images/1_Front_matter/Wings.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/1_Front_matter/promulgation.png
WARN [web-server]: 404: /images/1_Front_matter/H60FH_GraphicsFrontMatterMH60R.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/injector.html.js:1
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay-video.html.js:1
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/lightbox/overlay.html.js:1
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/registrar.html.js:1
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/touching.html.js:1
PhantomJS 1.9.7 (Mac OS X): Executed 27 of 59 (skipped 1) SUCCESS (0 secs / 0.194 secs)
Safari 7.0.2 (Mac OS X 10.9.2) ERROR
  ReferenceError: Can't find variable: angular
  at /Users/ryan/Source/ecp-fsr-webview/specs/fixtures/thumbnailer/view.html.js:1
PhantomJS 1.9.7 (Mac OS X): Executed 28 of 59 (skipped 1) SUCCESS (0 secs / 0.207 secs)
WARN [web-server]: 404: /images/1_Front_matter/H60FH_GraphicsFrontMatterMH60R.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
PhantomJS 1.9.7 (Mac OS X): Executed 28 of 59 (skipped 1) SUCCESS (0 secs / 0.207 secs)
PhantomJS 1.9.7 (Mac OS X): Executed 29 of 59 (skipped 1) SUCCESS (0 secs / 0.222 secs)
WARN [web-server]: 404: /images/1_Front_matter/H60FH_GraphicsFrontMatterMH60R.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/Wings-thumb.jpg
WARN [web-server]: 404: /images/thumbs/1_Front_matter/H60FH_GraphicsFrontMatterMH60R-thumb.png
WARN [web-server]: 404: /images/thumbs/1_Front_matter/promulgation-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/TacChangeRecomForm-thumb.png
WARN [web-server]: 404: /images/thumbs/2_Preface/3-viewaircraft-thumb.png
WARN [web-server]: 404: /images/1_Front_matter/promulgation.png
PhantomJS 1.9.7 (Mac OS X): Executed 35 of 59 (skipped 1) SUCCESS (0 secs / 0.24 secs)
PhantomJS 1.9.7 (Mac OS X): Executed 49 of 59 (skipped 1) SUCCESS (0 secs / 0.296 secs)
PhantomJS 1.9.7 (Mac OS X): Executed 58 of 59 (skipped 1) SUCCESS (0.329 secs / 0.323 secs)
DEBUG [karma]: Run complete, exitting.
DEBUG [launcher]: Disconnecting all browsers
DEBUG [launcher]: Process PhantomJS exited with code 0
DEBUG [temp-dir]: Cleaning temp dir /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-66097753
DEBUG [launcher]: Process Safari exited with code 0
DEBUG [temp-dir]: Cleaning temp dir /var/folders/4s/b4nws0xn4v38mcs1c4s5mnkm0000gn/T/karma-63678209

Fails to launch Safari

We use safari for unit testing on Mac. But the karma safari launcher has been failing to launch safari since January. I did see that Safari was upgraded (to version 7.1.2) on the test runner machine at about that date so maybe it's due to that. I decided to wait a while until seeking assistance since maybe the problem would go away with an even newer version of safari or the launcher. But, even with the latest safari (7.1.6) and the latest launcher it still fails.

Does it only fail for me? If not, then it seems no one uses this component. Is it unloved?

From the build log:

[14:34:24][Step 1/1] INFO [karma]: Karma v0.12.32 server started at http://localhost:9876/
[14:34:24][Step 1/1] INFO [launcher]: Starting browser Safari
[14:34:24][Step 1/1] WARN [preprocess]: Can not load "html2js", it is not registered!
[14:34:24][Step 1/1]   Perhaps you are missing some plugin?
[14:35:24][Step 1/1] WARN [launcher]: Safari have not captured in 60000 ms, killing.
[14:35:24][Step 1/1] INFO [launcher]: Trying to start Safari again (1/2).
[14:36:24][Step 1/1] WARN [launcher]: Safari have not captured in 60000 ms, killing.
[14:36:24][Step 1/1] INFO [launcher]: Trying to start Safari again (2/2).
[14:37:24][Step 1/1] WARN [launcher]: Safari have not captured in 60000 ms, killing.
[14:37:24][Step 1/1] ERROR [launcher]: Safari failed 2 times (timeout). Giving up.
[14:37:24][Step 1/1] Process exited with code 1
[14:37:24][Step 1/1] Step Command Line failed

We get the warning about html2js even for successful runs (using chrome or firefox) so I don't think it's an issue.

No test-execution on Windows

I get the following message when I try to use the safari launcher:

WARN [launcher]: Safari have not captured in 60000 ms, killing.

Safari starts and loads the karma page but it does not execute the tests.
I am running Windows 7 Pro 64bit, and Karma 0.10.1

Using sinon.js sinon.stub() or sinon.spy() does not work with global functions in Safari

I have run into an issue with global functions and trying to stub or spy on them with sinon.js. It seems that whatever the Safari launcher is doing to start Safari makes it so that there are two instances of global functions.

For example, if I create a function like so:

function myFunc() {
  return true;
}

console.log(window.myFunc === myFunc);  //-> true

Then use sinon to stub or spy that function, there are now two instances of myFunc.

sinon.stub(window, 'myFunc');  // spying has the same problem

console.log(window.myFunc === myFunc);  //-> false

The myFunc function does not get stubbed, but the window.myFunc function does. This causes problems as calls to myFunc will still call the original function and not the stubbed one.

I have created a few test cases to demonstrate the problem. This jsFiddle shows that on all browsers including Safari, using just qunit and sinon.js and stubbing a global function behaves as expected.

I also created two test repositories using karma, one that uses Jasmine and the other that uses Mocha, to test the exact same code. In both cases, the test fail in Safari after stubbing the global function.

I've had to get around this issue by stubbing out the window function, then making the non-window function equal to the the window function. Then when I restore the function, I have to make the non-window function equal to the window function.

describe('test', function() {

  beforeEach(function() {
    sinon.stub(window, 'myFunc');
    myFunc = window.myFunc;
  });

  afterEach(function() {
    myFunc.restore();  // this actually doesn't restore the myFunc function, only window.myFunc
    myFunc = window.myFunc;
  });

});

Launching 10 instances of safari when one would do

Since installing Mavericks, Karma has got very keen on Safari, and launches 10 instances. Additionally, it doesn't close them after the tests have executed. I have to manually close one of the tabs, and then they all go. Super odd!

image

Tests do not run after karma update to v4.0.0

ERROR [karma-server]: TypeError: Cannot read property 'push' of undefined

If I remove Safari from karma.config.jsthe tests run through.

That's how the config looks like:

config.set({
        frameworks: ['jasmine'],
        files: ['test/main.js'],
        preprocessors: {
            'test/main.js': ['webpack', 'sourcemap']
        },
        webpack: require('./config/webpack.test.js'),
        reporters: [
            'progress',
            'kjhtml',
            'coverage-istanbul'
        ],
        autoWatch: true,
        browsers: ['Chrome', 'Firefox', 'Safari'],
...

Emits warning after shutdown

I just noticed a weird thing when I run karma with grunt as part of a larger build. After the karma task completes and moves on to subsequent grunt tasks, I sometimes get this message:

WARN [Safari 8.0.0 (Mac OS X 10.10)]: Disconnected (1 times), because no message in 10000 ms.
Safari 8.0.0 (Mac OS X 10.10): Executed 24 of 48 DISCONNECTED (10.547 secs / 0.062 secs)

This is after karma-safari-launcher successfully shut down Safari and indicating that all the tests passed much earlier (about... drumroll please... ten seconds). It kind of looks like its somehow attempting a rerun, or accidentally starting two runs.

Since none of the other launchers have this problem, I figured I'd make a note of it here.

Focus on startup

Is there any option for setting focus to the Safari browser window when the tests start?

Project description references "Testacular"

Currently the GitHub project description reads

A Testacular plugin. Launcher for Safari.

However, as I understand it, "Testacular" is an old name for Karma. Therefore, in order to be accurate and consistent with the other launcher plugins, I think it should read

A Karma plugin. Launcher for Safari.

Can someone with appropriate permissions address this when they find time?

Tests do not run after karma update to v4.0.0

ERROR [karma-server]: TypeError: Cannot read property 'push' of undefined

If I remove Safari from karma.config.jsthe tests run through.

That's how the config looks like:

config.set({
        frameworks: ['jasmine'],
        files: ['test/main.js'],
        preprocessors: {
            'test/main.js': ['webpack', 'sourcemap']
        },
        webpack: require('./config/webpack.test.js'),
        reporters: [
            'progress',
            'kjhtml',
            'coverage-istanbul'
        ],
        autoWatch: true,
        browsers: ['Chrome', 'Firefox', 'Safari'],
...

Use safaridriver for profile separation?

Safari 10 added native WebDriver support: https://webkit.org/blog/6900/webdriver-support-in-safari-10/.

Windows controller by the driver are using separate profiles, are non-interactive by default (don't respond to mouse events) etc. - all the things that Karma needs. Perhaps the launcher could use safaridriver jsut to launch Safari and use the regular socket.io-based communication once the connection is established?

This would eliminate some common issues with the launcher that rely on the fact that it doesn't create a separate profile (like #6).

Injecting custom headers

When testing PhantomJS and Chrome we create customLaunchers for each, extending their base, and then adding customHeaders option; these headers are then added to every web request made. However with Safari this doesn't seem to happen, certainly not on the XHR requests going through.

Do you know if Safari will support this? If so, do we perhaps need to use a different option?

Example

           'Safari_custom': {
                base: 'Safari',
                options: {
                    windowName: 'my-window',
                    settings: {},
                    customHeaders: {
                        'X-Custom-Header': 'Something'
                    }
                },
                flags: []
            },

Note
We notice this in the DEBUG output and are unsure if relevant:

[2014-08-13 14:50:14.135] [DEBUG] web-server - upgrade /socket.io/1/websocket/Ccycwm_zbRKjy63yoB3E
[2014-08-13 14:50:14.135] [DEBUG] proxy - NOT upgrading proxyWebSocketRequest /socket.io/1/websocket/Ccycwm_zbRKjy63yoB3E

Any assistance or thoughts much appreciated!

os dependency

We are using grunt and grunt-karma for our build process. The browser array is set dynamically in the Gruntfile, based on the installed browsers on the current system. Our team have Linux, Windows and Mac computers, so the code is tested in all browsers. This works fine with karma 0.8.

Now with the new version all browsers are plugins. But now we cannot add the karma-safari-launcher in the package.json as devDependency, since this will cause an error on windows an linux because this plugin need to be installed on darwin.

Is it possible to remove the os dependency so that we can have a package.json with all browser plugins? This issue is also true for the karma-ie-launcher.

Btw, Safari can also be installed on windows ๐Ÿ˜ƒ

Safari 12 (mojave) asking for user feedback on opening local .html redirect

Upon running a test in karma and launching Safari via this plugin, Safari 12 on macOS mojave asks for user feedback to confirm opening the local $tmp/[safari|redirect].html

Only after explicitly confirming loading the .html, karma tests continue running.

bildschirmfoto 2018-10-05 um 17 35 02

Would have liked to PR this breaking usage change, but couldn't find any documentation on how to either provide cmd line switches to Safari or otherwise tackle this :(

FTR: env:
macOS 10.14
Safari 12.0 (14606.1.36.1.9)
karma-safari-launcher 1.0.0

Tests do not run when Safari window is not in the foreground

macOS Sierra 10.12.4
Safari 10.1 (12603.1.30.0.34)

I have my karma tests running on Chrome, Firefox, and Safari. Generally, I have a full-screen terminal window where I start the tests from, so the browsers are launched in the background (on a separate "desktop"). Chrome and Firefox both complete the tests quickly with no issue, but Safari just hangs out not doing anything. The tests will not run until I switch desktops and bring Safari into the foreground (unclear if it has to be focused), at which point the tests then quickly complete.

I've looked through all of the Safari preferences, and tried disabling the "Stop plug-ins to save power" option with no success. I also tried globally disabling the OSX "App Nap" feature (which doesn't seem to include Safari anyways).

If there is any sort of workaround for this, it would be great if karma-safari-launcher could turn it on automatically :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.