diff --git a/.travis.yml b/.travis.yml index 9f977e2505..5828184608 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,14 @@ language: node_js node_js: - '0.10' +services: + - mongodb before_script: - 'npm install -g bower grunt-cli' - 'bower install' - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start + - cp config.json.example config.json + - ./node_modules/protractor/bin/webdriver-manager update + - ./node_modules/protractor/bin/webdriver-manager start & + - grunt run:dev > /dev/null & diff --git a/karma-e2e.conf.js b/karma-e2e.conf.js deleted file mode 100644 index fa01484a0a..0000000000 --- a/karma-e2e.conf.js +++ /dev/null @@ -1,54 +0,0 @@ -// Karma configuration -// http://karma-runner.github.io/0.10/config/configuration-file.html - -module.exports = function(config) { - config.set({ - // base path, that will be used to resolve files and exclude - basePath: '', - - // testing framework to use (jasmine/mocha/qunit/...) - frameworks: ['ng-scenario'], - - // list of files / patterns to load in the browser - files: [ - 'test/e2e/**/*.js' - ], - - // list of files / patterns to exclude - exclude: [], - - // web server port - port: 8080, - - // level of logging - // possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG - logLevel: config.LOG_INFO, - - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - - // Start these browsers, currently available: - // - Chrome - // - ChromeCanary - // - Firefox - // - Opera - // - Safari (only Mac) - // - PhantomJS - // - IE (only Windows) - browsers: ['Chrome'], - - - // Continuous Integration mode - // if true, it capture browsers, run tests and exit - singleRun: false - - // Uncomment the following lines if you are using grunt's server to run the tests - // proxies: { - // '/': 'http://localhost:9000/' - // }, - // URL root prevent conflicts with the site root - // urlRoot: '_karma_' - }); -}; diff --git a/package.json b/package.json index 9e2ac50493..87f7604b40 100644 --- a/package.json +++ b/package.json @@ -58,12 +58,12 @@ "npm": "1.2.x" }, "scripts": { - "test": "grunt karma:continuous", + "test": "grunt karma:continuous && ./node_modules/protractor/bin/protractor protractor.conf.js", "start": "grunt run:dev", "postinstall": "./node_modules/bower/bin/bower install -f" }, "devDependencies": { - "karma-ng-scenario": "~0.1.0", + "protractor": "~0.14.0", "grunt-karma": "~0.6.2", "karma-script-launcher": "~0.1.0", "karma-chrome-launcher": "~0.1.0", diff --git a/protractor.conf.js b/protractor.conf.js new file mode 100644 index 0000000000..290322646f --- /dev/null +++ b/protractor.conf.js @@ -0,0 +1,24 @@ +// An example configuration file. +exports.config = { + // The address of a running selenium server. + seleniumAddress: 'http://localhost:4444/wd/hub', + + // Capabilities to be passed to the webdriver instance. + capabilities: { + 'browserName': 'firefox' + }, + + // Spec patterns are relative to the current working directly when + // protractor is called. + specs: ['test/e2e/e2e.js'], + + // A base URL for your application under test. Calls to protractor.get() + // with relative paths will be prepended with this. + baseUrl: 'http://localhost:3000', + + // Options to be passed to Jasmine-node. + jasmineNodeOpts: { + showColors: true, + defaultTimeoutInterval: 30000 + } +}; \ No newline at end of file diff --git a/test/e2e/e2e.js b/test/e2e/e2e.js new file mode 100644 index 0000000000..6e57d30121 --- /dev/null +++ b/test/e2e/e2e.js @@ -0,0 +1,22 @@ +'use strict'; + +describe('index page', function() { + beforeEach(function(){ + browser.ignoreSynchronization = true; + browser.get('http://localhost:3000/'); + }); + + it('shows the front page', function(){ + // browser.sleep(3000); + var button = element(by.className('btn')); + expect(button.getText()).toEqual('Play'); + }); + + it('shows the login form', function(){ + var button = element(by.className('btn')); + button.click(); + + }); + + +}); \ No newline at end of file