This repository has been archived by the owner on Dec 18, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from just-boris/master
Service impementation
- Loading branch information
Showing
14 changed files
with
243 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
[*] | ||
|
||
indent_style = space | ||
indent_size = 4 | ||
|
||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"extends": "standard", | ||
"parserOptions": { | ||
"ecmaVersion": 6 | ||
}, | ||
"rules": { | ||
"indent": [2, 4] | ||
}, | ||
"env": { | ||
"es6": true | ||
}, | ||
"globals": {} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Logs | ||
logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build | ||
|
||
# Dependency directory | ||
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git | ||
node_modules |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
module.exports = function (grunt) { | ||
grunt.initConfig({ | ||
pkgFile: 'package.json', | ||
clean: ['build'], | ||
babel: { | ||
options: { | ||
sourceMap: false | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: './lib', | ||
src: ['*.js'], | ||
dest: 'build', | ||
ext: '.js' | ||
}] | ||
} | ||
}, | ||
watch: { | ||
dist: { | ||
files: ['./lib/*.js'], | ||
tasks: ['babel:dist'] | ||
} | ||
}, | ||
eslint: { | ||
target: [ | ||
'index.js', | ||
'lib/*.js' | ||
] | ||
}, | ||
contributors: { | ||
options: { | ||
commitMessage: 'update contributors' | ||
} | ||
}, | ||
bump: { | ||
options: { | ||
commitMessage: 'v%VERSION%', | ||
pushTo: 'upstream' | ||
} | ||
} | ||
}) | ||
|
||
require('load-grunt-tasks')(grunt) | ||
grunt.registerTask('default', ['build']) | ||
grunt.registerTask('build', 'Build wdio-selenium-service', function () { | ||
grunt.task.run([ | ||
'eslint', | ||
'clean', | ||
'babel' | ||
]) | ||
}) | ||
grunt.registerTask('release', 'Bump and tag version', function (type) { | ||
grunt.task.run([ | ||
'build', | ||
'contributors', | ||
'bump:' + (type || 'patch') | ||
]) | ||
}) | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var SeleniumService = require('./build/service').default | ||
module.exports = new SeleniumService() | ||
// module.exports.launcher = require('./launcher') |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
var SeleniumLauncher = require('./build/launcher').default | ||
module.exports = new SeleniumLauncher() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Selenium from 'selenium-standalone' | ||
import denodeify from 'denodeify' | ||
|
||
const startSelenium = denodeify(Selenium.start) | ||
|
||
class SeleniumStandaloneLauncher { | ||
|
||
onPrepare () { | ||
return startSelenium().then((process) => { | ||
this.process = process | ||
}) | ||
} | ||
|
||
onComplete () { | ||
this.process.kill() | ||
} | ||
} | ||
|
||
export default SeleniumStandaloneLauncher |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default class SeleniumServer { | ||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{ | ||
"name": "wdio-selenium-standalone-service", | ||
"version": "0.0.1", | ||
"description": "WebdriverIO service to start & stop Selenium Standalone", | ||
"main": "index.js", | ||
"scripts": { | ||
"postinstall": "selenium-standalone install", | ||
"build": "grunt build", | ||
"test": "wdio test/wdio.conf.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/webdriverio/wdio-selenium-standalone-service.git" | ||
}, | ||
"keywords": [ | ||
"webdriverio", | ||
"selenium", | ||
"tests" | ||
], | ||
"author": "", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/webdriverio/wdio-selenium-standalone-service/issues" | ||
}, | ||
"homepage": "https://github.com/webdriverio/wdio-selenium-standalone-service#readme", | ||
"dependencies": { | ||
"denodeify": "^1.2.1", | ||
"selenium-standalone": "^5.1.0" | ||
}, | ||
"devDependencies": { | ||
"babel": "^6.5.2", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-register": "^6.7.2", | ||
"eslint": "^2.5.1", | ||
"eslint-config-standard": "^5.1.0", | ||
"eslint-plugin-promise": "^1.1.0", | ||
"eslint-plugin-standard": "^1.3.2", | ||
"grunt": "^0.4.5", | ||
"grunt-babel": "^6.0.0", | ||
"grunt-cli": "^1.1.0", | ||
"grunt-contrib-clean": "^1.0.0", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-eslint": "^18.0.0", | ||
"grunt-npm": "0.0.2", | ||
"load-grunt-tasks": "^3.4.1", | ||
"wdio-mocha-framework": "^0.2.12", | ||
"webdriverio": "^4.0.5" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"env": { | ||
"mocha": true | ||
}, | ||
"globals": { | ||
"browser": true | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import assert from 'assert' | ||
|
||
describe('webdriverio', function () { | ||
it('a spec', function () { | ||
browser.url('/') | ||
assert.equal(browser.getTitle(), 'WebdriverIO - Selenium 2.0 javascript bindings for nodejs') | ||
}) | ||
}) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
exports.config = { | ||
|
||
specs: [ | ||
'./test/*.spec.js' | ||
], | ||
|
||
capabilities: [{ | ||
browserName: 'firefox' | ||
}], | ||
|
||
sync: true, | ||
logLevel: 'silent', | ||
coloredLogs: true, | ||
|
||
baseUrl: 'http://webdriver.io', | ||
|
||
waitforTimeout: 10000, | ||
connectionRetryTimeout: 90000, | ||
connectionRetryCount: 3, | ||
|
||
framework: 'mocha', | ||
mochaOpts: { | ||
ui: 'bdd', | ||
requires: [ | ||
'babel-register' | ||
] | ||
}, | ||
|
||
services: [ | ||
require('../') | ||
] | ||
} |