Skip to content

Commit

Permalink
Merge pull request #199 from Adezandee/updates
Browse files Browse the repository at this point in the history
feat(package): update cucumber version 1.2.2
  • Loading branch information
Arnaud Dezandee committed Sep 4, 2016
2 parents 9b8b8a9 + 32ca010 commit 8da0f8d
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 47 deletions.
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ branches:
- master

node_js:
- "5"
- "6"
- "4"

addons:
Expand All @@ -24,9 +24,8 @@ before_install:
- "sh -e /etc/init.d/xvfb start"

install:
- npm i -g npm@2
- npm i -g webdriver-manager@10.0.1
- npm i
- npm install -g webdriver-manager
- npm install

before_script:
- webdriver-manager update
Expand Down
49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,43 +47,41 @@
"protractor": "protractor protractor.cucumber.js"
},
"dependencies": {
"bluebird": "~3.4.1",
"chai": "~3.5.0",
"cucumber": "1.0.0",
"debug": "~2.2.0",
"immutable": "~3.8.1",
"lodash.defaultsdeep": "~4.4.0",
"meow": "~3.7.0",
"util-arity": "~1.0.2",
"webdriverio": "~4.1.0"
"bluebird": "3.4.6",
"chai": "3.5.0",
"cucumber": "1.2.2",
"debug": "2.2.0",
"immutable": "3.8.1",
"lodash.defaultsdeep": "4.6.0",
"meow": "3.7.0",
"util-arity": "1.0.2",
"webdriverio": "4.2.11"
},
"devDependencies": {
"babel-cli": "~6.10.1",
"babel-eslint": "~6.1.0",
"babel-cli": "~6.14.0",
"babel-plugin-add-module-exports": "~0.2.1",
"babel-plugin-transform-object-rest-spread": "~6.8.0",
"babel-preset-es2015": "~6.9.0",
"babel-register": "~6.9.0",
"babel-preset-es2015": "~6.14.0",
"babel-register": "~6.14.0",
"body-parser": "~1.15.2",
"coveralls": "~2.11.9",
"cz-conventional-changelog": "~1.1.6",
"eslint": "~2.13.1",
"eslint-config-airbnb-base": "~3.0.1",
"eslint-plugin-import": "~1.9.2",
"coveralls": "~2.11.12",
"cz-conventional-changelog": "~1.2.0",
"eslint": "~3.4.0",
"eslint-config-airbnb-base": "~5.0.3",
"eslint-plugin-import": "~1.14.0",
"express": "~4.14.0",
"isparta": "~4.0.0",
"jest-mock": "~13.0.0",
"lodash.range": "~3.1.4",
"mocha": "~2.5.3",
"jest-mock": "~15.0.0",
"lodash.range": "~3.2.0",
"mocha": "~3.0.2",
"morgan": "~1.7.0",
"protractor": "3.3.0",
"protractor-cucumber-framework": "0.6.0",
"protractor": "~4.0.4",
"protractor-cucumber-framework": "~0.6.0",
"semantic-release": "~4.3.5",
"swig": "~1.4.2"
},
"eslintConfig": {
"extends": "airbnb-base",
"parser": "babel-eslint",
"env": {
"es6": true,
"node": true,
Expand All @@ -95,7 +93,8 @@
"no-console": 0,
"new-cap": 0,
"global-require": 0,
"func-names": 0
"func-names": 0,
"import/no-extraneous-dependencies": 0
}
},
"babel": {
Expand Down
3 changes: 2 additions & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import path from 'path';
import meow from 'meow';
import dbg from 'debug';
import cucumber from 'cucumber';
import { startMocking } from './cli/rewire.js';
import startMocking from './cli/rewire.js';
import Mink from './mink.js';

/**
Expand Down Expand Up @@ -47,6 +47,7 @@ const injectArgs = (flags) => {
params.driver.port = flags.port;

const inject = require('./cli/support/mink_inject.js');

const injectPath = path.join(__dirname, '/cli/support/mink_inject.js');
startMocking(injectPath, inject(params));

Expand Down
4 changes: 2 additions & 2 deletions src/cli/rewire.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const intercept = {};

/* eslint prefer-rest-params: 0 */
module._load = function (request) {
if (intercept.hasOwnProperty(request)) {
if ({}.hasOwnProperty.call(intercept, request)) {
return intercept[request];
}

Expand All @@ -20,6 +20,6 @@ module._load = function (request) {
* Interface
*/

export function startMocking(path, mockExport) {
export default function startMocking(path, mockExport) {
intercept[path] = mockExport;
}
1 change: 1 addition & 0 deletions src/cli/support/mink_inject.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const debug = require('debug')('mink:inject');
module.exports = function (parameters) {
return function () {
const Mink = require('../../mink.js');

debug(parameters);
Mink.init(this, parameters);
};
Expand Down
4 changes: 2 additions & 2 deletions src/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const debug = dbg('mink:driver');
* Interface
*/

export const configureDriver = (parameters) => {
export default function configureDriver(parameters) {
debug(parameters);

if (!!parameters.protractor && global.protractor) {
return new ProtractorDriver(parameters);
}

return new WdIODriver(parameters);
};
}
2 changes: 1 addition & 1 deletion src/drivers/protractor.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const UNICODE_CHARACTERS = {
};

const checkUnicode = (value) => (
UNICODE_CHARACTERS.hasOwnProperty(value)
{}.hasOwnProperty.call(UNICODE_CHARACTERS, value)
? [UNICODE_CHARACTERS[value]]
: value.split('')
);
Expand Down
5 changes: 4 additions & 1 deletion src/drivers/webdriverio.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ const debug = dbg('mink:webdriverio');
* Interface
*/

export default class WdIODriver {
class WdIODriver {
constructor(parameters) {
this.parameters = parameters;
this.client = require('webdriverio').remote(parameters);

this.baseUrl = parameters.baseUrl;
}

Expand Down Expand Up @@ -156,3 +157,5 @@ WdIODriver.prototype.check = WdIODriver.prototype.click;
WdIODriver.prototype.uncheck = WdIODriver.prototype.click;
WdIODriver.prototype.hover = WdIODriver.prototype.moveToObject;
WdIODriver.prototype.setViewportSize = WdIODriver.prototype.windowHandleSize;

export default WdIODriver;
15 changes: 6 additions & 9 deletions src/mink.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import defaultsDeep from 'lodash.defaultsdeep';
import pkg from '../package.json';

import Step from './step.js';
import { configureDriver } from './driver.js';
import configureDriver from './driver.js';
import definitions from './step_definitions/index.js';

/**
Expand Down Expand Up @@ -167,17 +167,14 @@ class Mink {
* @returns {void}
*/
registerHooks(cucumber, driver) {
cucumber.registerHandler('BeforeFeatures', (event, done) =>
driver.init()
.then(() => driver.setViewportSize(driver.parameters.viewportSize))
.then(() => done())
.catch(error => console.error(error))
cucumber.registerHandler('BeforeFeatures', (/* event */) =>
driver.init().then(() =>
driver.setViewportSize(driver.parameters.viewportSize)
)
);

cucumber.registerHandler('AfterFeatures', (event, done) =>
cucumber.registerHandler('AfterFeatures', (/* event */) =>
driver.end()
.then(() => done())
.catch(error => console.error(error))
);

if (driver.parameters.screenshotPath) {
Expand Down
2 changes: 1 addition & 1 deletion src/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class Step {
}

runWith(context, line, cb = noop) {
const args = (!!line) ? this.match(line).slice(1) : this.args;
const args = (line) ? this.match(line).slice(1) : this.args;
return Promise.try(() => (
this.fn.apply(context, args)
)).asCallback(cb);
Expand Down
2 changes: 1 addition & 1 deletion src/step_definitions/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const isAbsoluteUrl = location => /^(?:\w+:)\/\//.test(location);

const parseUrlWithEnv = location => {
const matches = /^\${([^"]*)}/.exec(location);
return !!matches
return (matches)
? process.env[matches[1]] + location.replace(matches[0], '')
: location;
};
Expand Down

0 comments on commit 8da0f8d

Please sign in to comment.