Skip to content

Commit

Permalink
bumped version to 0.0.6 - selenium is now booted only once
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbjensen committed Jan 26, 2013
1 parent 7dc2a4a commit c7bb848
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 20 deletions.
22 changes: 14 additions & 8 deletions copy/world.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@ process.env["SS_ENV"] = "cucumber"
selenium = require '../../node_modules/ss-cucumber/node_modules/selenium-launcher'
soda = require '../../node_modules/ss-cucumber/node_modules/soda'
app = require '../../app'
browser = null

World = (callback) ->

selenium (err,selenium) ->
@browser = soda.createClient
host: selenium.host
port: selenium.port
url: "http://localhost:3000"
browser: "firefox"

if browser is null
selenium (err,selenium) ->
browser = soda.createClient
host: selenium.host
port: selenium.port
url: "http://localhost:3000"
browser: "firefox"

@browser = browser
callback {@browser}
process.on 'exit', -> selenium.kill()
else
@browser = browser
callback {@browser}
process.on 'exit', -> selenium.kill()

exports.World = World
32 changes: 21 additions & 11 deletions copy/world.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,31 @@ process.env["SS_ENV"] = "cucumber";
var selenium = require('../../node_modules/ss-cucumber/node_modules/selenium-launcher');
var soda = require('../../node_modules/ss-cucumber/node_modules/soda');
var app = require('../../app');
var browser = null;

var World = function(callback){

selenium(function(err,selenium){
this.browser = soda.createClient({
host: selenium.host,
port: selenium.port,
url: "http://localhost:3000",
browser: "firefox"

if (browser == null) {
selenium(function(err,selenium){
browser = soda.createClient({
host: selenium.host,
port: selenium.port,
url: "http://localhost:3000",
browser: "firefox"
});

this.browser = browser;
callback({browser: this.browser});
process.on('exit', function(){
selenium.kill();
});
});

} else {
this.browser = browser;
callback({browser: this.browser});
process.on('exit', function(){
selenium.kill();
});
})
}

};

exports.World = World;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Paul Jensen <[email protected]> (http://paulbjensen.co.uk)",
"name": "ss-cucumber",
"description": "Cucumber.js integration for SocketStream",
"version": "0.0.5",
"version": "0.0.6",
"homepage": "https://github.com/Anephenix/ss-cucumber",
"repository": {
"type": "git",
Expand Down

0 comments on commit c7bb848

Please sign in to comment.