Created
April 4, 2014 21:15
-
-
Save squidge/9983307 to your computer and use it in GitHub Desktop.
Grunt-Protractor-task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function(grunt) { | |
grunt.initConfig({ | |
protractor_webdriver: { | |
local: { | |
options: { | |
path: '', | |
command: 'webdriver-manager start', | |
}, | |
}, | |
}, | |
protractor: { | |
e2e: { | |
options: { | |
configFile: "protractor.conf.js", // Target-specific config file | |
keepAlive: false, // If false, the grunt process stops when the test fails. | |
noColor: false, // If true, protractor will not use colors in its output. | |
args: {} // Target-specific arguments | |
} | |
}, | |
} | |
}); | |
grunt.loadNpmTasks('grunt-protractor-webdriver'); | |
grunt.loadNpmTasks('grunt-protractor-runner'); | |
grunt.registerTask('test', function(target) { | |
return grunt.task.run([ | |
/* spin your server app before launching webdriver */ | |
'protractor_webdriver:local', | |
'protractor:e2e' | |
]); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('angularjs homepage', function() { | |
it('should greet the named user', function() { | |
browser.get('http://www.angularjs.org'); | |
element(by.model('yourName')).sendKeys('John Doe'); | |
var greeting = element(by.binding('yourName')); | |
expect(greeting.getText()).toEqual('Hello John Doe!'); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.config = { | |
allScriptsTimeout: 11000, | |
specs: [ | |
'test/e2e/**/*.js' | |
], | |
capabilities: { | |
'browserName': 'chrome' | |
}, | |
baseUrl: 'http://localhost:9000', | |
seleniumAddress: 'http://localhost:4444/wd/hub', | |
framework: 'jasmine', | |
jasmineNodeOpts: { | |
defaultTimeoutInterval: 30000 | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment