Skip to content

Commit

Permalink
Starting e2e testing
Browse files Browse the repository at this point in the history
  • Loading branch information
djuretic committed Jan 1, 2014
1 parent 0f3202f commit 462bc41
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 56 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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 &
54 changes: 0 additions & 54 deletions karma-e2e.conf.js

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions protractor.conf.js
Original file line number Diff line number Diff line change
@@ -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
}
};
22 changes: 22 additions & 0 deletions test/e2e/e2e.js
Original file line number Diff line number Diff line change
@@ -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();

});


});

0 comments on commit 462bc41

Please sign in to comment.