From 5eb7eb87bbca0d83100e3d4106295c937624e686 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:01:22 +0200 Subject: [PATCH 01/15] Fixed syntax issue in `.babelrc` file --- .babelrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.babelrc b/.babelrc index 6eadcdae..a0765e18 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,3 @@ { - presets: ['es2015'] + "presets": ["es2015"] } From ce83530e26e6a42e0a6d1f5a53d4a5b2fd8d2097 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:02:02 +0200 Subject: [PATCH 02/15] Updated dependencies --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5d7cc93a..77c99d49 100644 --- a/package.json +++ b/package.json @@ -32,11 +32,11 @@ "dependencies": { "babel-preset-es2015": "~6.24.0", "babel-register": "~6.26.0", - "chai": "~4.1.0", + "chai": "~4.1.2", "wdio-cucumber-framework": "~1.0.2", "wdio-phantomjs-service": "~0.2.2", "wdio-selenium-standalone-service": "~0.0.9", - "wdio-spec-reporter": "~0.1.0", + "wdio-spec-reporter": "~0.1.2", "webdriverio": "4.7.1" }, "devDependencies": { From 36e1cfcf7b89644a8a067560d285c8613c9c9004 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:02:16 +0200 Subject: [PATCH 03/15] Added Cucumber 3 dependency --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 77c99d49..4f6c7461 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "babel-preset-es2015": "~6.24.0", "babel-register": "~6.26.0", "chai": "~4.1.2", + "cucumber": "~3.0.1", "wdio-cucumber-framework": "~1.0.2", "wdio-phantomjs-service": "~0.2.2", "wdio-selenium-standalone-service": "~0.0.9", From 59f8b19cfea27a67d95cb89e12c603eae36d0b50 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:02:35 +0200 Subject: [PATCH 04/15] Updated the pending feature --- src/features/pending.feature | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/features/pending.feature b/src/features/pending.feature index e9fd3420..213ad6e4 100644 --- a/src/features/pending.feature +++ b/src/features/pending.feature @@ -1,10 +1,8 @@ -@Pending +@pending Feature: Pending scenario As a test framework I should be able skip all these scenarios Scenario: do somethimg Given I open the site "/" - # And ... - # Then ... - # And ... + Then this will fail since this does not exist From a40b4df3f8d4fc4cc4206376a52fdad6f39b17c0 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:04:52 +0200 Subject: [PATCH 05/15] Updated the codebase to match the new Cucumber syntax/functionalities --- src/steps/given.js | 49 ++-- src/steps/then.js | 70 ++--- src/steps/when.js | 43 +-- src/support/action/clearInputField.js | 7 +- src/support/action/clickElement.js | 5 +- src/support/action/closeAllButFirstTab.js | 7 +- src/support/action/closeLastOpenedWindow.js | 10 +- src/support/action/deleteCookie.js | 5 +- src/support/action/dragElement.js | 5 +- src/support/action/focusLastOpenedWindow.js | 9 +- src/support/action/handleModal.js | 5 +- src/support/action/moveToElement.js | 6 +- src/support/action/openWebsite.js | 5 +- src/support/action/pause.js | 5 +- src/support/action/pressButton.js | 5 +- src/support/action/resizeScreenSize.js | 5 +- src/support/action/scroll.js | 5 +- src/support/action/selectOption.js | 11 +- src/support/action/selectOptionByIndex.js | 5 +- src/support/action/setCookie.js | 5 +- src/support/action/setInputField.js | 11 +- src/support/action/setPromptText.js | 5 +- src/support/action/submitForm.js | 5 +- src/support/action/waitFor.js | 16 +- src/support/action/waitForVisible.js | 5 +- src/support/check/checkClass.js | 5 +- src/support/check/checkContainsAnyText.js | 14 +- src/support/check/checkContainsText.js | 14 +- src/support/check/checkCookieContent.js | 5 +- src/support/check/checkCookieExists.js | 5 +- src/support/check/checkDimension.js | 5 +- src/support/check/checkElementExists.js | 15 +- src/support/check/checkEqualsText.js | 14 +- src/support/check/checkFocus.js | 5 +- src/support/check/checkInURLPath.js | 5 +- src/support/check/checkIsEmpty.js | 6 +- src/support/check/checkIsOpenedInNewWindow.js | 7 +- src/support/check/checkModal.js | 5 +- src/support/check/checkModalText.js | 5 +- src/support/check/checkNewWindow.js | 5 +- src/support/check/checkOffset.js | 5 +- src/support/check/checkProperty.js | 5 +- src/support/check/checkSelected.js | 5 +- src/support/check/checkTitle.js | 5 +- src/support/check/checkURL.js | 5 +- src/support/check/checkURLPath.js | 5 +- src/support/check/checkWithinViewport.js | 5 +- src/support/check/compareText.js | 5 +- src/support/check/isEnabled.js | 5 +- src/support/check/isExisting.js | 5 +- src/support/check/isVisible.js | 5 +- test/support/action/clearInputField.spec.js | 33 +-- test/support/action/clickElement.spec.js | 169 ++++++------ .../action/closeAllButFirstTab.spec.js | 50 ++-- .../action/closeLastOpenedWindow.spec.js | 62 ++--- test/support/action/deleteCookie.spec.js | 32 +-- test/support/action/dragElement.spec.js | 34 +-- .../action/focusLastOpenedWindow.spec.js | 56 ++-- test/support/action/handleModal.spec.js | 153 ++++------ test/support/action/moveToElement.spec.js | 109 +++----- test/support/action/openWebsite.spec.js | 73 ++--- test/support/action/pause.spec.js | 35 +-- test/support/action/pressButton.spec.js | 35 +-- test/support/action/resizeScreenSize.spec.js | 45 ++- test/support/action/scroll.spec.js | 35 +-- test/support/action/selectOption.spec.js | 151 +++++----- .../action/selectOptionByIndex.spec.js | 37 +-- test/support/action/setCookie.spec.js | 43 ++- test/support/action/setInputField.spec.js | 214 ++++++-------- test/support/action/setPromptText.spec.js | 88 +++--- test/support/action/submitForm.spec.js | 35 +-- test/support/action/waitFor.spec.js | 261 +++++++----------- test/support/action/waitForVisible.spec.js | 62 ++--- test/support/check/checkClass.spec.js | 219 +++++++-------- .../check/checkContainsAnyText.spec.js | 137 +++++---- test/support/check/checkContainsText.spec.js | 175 +++++------- test/support/check/checkCookieContent.spec.js | 145 +++++----- test/support/check/checkCookieExists.spec.js | 105 ++++--- test/support/check/checkDimension.spec.js | 153 +++++----- test/support/check/checkElementExists.spec.js | 113 ++++---- test/support/check/checkFocus.spec.js | 107 ++++--- test/support/check/checkInURLPath.spec.js | 115 ++++---- .../check/checkIsOpenedInNewWindow.spec.js | 177 ++++++------ test/support/check/checkModal.spec.js | 161 +++++------ test/support/check/checkModalText.spec.js | 141 +++++----- test/support/check/checkNewWindow.spec.js | 111 ++++---- test/support/check/checkOffset.spec.js | 124 ++++----- test/support/check/checkProperty.spec.js | 200 ++++++-------- test/support/check/checkSelected.spec.js | 119 ++++---- test/support/check/checkTitle.spec.js | 113 ++++---- test/support/check/checkURL.spec.js | 120 ++++---- test/support/check/checkURLPath.spec.js | 147 +++++----- .../support/check/checkWithinViewport.spec.js | 127 ++++----- test/support/check/compareText.spec.js | 115 ++++---- test/support/check/isEnabled.spec.js | 115 ++++---- test/support/check/isExisting.spec.js | 117 ++++---- test/support/check/isVisible.spec.js | 115 ++++---- wdio.conf.js | 63 +++-- 98 files changed, 2417 insertions(+), 3208 deletions(-) diff --git a/src/steps/given.js b/src/steps/given.js index 23cdf770..c03614c9 100644 --- a/src/steps/given.js +++ b/src/steps/given.js @@ -1,3 +1,5 @@ +import { defineSupportCode } from 'cucumber'; + import checkContainsAnyText from '../support/check/checkContainsAnyText'; import checkIsEmpty from '../support/check/checkIsEmpty'; import checkContainsText from '../support/check/checkContainsText'; @@ -19,109 +21,110 @@ import isVisible from '../support/check/isVisible'; import openWebsite from '../support/action/openWebsite'; import resizeScreenSize from '../support/action/resizeScreenSize'; -module.exports = function given() { - this.Given( + +defineSupportCode(({ Given }) => { + Given( /^I open the (url|site) "([^"]*)?"$/, openWebsite ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* visible$/, isVisible ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* enabled$/, isEnabled ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* selected$/, checkSelected ); - this.Given( + Given( /^the checkbox "([^"]*)?" is( not)* checked$/, checkSelected ); - this.Given( + Given( /^there is (an|no) element "([^"]*)?" on the page$/, checkElementExists ); - this.Given( + Given( /^the title is( not)* "([^"]*)?"$/, checkTitle ); - this.Given( + Given( /^the element "([^"]*)?" contains( not)* the same text as element "([^"]*)?"$/, compareText ); - this.Given( + Given( /^the element "([^"]*)?"( not)* matches the text "([^"]*)?"$/, checkEqualsText ); - this.Given( + Given( /^the element "([^"]*)?"( not)* contains the text "([^"]*)?"$/, checkContainsText ); - this.Given( + Given( /^the element "([^"]*)?"( not)* contains any text$/, checkContainsAnyText ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* empty$/, checkIsEmpty ); - this.Given( + Given( /^the page url is( not)* "([^"]*)?"$/, checkUrl ); - this.Given( + Given( /^the( css)* attribute "([^"]*)?" from element "([^"]*)?" is( not)* "([^"]*)?"$/, checkProperty ); - this.Given( + Given( /^the cookie "([^"]*)?" contains( not)* the value "([^"]*)?"$/, checkCookieContent ); - this.Given( + Given( /^the cookie "([^"]*)?" does( not)* exist$/, checkCookieExists ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* ([\d]+)px (broad|tall)$/, checkDimension ); - this.Given( + Given( /^the element "([^"]*)?" is( not)* positioned at ([\d]+)px on the (x|y) axis$/, checkOffset ); - this.Given( + Given( /^I have a screen that is ([\d]+) by ([\d]+) pixels$/, resizeScreenSize ); - this.Given( + Given( /^I have closed all but the first (window|tab)$/, closeAllButFirstTab ); - this.Given( + Given( /^a (alertbox|confirmbox|prompt) is( not)* opened$/, checkModal ); -}; +}); diff --git a/src/steps/then.js b/src/steps/then.js index 123d22d6..e1b63847 100644 --- a/src/steps/then.js +++ b/src/steps/then.js @@ -1,3 +1,5 @@ +import { defineSupportCode } from 'cucumber'; + import checkClass from '../support/check/checkClass'; import checkContainsAnyText from '../support/check/checkContainsAnyText'; import checkIsEmpty from '../support/check/checkIsEmpty'; @@ -27,144 +29,150 @@ import isVisible from '../support/check/isVisible'; import waitFor from '../support/action/waitFor'; import waitForVisible from '../support/action/waitForVisible'; -module.exports = function then() { - this.Then( + +defineSupportCode(({ Then }) => { + Then( /^I expect that the title is( not)* "([^"]*)?"$/, checkTitle ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* visible$/, isVisible ); - this.Then( + Then( /^I expect that element "([^"]*)?" becomes( not)* visible$/, waitForVisible ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* within the viewport$/, checkWithinViewport ); - this.Then( + Then( /^I expect that element "([^"]*)?" does( not)* exist$/, isExisting ); - this.Then( + Then( /^I expect that element "([^"]*)?"( not)* contains the same text as element "([^"]*)?"$/, compareText ); - this.Then( + Then( /^I expect that element "([^"]*)?"( not)* matches the text "([^"]*)?"$/, checkEqualsText ); - this.Then( + Then( /^I expect that element "([^"]*)?"( not)* contains the text "([^"]*)?"$/, checkContainsText ); - this.Then( + Then( /^I expect that element "([^"]*)?"( not)* contains any text$/, checkContainsAnyText ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* empty$/, checkIsEmpty ); - this.Then( + Then( /^I expect that the url is( not)* "([^"]*)?"$/, checkURL ); - this.Then( + Then( /^I expect that the path is( not)* "([^"]*)?"$/, checkURLPath ); - this.Then( + Then( /^I expect the url to( not)* contain "([^"]*)?"$/, checkInURLPath ); - this.Then( + Then( /^I expect that the( css)* attribute "([^"]*)?" from element "([^"]*)?" is( not)* "([^"]*)?"$/, checkProperty ); - this.Then( + Then( /^I expect that checkbox "([^"]*)?" is( not)* checked$/, checkSelected ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* selected$/, checkSelected ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* enabled$/, isEnabled ); - this.Then( + Then( /^I expect that cookie "([^"]*)?"( not)* contains "([^"]*)?"$/, checkCookieContent ); - this.Then( + Then( /^I expect that cookie "([^"]*)?"( not)* exists$/, checkCookieExists ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* ([\d]+)px (broad|tall)$/, checkDimension ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* positioned at ([\d]+)px on the (x|y) axis$/, checkOffset ); - this.Then( + Then( /^I expect that element "([^"]*)?" (has|does not have) the class "([^"]*)?"$/, checkClass ); - this.Then( + Then( /^I expect a new (window|tab) has( not)* been opened$/, checkNewWindow ); - this.Then( + Then( /^I expect the url "([^"]*)?" is opened in a new (tab|window)$/, checkIsOpenedInNewWindow ); - this.Then( + Then( /^I expect that element "([^"]*)?" is( not)* focused$/, checkFocus ); - this.Then( - /^I wait on element "([^"]*)?"( for (\d+)ms)*( to( not)* (be checked|be enabled|be selected|be visible|contain a text|contain a value|exist))*$/, + Then( + /^I wait on element "([^"]*)?"(?: for (\d+)ms)*(?: to( not)* (be checked|be enabled|be selected|be visible|contain a text|contain a value|exist))*$/, + { + wrapperOptions: { + retry: 3, + }, + }, waitFor ); - this.Then( + Then( /^I expect that a (alertbox|confirmbox|prompt) is( not)* opened$/, checkModal ); - this.Then( + Then( /^I expect that a (alertbox|confirmbox|prompt)( not)* contains the text "([^"]*)?"$/, checkModalText ); -}; +}); diff --git a/src/steps/when.js b/src/steps/when.js index 6ca4677d..22fa36fd 100644 --- a/src/steps/when.js +++ b/src/steps/when.js @@ -1,3 +1,5 @@ +import { defineSupportCode } from 'cucumber'; + import clearInputField from '../support/action/clearInputField'; import clickElement from '../support/action/clickElement'; import closeLastOpenedWindow from '../support/action/closeLastOpenedWindow'; @@ -16,89 +18,90 @@ import setInputField from '../support/action/setInputField'; import setPromptText from '../support/action/setPromptText'; import submitForm from '../support/action/submitForm'; -module.exports = function when() { - this.When( + +defineSupportCode(({ When }) => { + When( /^I (click|doubleclick) on the (link|button|element) "([^"]*)?"$/, clickElement ); - this.When( + When( /^I (add|set) "([^"]*)?" to the inputfield "([^"]*)?"$/, setInputField ); - this.When( + When( /^I clear the inputfield "([^"]*)?"$/, clearInputField ); - this.When( + When( /^I drag element "([^"]*)?" to element "([^"]*)?"$/, dragElement ); - this.When( + When( /^I submit the form "([^"]*)?"$/, submitForm ); - this.When( + When( /^I pause for (\d+)ms$/, pause ); - this.When( + When( /^I set a cookie "([^"]*)?" with the content "([^"]*)?"$/, setCookie ); - this.When( + When( /^I delete the cookie "([^"]*)?"$/, deleteCookie ); - this.When( + When( /^I press "([^"]*)?"$/, pressButton ); - this.When( + When( /^I (accept|dismiss) the (alertbox|confirmbox|prompt)$/, handleModal ); - this.When( + When( /^I enter "([^"]*)?" into the prompt$/, setPromptText ); - this.When( + When( /^I scroll to element "([^"]*)?"$/, scroll ); - this.When( + When( /^I close the last opened (window|tab)$/, closeLastOpenedWindow ); - this.When( + When( /^I focus the last opened (window|tab)$/, focusLastOpenedWindow ); - this.When( + When( /^I select the (\d+)(st|nd|rd|th) option for element "([^"]*)?"$/, selectOptionByIndex ); - this.When( + When( /^I select the option with the (name|value|text) "([^"]*)?" for element "([^"]*)?"$/, selectOption ); - this.When( - /^I move to element "([^"]*)?"( with an offset of (\d+),(\d+))*$/, + When( + /^I move to element "([^"]*)?"(?: with an offset of (\d+),(\d+))*$/, moveToElement ); -}; +}); diff --git a/src/support/action/clearInputField.js b/src/support/action/clearInputField.js index 408619e6..8c734f5a 100644 --- a/src/support/action/clearInputField.js +++ b/src/support/action/clearInputField.js @@ -1,10 +1,7 @@ /** - * Clear a given input field + * Clear a given input field (placeholder for WDIO's clearElement) * @param {String} element Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (element, done) => { +module.exports = (element) => { browser.clearElement(element); - - done(); }; diff --git a/src/support/action/clickElement.js b/src/support/action/clickElement.js index fd1656ea..cecfc147 100644 --- a/src/support/action/clickElement.js +++ b/src/support/action/clickElement.js @@ -5,9 +5,8 @@ import checkIfElementExists from '../lib/checkIfElementExists'; * @param {String} action The action to perform (click or doubleClick) * @param {String} type Type of the element (link or selector) * @param {String} element Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (action, type, element, done) => { +module.exports = (action, type, element) => { /** * Element to perform the action on * @type {String} @@ -23,6 +22,4 @@ module.exports = (action, type, element, done) => { checkIfElementExists(elem); browser[method](elem); - - done(); }; diff --git a/src/support/action/closeAllButFirstTab.js b/src/support/action/closeAllButFirstTab.js index edc6559c..147edab9 100644 --- a/src/support/action/closeAllButFirstTab.js +++ b/src/support/action/closeAllButFirstTab.js @@ -1,9 +1,10 @@ /** * Close all but the first tab * @param {String} obsolete Type of object to close (window or tab) - * @param {Function} done Function to execute when finished */ -module.exports = (obsolete, done) => { +/* eslint-disable no-unused-vars */ +module.exports = (obsolete) => { +/* eslint-enable no-unused-vars */ /** * Get all the window handles * @type {Object} @@ -16,6 +17,4 @@ module.exports = (obsolete, done) => { browser.switchTab(handle).close(); } }); - - done(); }; diff --git a/src/support/action/closeLastOpenedWindow.js b/src/support/action/closeLastOpenedWindow.js index 31774d7d..85baf3ca 100644 --- a/src/support/action/closeLastOpenedWindow.js +++ b/src/support/action/closeLastOpenedWindow.js @@ -1,9 +1,10 @@ /** * Close the last opened window - * @param {String} type Type of object to close (window or tab) - * @param {Function} done Function to execute when finished + * @param {String} obsolete Type of object to close (window or tab) */ -module.exports = (type, done) => { +/* eslint-disable no-unused-vars */ +module.exports = (obsolete) => { +/* eslint-enable no-unused-vars */ /** * The last opened window handle * @type {Object} @@ -11,7 +12,6 @@ module.exports = (type, done) => { const lastWindowHandle = browser.windowHandles().value.slice(-1)[0]; browser.window(lastWindowHandle); - browser.close(); - done(); + browser.close(); }; diff --git a/src/support/action/deleteCookie.js b/src/support/action/deleteCookie.js index f3b6df87..025dd7ca 100644 --- a/src/support/action/deleteCookie.js +++ b/src/support/action/deleteCookie.js @@ -1,10 +1,7 @@ /** * Delete a cookie * @param {String} name The name of the cookie to delete - * @param {Function} done Function to execute when finished */ -module.exports = (name, done) => { +module.exports = (name) => { browser.deleteCookie(name); - - done(); }; diff --git a/src/support/action/dragElement.js b/src/support/action/dragElement.js index 18f0ad31..6c5a8db5 100644 --- a/src/support/action/dragElement.js +++ b/src/support/action/dragElement.js @@ -2,10 +2,7 @@ * Drag a element to a given destination * @param {String} source The selector for the source element * @param {String} destination The selector for the destination element - * @param {Function} done Function to execute when finished */ -module.exports = (source, destination, done) => { +module.exports = (source, destination) => { browser.dragAndDrop(source, destination); - - done(); }; diff --git a/src/support/action/focusLastOpenedWindow.js b/src/support/action/focusLastOpenedWindow.js index 1422753e..a30ca92c 100644 --- a/src/support/action/focusLastOpenedWindow.js +++ b/src/support/action/focusLastOpenedWindow.js @@ -1,9 +1,10 @@ /** * Focus the last opened window - * @param {String} obsolete Type of object to close (window or tab) - * @param {Function} done Function to execute when finished + * @param {String} obsolete Type of object to focus to (window or tab) */ -module.exports = (obsolete, done) => { +/* eslint-disable no-unused-vars */ +module.exports = (obsolete) => { +/* eslint-enable no-unused-vars */ /** * The last opened window * @type {Object} @@ -11,6 +12,4 @@ module.exports = (obsolete, done) => { const lastWindowHandle = browser.windowHandles().value.slice(-1)[0]; browser.window(lastWindowHandle); - - done(); }; diff --git a/src/support/action/handleModal.js b/src/support/action/handleModal.js index 395a0268..f0281150 100644 --- a/src/support/action/handleModal.js +++ b/src/support/action/handleModal.js @@ -2,9 +2,8 @@ * Handle a modal * @param {String} action Action to perform on the modal (accept, dismiss) * @param {String} modalType Type of modal (alertbox, confirmbox, prompt) - * @param {Function} done Function to execute when finished */ -module.exports = (action, modalType, done) => { +module.exports = (action, modalType) => { /** * The command to perform on the browser object * @type {String} @@ -19,6 +18,4 @@ module.exports = (action, modalType, done) => { } browser[command](); - - done(); }; diff --git a/src/support/action/moveToElement.js b/src/support/action/moveToElement.js index 3f8a4d7b..cdf6fbd2 100644 --- a/src/support/action/moveToElement.js +++ b/src/support/action/moveToElement.js @@ -1,12 +1,10 @@ /** * Move to the given element with an optional offset on a X and Y position * @param {String} element Element selector - * @param {String} obsolete If we need to add an offset this is set * @param {String} x X coordinate to move to * @param {String} y Y coordinate to move to - * @param {Function} done Function to execute when finished */ -module.exports = (element, obsolete, x, y, done) => { +module.exports = (element, x, y) => { /** * X coordinate * @type {Int} @@ -20,6 +18,4 @@ module.exports = (element, obsolete, x, y, done) => { const intY = parseInt(y, 10) || undefined; browser.moveToObject(element, intX, intY); - - done(); }; diff --git a/src/support/action/openWebsite.js b/src/support/action/openWebsite.js index d3b932fc..4f614561 100644 --- a/src/support/action/openWebsite.js +++ b/src/support/action/openWebsite.js @@ -2,9 +2,8 @@ * Open the given URL * @param {String} type Type of navigation (url or site) * @param {String} page The URL to navigate to - * @param {Function} done Function to execute when finished */ -module.exports = (type, page, done) => { +module.exports = (type, page) => { /** * The URL to navigate to * @type {String} @@ -12,6 +11,4 @@ module.exports = (type, page, done) => { const url = (type === 'url') ? page : browser.options.baseUrl + page; browser.url(url); - - done(); }; diff --git a/src/support/action/pause.js b/src/support/action/pause.js index 1bce41b6..8636b4f8 100644 --- a/src/support/action/pause.js +++ b/src/support/action/pause.js @@ -1,9 +1,8 @@ /** * Pause execution for a given number of milliseconds * @param {String} ms Number of milliseconds to pause - * @param {Function} done Function to execute when finished */ -module.exports = (ms, done) => { +module.exports = (ms) => { /** * Number of milliseconds * @type {Int} @@ -11,6 +10,4 @@ module.exports = (ms, done) => { const intMs = parseInt(ms, 10); browser.pause(intMs); - - done(); }; diff --git a/src/support/action/pressButton.js b/src/support/action/pressButton.js index 46b7ac2f..b07cdda5 100644 --- a/src/support/action/pressButton.js +++ b/src/support/action/pressButton.js @@ -1,10 +1,7 @@ /** * Perform a key press * @param {String} key The key to press - * @param {Function} done Function to execute when finished */ -module.exports = (key, done) => { +module.exports = (key) => { browser.keys(key); - - done(); }; diff --git a/src/support/action/resizeScreenSize.js b/src/support/action/resizeScreenSize.js index 3a8a24f6..274cf1df 100644 --- a/src/support/action/resizeScreenSize.js +++ b/src/support/action/resizeScreenSize.js @@ -2,13 +2,10 @@ * Resize the browser window * @param {String} screenWidth The width of the window to resize to * @param {String} screenHeight The height of the window to resize to - * @param {Function} done Function to execute when finished */ -module.exports = (screenWidth, screenHeight, done) => { +module.exports = (screenWidth, screenHeight) => { browser.windowHandleSize({ width: parseInt(screenWidth, 10), height: parseInt(screenHeight, 10), }); - - done(); }; diff --git a/src/support/action/scroll.js b/src/support/action/scroll.js index 0cf0ede0..44d63c06 100644 --- a/src/support/action/scroll.js +++ b/src/support/action/scroll.js @@ -1,10 +1,7 @@ /** * Scroll the page to the given element * @param {String} selector Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (selector, done) => { +module.exports = (selector) => { browser.scroll(selector); - - done(); }; diff --git a/src/support/action/selectOption.js b/src/support/action/selectOption.js index f74a6bfe..ca0bf8f3 100644 --- a/src/support/action/selectOption.js +++ b/src/support/action/selectOption.js @@ -4,9 +4,8 @@ * text) * @param {String} selectionValue Value to select by * @param {String} selectElem Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (selectionType, selectionValue, selectElem, done) => { +module.exports = (selectionType, selectionValue, selectElem) => { /** * Arguments to pass to the selection method * @type {Array} @@ -29,7 +28,7 @@ module.exports = (selectionType, selectionValue, selectElem, done) => { let command = ''; switch (selectionType) { - case 'name' : { + case 'name': { command = 'selectByAttribute'; // The selectByAttribute command expects the attribute name as it @@ -39,12 +38,12 @@ module.exports = (selectionType, selectionValue, selectElem, done) => { break; } - case 'value' : { + case 'value': { command = 'selectByValue'; break; } - case 'text' : { + case 'text': { command = 'selectByVisibleText'; break; } @@ -55,6 +54,4 @@ module.exports = (selectionType, selectionValue, selectElem, done) => { } element[command].apply(this, commandArguments); - - done(); }; diff --git a/src/support/action/selectOptionByIndex.js b/src/support/action/selectOptionByIndex.js index 9b09fed6..a7853e54 100644 --- a/src/support/action/selectOptionByIndex.js +++ b/src/support/action/selectOptionByIndex.js @@ -3,11 +3,10 @@ * @param {String} index The index of the option * @param {String} obsolete The ordinal indicator of the index (unused) * @param {String} selectElem Element selector - * @param {Function} done Function to execute when finished * * @todo merge with selectOption */ -module.exports = (index, obsolete, selectElem, done) => { +module.exports = (index, obsolete, selectElem) => { /** * The index of the option to select * @type {Int} @@ -15,6 +14,4 @@ module.exports = (index, obsolete, selectElem, done) => { const optionIndex = parseInt(index, 10); browser.selectByIndex(selectElem, optionIndex); - - done(); }; diff --git a/src/support/action/setCookie.js b/src/support/action/setCookie.js index 42b683ca..9192893e 100644 --- a/src/support/action/setCookie.js +++ b/src/support/action/setCookie.js @@ -3,13 +3,10 @@ * be created * @param {String} cookieName The name of the cookie * @param {String} cookieContent The value of the cookie - * @param {Function} done Function to execute when finished */ -module.exports = (cookieName, cookieContent, done) => { +module.exports = (cookieName, cookieContent) => { browser.setCookie({ name: cookieName, value: cookieContent, }); - - done(); }; diff --git a/src/support/action/setInputField.js b/src/support/action/setInputField.js index 9577e901..8620b033 100644 --- a/src/support/action/setInputField.js +++ b/src/support/action/setInputField.js @@ -6,22 +6,21 @@ import checkIfElementExists from '../lib/checkIfElementExists'; * @param {String} method The method to use (add or set) * @param {String} value The value to set the element to * @param {String} element Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (method, value, element, done) => { +module.exports = (method, value, element) => { /** * The command to perform on the browser object (addValue or setValue) * @type {String} */ const command = (method === 'add') ? 'addValue' : 'setValue'; + let checkValue = value; + checkIfElementExists(element, false, 1); if (!value) { - browser[command](element, ''); - } else { - browser[command](element, value); + checkValue = ''; } - done(); + browser[command](element, checkValue); }; diff --git a/src/support/action/setPromptText.js b/src/support/action/setPromptText.js index 6cd223e4..35413633 100644 --- a/src/support/action/setPromptText.js +++ b/src/support/action/setPromptText.js @@ -1,14 +1,11 @@ /** * Set the text of the current prompt * @param {String} modalText The text to set to the prompt - * @param {Function} done Function to execute when finished */ -module.exports = (modalText, done) => { +module.exports = (modalText) => { try { browser.alertText(modalText); } catch (e) { assert(e, 'A prompt was not open when it should have been open'); } - - done(); }; diff --git a/src/support/action/submitForm.js b/src/support/action/submitForm.js index 8a6300e1..4b30d577 100644 --- a/src/support/action/submitForm.js +++ b/src/support/action/submitForm.js @@ -1,10 +1,7 @@ /** * Submit the given form * @param {String} form Form element selector - * @param {Function} done Function to execute when finished */ -module.exports = (form, done) => { +module.exports = (form) => { browser.submitForm(form); - - done(); }; diff --git a/src/support/action/waitFor.js b/src/support/action/waitFor.js index 99ac4e7d..3e715120 100644 --- a/src/support/action/waitFor.js +++ b/src/support/action/waitFor.js @@ -2,17 +2,13 @@ * Wait for the given element to be checked, enabled, selected, visible, contain * a text, contain a value or to exist * @param {String} elem Element selector - * @param {String} obsolete Duration prefix (unused) * @param {String} ms Wait duration (optional) - * @param {String} isWaitingOnSpecificState Wait for a specific state (else - * wait for existence) * @param {String} falseState Check for opposite state * @param {String} state State to check for (default * existence) - * @param {Function} done Function to execute when finished */ module.exports = -(elem, obsolete, ms, isWaitingOnSpecificState, falseState, state, done) => { +(elem, ms, falseState, state) => { /** * Maximum number of milliseconds to wait, default 3000 * @type {Int} @@ -37,7 +33,7 @@ module.exports = */ let parsedState = ''; - if (isWaitingOnSpecificState) { + if (falseState || state) { parsedState = state.indexOf(' ') > -1 ? state.split(/\s/)[state.split(/\s/).length - 1] : state; @@ -47,8 +43,10 @@ module.exports = parsedState = 'selected'; } - command = `waitFor${parsedState[0].toUpperCase()}` + - `${parsedState.slice(1)}`; + if (parsedState) { + command = `waitFor${parsedState[0].toUpperCase()}` + + `${parsedState.slice(1)}`; + } } if (typeof falseState === 'undefined') { @@ -56,6 +54,4 @@ module.exports = } browser[command](elem, intMs, boolFalseState); - - done(); }; diff --git a/src/support/action/waitForVisible.js b/src/support/action/waitForVisible.js index c7c515ba..d48d4911 100644 --- a/src/support/action/waitForVisible.js +++ b/src/support/action/waitForVisible.js @@ -3,11 +3,10 @@ * @param {String} elem Element selector * @param {String} falseCase Whether or not to expect a visible or hidden * state - * @param {Function} done Function to execute when finished * * @todo merge with waitfor */ -module.exports = (elem, falseCase, done) => { +module.exports = (elem, falseCase) => { /** * Maximum number of milliseconds to wait for * @type {Int} @@ -15,6 +14,4 @@ module.exports = (elem, falseCase, done) => { const ms = 10000; browser.waitForVisible(elem, ms, !!falseCase); - - done(); }; diff --git a/src/support/check/checkClass.js b/src/support/check/checkClass.js index 1baefb9b..9f4705f6 100644 --- a/src/support/check/checkClass.js +++ b/src/support/check/checkClass.js @@ -4,9 +4,8 @@ * @param {String} falseCase Whether to check for the class to exist * or not ('has', 'does not have') * @param {String} expectedClassName The class name to check - * @param {Function} done Function to execute when finished */ -module.exports = (elem, falseCase, expectedClassName, done) => { +module.exports = (elem, falseCase, expectedClassName) => { /** * List of all the classes of the element * @type {Array} @@ -26,6 +25,4 @@ module.exports = (elem, falseCase, expectedClassName, done) => { `Element ${elem} should have the class ${expectedClassName}` ); } - - done(); }; diff --git a/src/support/check/checkContainsAnyText.js b/src/support/check/checkContainsAnyText.js index 64bff4b5..e7cd4aa6 100644 --- a/src/support/check/checkContainsAnyText.js +++ b/src/support/check/checkContainsAnyText.js @@ -3,9 +3,8 @@ * @param {String} element Element selector * @param {String} falseCase Whether to check if the content contains text * or not - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { /** * The command to perform on the browser object * @type {String} @@ -16,12 +15,6 @@ module.exports = (element, falseCase, done) => { command = 'getText'; } - /** - * Callback to trigger when done - * @type {Function} - */ - let doneCallback = done; - /** * False case * @type {Boolean} @@ -34,8 +27,7 @@ module.exports = (element, falseCase, done) => { */ const text = browser[command](element); - if (typeof falseCase === 'function') { - doneCallback = falseCase; + if (typeof falseCase === 'undefined') { boolFalseCase = false; } else { boolFalseCase = !!falseCase; @@ -46,6 +38,4 @@ module.exports = (element, falseCase, done) => { } else { expect(text).to.not.equal(''); } - - doneCallback(); }; diff --git a/src/support/check/checkContainsText.js b/src/support/check/checkContainsText.js index ac454f79..e168de7c 100644 --- a/src/support/check/checkContainsText.js +++ b/src/support/check/checkContainsText.js @@ -4,9 +4,8 @@ * @param {String} falseCase Whether to check if the content contains * the given text or not * @param {String} expectedText The text to check against - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, expectedText, done) => { +module.exports = (element, falseCase, expectedText) => { /** * The command to perform on the browser object * @type {String} @@ -29,20 +28,13 @@ module.exports = (element, falseCase, expectedText, done) => { */ let stringExpectedText = expectedText; - /** - * Callback to trigger when done - * @type {Function} - */ - let doneCallback = done; - /** * The text of the element * @type {String} */ const text = browser[command](element); - if (typeof expectedText === 'function') { - doneCallback = expectedText; + if (typeof expectedText === 'undefined') { stringExpectedText = falseCase; boolFalseCase = false; } else { @@ -54,6 +46,4 @@ module.exports = (element, falseCase, expectedText, done) => { } else { expect(text).to.contain(stringExpectedText); } - - doneCallback(); }; diff --git a/src/support/check/checkCookieContent.js b/src/support/check/checkCookieContent.js index fa52192e..5b7303f7 100644 --- a/src/support/check/checkCookieContent.js +++ b/src/support/check/checkCookieContent.js @@ -4,9 +4,8 @@ * @param {String} falseCase Whether or not to check if the value matches * or not * @param {String} expectedValue The value to check against - * @param {Function} done Function to execute when finished */ -module.exports = (name, falseCase, expectedValue, done) => { +module.exports = (name, falseCase, expectedValue) => { /** * The cookie retrieved from the browser object * @type {Object} @@ -32,6 +31,4 @@ module.exports = (name, falseCase, expectedValue, done) => { ` but got "${cookie.value}"` ); } - - done(); }; diff --git a/src/support/check/checkCookieExists.js b/src/support/check/checkCookieExists.js index eb73dcc7..5b838570 100644 --- a/src/support/check/checkCookieExists.js +++ b/src/support/check/checkCookieExists.js @@ -3,9 +3,8 @@ * @param {[type]} name The name of the cookie * @param {[type]} falseCase Whether or not to check if the cookie exists or * not - * @param {Function} done Function to execute when finished */ -module.exports = (name, falseCase, done) => { +module.exports = (name, falseCase) => { /** * The cookie as retrieved from the browser * @type {Object} @@ -23,6 +22,4 @@ module.exports = (name, falseCase, done) => { `Expected cookie "${name}" to exists but it does not` ); } - - done(); }; diff --git a/src/support/check/checkDimension.js b/src/support/check/checkDimension.js index 46f83f13..7e1f802f 100644 --- a/src/support/check/checkDimension.js +++ b/src/support/check/checkDimension.js @@ -5,9 +5,8 @@ * not * @param {String} expectedSize Expected size * @param {String} dimension Dimension to check (broad or tall) - * @param {Function} done Function to execute when finished */ -module.exports = (elem, falseCase, expectedSize, dimension, done) => { +module.exports = (elem, falseCase, expectedSize, dimension) => { /** * The size of the given element * @type {Object} @@ -52,6 +51,4 @@ module.exports = (elem, falseCase, expectedSize, dimension, done) => { `${intExpectedSize}px, but is ${origionalSize}px` ); } - - done(); }; diff --git a/src/support/check/checkElementExists.js b/src/support/check/checkElementExists.js index 8fd05e55..e1874fc2 100644 --- a/src/support/check/checkElementExists.js +++ b/src/support/check/checkElementExists.js @@ -5,14 +5,17 @@ import checkIfElementExists from '../lib/checkIfElementExists'; * @param {String} isExisting Whether the element should be existing or not * (an or no) * @param {String} elem Element selector - * @param {Function} done Function to execute when finished */ -module.exports = (isExisting, elem, done) => { +module.exports = (isExisting, elem) => { + /** + * Falsecase assertion + * @type {Boolean} + */ + let falseCase = true; + if (isExisting === 'an') { - checkIfElementExists(elem); - } else { - checkIfElementExists(elem, true); + falseCase = false; } - done(); + checkIfElementExists(elem, falseCase); }; diff --git a/src/support/check/checkEqualsText.js b/src/support/check/checkEqualsText.js index 1ac953b8..e27d9cfb 100644 --- a/src/support/check/checkEqualsText.js +++ b/src/support/check/checkEqualsText.js @@ -4,9 +4,8 @@ * @param {String} falseCase Whether to check if the content equals the * given text or not * @param {String} expectedText The text to validate against - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, expectedText, done) => { +module.exports = (element, falseCase, expectedText) => { /** * The command to execute on the browser object * @type {String} @@ -17,12 +16,6 @@ module.exports = (element, falseCase, expectedText, done) => { command = 'getText'; } - /** - * Function to execute when finished - * @type {Function} - */ - let doneCallback = done; - /** * The expected text to validate against * @type {String} @@ -36,8 +29,7 @@ module.exports = (element, falseCase, expectedText, done) => { let boolFalseCase = !!falseCase; // Check for empty element - if (!doneCallback && typeof parsedExpectedText === 'function') { - doneCallback = parsedExpectedText; + if (typeof parsedExpectedText === 'function') { parsedExpectedText = ''; boolFalseCase = !boolFalseCase; @@ -55,6 +47,4 @@ module.exports = (element, falseCase, expectedText, done) => { } else { parsedExpectedText.should.equal(text); } - - doneCallback(); }; diff --git a/src/support/check/checkFocus.js b/src/support/check/checkFocus.js index fea2fe1f..0ea980dd 100644 --- a/src/support/check/checkFocus.js +++ b/src/support/check/checkFocus.js @@ -3,9 +3,8 @@ * @param {String} selector Element selector * @param {String} falseCase Whether to check if the given element has focus * or not - * @param {Function} done Function to execute when finished */ -module.exports = (selector, falseCase, done) => { +module.exports = (selector, falseCase) => { /** * Value of the hasFocus function for the given element * @type {Boolean} @@ -19,6 +18,4 @@ module.exports = (selector, falseCase, done) => { expect(hasFocus).to .equal(true, 'Expected element to be focused, but it is not'); } - - done(); }; diff --git a/src/support/check/checkInURLPath.js b/src/support/check/checkInURLPath.js index dd2ffd99..8f57f949 100644 --- a/src/support/check/checkInURLPath.js +++ b/src/support/check/checkInURLPath.js @@ -3,9 +3,8 @@ * @param {String} falseCase Whether to check if the given string is in * the URL path or not * @param {String} expectedUrlPart The string to check for - * @param {Function} done Function to execute when finished */ -module.exports = (falseCase, expectedUrlPart, done) => { +module.exports = (falseCase, expectedUrlPart) => { /** * The URL of the current browser window * @type {String} @@ -26,6 +25,4 @@ module.exports = (falseCase, expectedUrlPart, done) => { `Expected URL "${currentUrl}" to contain "${expectedUrlPart}"` ); } - - done(); }; diff --git a/src/support/check/checkIsEmpty.js b/src/support/check/checkIsEmpty.js index 99278713..a1cefd88 100644 --- a/src/support/check/checkIsEmpty.js +++ b/src/support/check/checkIsEmpty.js @@ -1,15 +1,13 @@ import checkContainsAnyText from './checkContainsAnyText'; -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { let newFalseCase = true; - let newDone = done; if (typeof falseCase === 'function') { - newDone = falseCase; newFalseCase = false; } else if (falseCase === ' not') { newFalseCase = false; } - return checkContainsAnyText(element, newFalseCase, newDone); + checkContainsAnyText(element, newFalseCase); }; diff --git a/src/support/check/checkIsOpenedInNewWindow.js b/src/support/check/checkIsOpenedInNewWindow.js index 5e298fe1..49fa7ee5 100644 --- a/src/support/check/checkIsOpenedInNewWindow.js +++ b/src/support/check/checkIsOpenedInNewWindow.js @@ -2,9 +2,10 @@ * Check if the given URL was opened in a new window * @param {String} expectedUrl The URL to check for * @param {String} obsolete Indicator for the type (window or tab) unused - * @param {Function} done Function to execute when finished */ -module.exports = (expectedUrl, obsolete, done) => { +/* eslint-disable no-unused-vars */ +module.exports = (expectedUrl, obsolete) => { +/* eslint-enable no-unused-vars */ /** * All the current window handles * @type {Object} @@ -32,6 +33,4 @@ module.exports = (expectedUrl, obsolete, done) => { .contain(expectedUrl, 'The popup has a incorrect url'); browser.close(); - - done(); }; diff --git a/src/support/check/checkModal.js b/src/support/check/checkModal.js index 0df52489..2ce8a153 100644 --- a/src/support/check/checkModal.js +++ b/src/support/check/checkModal.js @@ -3,9 +3,8 @@ * @param {String} modalType The type of modal that is expected (alertbox, * confirmbox or prompt) * @param {String} falseState Whether to check if the modal was opened or not - * @param {Function} done Function to execute when finished */ -module.exports = (modalType, falseState, done) => { +module.exports = (modalType, falseState) => { /** * The text of the prompt * @type {String} @@ -31,6 +30,4 @@ module.exports = (modalType, falseState, done) => { ); } } - - done(); }; diff --git a/src/support/check/checkModalText.js b/src/support/check/checkModalText.js index d7727433..975142a5 100644 --- a/src/support/check/checkModalText.js +++ b/src/support/check/checkModalText.js @@ -4,9 +4,8 @@ * (alertbox, confirmbox or prompt) * @param {String} falseState Whether to check if the text matches or not * @param {String} expectedText The text to check against - * @param {Function} done Function to execute when finished */ -module.exports = (modalType, falseState, expectedText, done) => { +module.exports = (modalType, falseState, expectedText) => { try { /** * The text of the current modal @@ -33,6 +32,4 @@ module.exports = (modalType, falseState, expectedText, done) => { `A ${modalType} was not opened when it should have been opened` ); } - - done(); }; diff --git a/src/support/check/checkNewWindow.js b/src/support/check/checkNewWindow.js index 4e6006a1..65d8624f 100644 --- a/src/support/check/checkNewWindow.js +++ b/src/support/check/checkNewWindow.js @@ -3,9 +3,8 @@ * @param {String} obsolete The type of opened object (window or tab) * @param {String} falseCase Whether to check if a new window/tab was opened * or not - * @param {Function} done Function to execute when finished */ -module.exports = (obsolete, falseCase, done) => { +module.exports = (obsolete, falseCase) => { /** * The handles of all open windows/tabs * @type {Object} @@ -19,6 +18,4 @@ module.exports = (obsolete, falseCase, done) => { expect(windowHandles.length).to.not .equal(1, 'A new window has been opened'); } - - done(); }; diff --git a/src/support/check/checkOffset.js b/src/support/check/checkOffset.js index 557f1ea3..812afb62 100644 --- a/src/support/check/checkOffset.js +++ b/src/support/check/checkOffset.js @@ -5,9 +5,8 @@ * or not * @param {String} expectedPosition The position to check against * @param {String} axis The axis to check on (x or y) - * @param {Function} done Function to execute when finished */ -module.exports = (elem, falseCase, expectedPosition, axis, done) => { +module.exports = (elem, falseCase, expectedPosition, axis) => { /** * Get the location of the element on the given axis * @type {[type]} @@ -36,6 +35,4 @@ module.exports = (elem, falseCase, expectedPosition, axis, done) => { `at ${location}px` ); } - - done(); }; diff --git a/src/support/check/checkProperty.js b/src/support/check/checkProperty.js index 5f73ae28..de960ea5 100644 --- a/src/support/check/checkProperty.js +++ b/src/support/check/checkProperty.js @@ -7,9 +7,8 @@ * @param {String} falseCase Whether to check if the value of the * attribute matches or not * @param {String} expectedValue The value to match against - * @param {Function} done Function to execute when finished */ -module.exports = (isCSS, attrName, elem, falseCase, expectedValue, done) => { +module.exports = (isCSS, attrName, elem, falseCase, expectedValue) => { /** * The command to use for fetching the expected value * @type {String} @@ -51,6 +50,4 @@ module.exports = (isCSS, attrName, elem, falseCase, expectedValue, done) => { `"${attributeValue}", but "${expectedValue}"` ); } - - done(); }; diff --git a/src/support/check/checkSelected.js b/src/support/check/checkSelected.js index 5242c3e5..733187a5 100644 --- a/src/support/check/checkSelected.js +++ b/src/support/check/checkSelected.js @@ -3,9 +3,8 @@ * @param {String} element Element selector * @param {String} falseCase Whether to check if the element is elected or * not - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { /** * The selected state * @type {Boolean} @@ -19,6 +18,4 @@ module.exports = (element, falseCase, done) => { expect(isSelected).to .equal(true, `"${element}" should be selected`); } - - done(); }; diff --git a/src/support/check/checkTitle.js b/src/support/check/checkTitle.js index 991786a9..f42047ea 100644 --- a/src/support/check/checkTitle.js +++ b/src/support/check/checkTitle.js @@ -3,9 +3,8 @@ * @param {Type} falseCase Whether to check if the title matches the * expected value or not * @param {Type} expectedTitle The expected title - * @param {Function} done Function to execute when finished */ -module.exports = (falseCase, expectedTitle, done) => { +module.exports = (falseCase, expectedTitle) => { /** * The title of the current browser window * @type {String} @@ -25,6 +24,4 @@ module.exports = (falseCase, expectedTitle, done) => { `Expected title to be "${expectedTitle}" but found "${title}"` ); } - - done(); }; diff --git a/src/support/check/checkURL.js b/src/support/check/checkURL.js index 920427a8..b4e9399c 100644 --- a/src/support/check/checkURL.js +++ b/src/support/check/checkURL.js @@ -3,9 +3,8 @@ * @param {String} falseCase Whether to check if the URL matches the * expected value or not * @param {String} expectedUrl The expected URL to check against - * @param {Function} done Function to execute when finished */ -module.exports = (falseCase, expectedUrl, done) => { +module.exports = (falseCase, expectedUrl) => { /** * The current browser window's URL * @type {String} @@ -23,6 +22,4 @@ module.exports = (falseCase, expectedUrl, done) => { `"${currentUrl}"` ); } - - done(); }; diff --git a/src/support/check/checkURLPath.js b/src/support/check/checkURLPath.js index 3cb944c2..b6b1066c 100644 --- a/src/support/check/checkURLPath.js +++ b/src/support/check/checkURLPath.js @@ -3,9 +3,8 @@ * @param {String} falseCase Whether to check if the path matches the * expected value or not * @param {String} expectedPath The expected path to match against - * @param {Function} done Function to execute when finished */ -module.exports = (falseCase, expectedPath, done) => { +module.exports = (falseCase, expectedPath) => { /** * The URL of the current browser window * @type {String} @@ -31,6 +30,4 @@ module.exports = (falseCase, expectedPath, done) => { `"${currentUrl}"` ); } - - done(); }; diff --git a/src/support/check/checkWithinViewport.js b/src/support/check/checkWithinViewport.js index 2f72b197..e7e352fc 100644 --- a/src/support/check/checkWithinViewport.js +++ b/src/support/check/checkWithinViewport.js @@ -3,9 +3,8 @@ * @param {String} element Element selector * @param {String} falseCase Whether to check if the element is visible * within the current viewport or not - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { /** * The state of visibility of the given element inside the viewport * @type {Boolean} @@ -25,6 +24,4 @@ module.exports = (element, falseCase, done) => { `Expected element "${element}" to be inside the viewport` ); } - - done(); }; diff --git a/src/support/check/compareText.js b/src/support/check/compareText.js index 1557a814..10ae6573 100644 --- a/src/support/check/compareText.js +++ b/src/support/check/compareText.js @@ -4,9 +4,8 @@ * @param {String} falseCase Whether to check if the contents of both * elements match or not * @param {String} element2 Element selector for the second element - * @param {Function} done Function to execute when finished */ -module.exports = (element1, falseCase, element2, done) => { +module.exports = (element1, falseCase, element2) => { /** * The text of the first element * @type {String} @@ -30,6 +29,4 @@ module.exports = (element1, falseCase, element2, done) => { `Expected text to be "${text1}" but found "${text2}"` ); } - - done(); }; diff --git a/src/support/check/isEnabled.js b/src/support/check/isEnabled.js index d038ed7f..add8a2b0 100644 --- a/src/support/check/isEnabled.js +++ b/src/support/check/isEnabled.js @@ -3,9 +3,8 @@ * @param {String} element Element selector * @param {String} falseCase Whether to check if the given element is enabled * or not - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { /** * The enabled state of the given element * @type {Boolean} @@ -19,6 +18,4 @@ module.exports = (element, falseCase, done) => { expect(isEnabled).to .equal(true, `Expected element "${element}" to be enabled`); } - - done(); }; diff --git a/src/support/check/isExisting.js b/src/support/check/isExisting.js index cc85f22f..40fc5f9d 100644 --- a/src/support/check/isExisting.js +++ b/src/support/check/isExisting.js @@ -2,9 +2,8 @@ * Check if the given element exists in the current DOM * @param {String} selector Element selector * @param {String} falseCase Whether to check if the element exists or not - * @param {Function} done Function to execute when finished */ -module.exports = (selector, falseCase, done) => { +module.exports = (selector, falseCase) => { /** * Elements found in the DOM * @type {Object} @@ -18,6 +17,4 @@ module.exports = (selector, falseCase, done) => { expect(elements).to.have.length .above(0, `Expected element "${selector}" to exist`); } - - done(); }; diff --git a/src/support/check/isVisible.js b/src/support/check/isVisible.js index 1e1bb713..b7d9cb33 100644 --- a/src/support/check/isVisible.js +++ b/src/support/check/isVisible.js @@ -2,9 +2,8 @@ * Check if the given element is (not) visible * @param {String} element Element selector * @param {String} falseCase Check for a visible or a hidden element - * @param {Function} done Function to execute when finished */ -module.exports = (element, falseCase, done) => { +module.exports = (element, falseCase) => { /** * Visible state of the give element * @type {String} @@ -18,6 +17,4 @@ module.exports = (element, falseCase, done) => { expect(isVisible).to .equal(true, `Expected element "${element}" to be visible`); } - - done(); }; diff --git a/test/support/action/clearInputField.spec.js b/test/support/action/clearInputField.spec.js index f0d832a7..dcde3ba6 100644 --- a/test/support/action/clearInputField.spec.js +++ b/test/support/action/clearInputField.spec.js @@ -1,26 +1,19 @@ import clearInputField from 'src/support/action/clearInputField'; -describe( - 'clearInputField', () => { - let element; - let done; +describe('clearInputField', () => { + let element; - beforeEach(() => { - global.browser = { - clearElement: jest.fn(), - }; + beforeEach(() => { + global.browser = { + clearElement: jest.fn(), + }; - element = 'element_selector'; + element = 'element_selector'; + }); - done = jest.fn(); - }); + it('should call clearElement on the browser', () => { + clearInputField(element); - it('should call clearElement on the browser', () => { - clearInputField(element, done); - - expect(browser.clearElement).toHaveBeenCalledWith(element); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); + expect(browser.clearElement).toHaveBeenCalledWith(element); + }); +}); diff --git a/test/support/action/clickElement.spec.js b/test/support/action/clickElement.spec.js index e4e030c3..db6f9b11 100644 --- a/test/support/action/clickElement.spec.js +++ b/test/support/action/clickElement.spec.js @@ -1,97 +1,84 @@ import clickElement from 'src/support/action/clickElement'; -describe( - 'clickElement', () => { - let done; - let expectToHaveLengthOf; - let expectToHaveLengthOfAtLeast; - - beforeEach(() => { - global.browser = { - click: jest.fn(), - doubleClick: jest.fn(), - elements: jest.fn(() => ({ - value: ['1'], - })).mockImplementationOnce(() => ({ - value: [], - })), - }; - - expectToHaveLengthOf = jest.fn(); - expectToHaveLengthOfAtLeast = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - have: { - length: { - of: { - at: { - least: expectToHaveLengthOfAtLeast, - }, +describe('clickElement', () => { + let expectToHaveLengthOf; + let expectToHaveLengthOfAtLeast; + + beforeEach(() => { + global.browser = { + click: jest.fn(), + doubleClick: jest.fn(), + elements: jest.fn(() => ({ + value: ['1'], + })).mockImplementationOnce(() => ({ + value: [], + })), + }; + + expectToHaveLengthOf = jest.fn(); + expectToHaveLengthOfAtLeast = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + have: { + length: { + of: { + at: { + least: expectToHaveLengthOfAtLeast, }, }, - lengthOf: expectToHaveLengthOf, }, + lengthOf: expectToHaveLengthOf, }, - })); - - done = jest.fn(); - }); - - it('should fail if the given element does not exist', () => { - clickElement('click', 'element', 'element0', done); - - _expect(browser.click).toHaveBeenCalledWith('element0'); - - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( - 1, - 'Element with selector "element0" should exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('should call click on the browser', () => { - clickElement('click', 'element', 'element1', done); - - _expect(browser.click).toHaveBeenCalledWith('element1'); - - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( - 1, - 'Element with selector "element1" should exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('should call doubleClick on the browser', () => { - clickElement('doubleClick', 'element', 'element2', done); - - _expect(browser.doubleClick).toHaveBeenCalledWith('element2'); - - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( - 1, - 'Element with selector "element2" should exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('should click a link when type is `link`', () => { - clickElement('click', 'link', 'element3', done); - - _expect(browser.click).toHaveBeenCalledWith('=element3'); - - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( - 1, - 'Element with selector "=element3" should exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + }, + })); + }); + + it('should fail if the given element does not exist', () => { + clickElement('click', 'element', 'element0'); + + _expect(browser.click).toHaveBeenCalledWith('element0'); + + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( + 1, + 'Element with selector "element0" should exist on the page' + ); + }); + + it('should call click on the browser', () => { + clickElement('click', 'element', 'element1'); + + _expect(browser.click).toHaveBeenCalledWith('element1'); + + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( + 1, + 'Element with selector "element1" should exist on the page' + ); + }); + + it('should call doubleClick on the browser', () => { + clickElement('doubleClick', 'element', 'element2'); + + _expect(browser.doubleClick).toHaveBeenCalledWith('element2'); + + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( + 1, + 'Element with selector "element2" should exist on the page' + ); + }); + + it('should click a link when type is `link`', () => { + clickElement('click', 'link', 'element3'); + + _expect(browser.click).toHaveBeenCalledWith('=element3'); + + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( + 1, + 'Element with selector "=element3" should exist on the page' + ); + }); +}); diff --git a/test/support/action/closeAllButFirstTab.spec.js b/test/support/action/closeAllButFirstTab.spec.js index 06b9bd61..b0972c92 100644 --- a/test/support/action/closeAllButFirstTab.spec.js +++ b/test/support/action/closeAllButFirstTab.spec.js @@ -1,34 +1,26 @@ import closeAllButFirstTab from 'src/support/action/closeAllButFirstTab'; -describe( - 'closeAllButFirstTab', () => { - let done; +describe('closeAllButFirstTab', () => { + beforeEach(() => { + global.browser = { + windowHandles: jest.fn(() => ({ + value: [ + 'one', + 'two', + 'three', + ], + })), + switchTab: jest.fn(() => ({ + close() {}, + })), + }; + }); - beforeEach(() => { - global.browser = { - windowHandles: jest.fn(() => ({ - value: [ - 'one', - 'two', - 'three', - ], - })), - switchTab: jest.fn(() => ({ - close() {}, - })), - }; + it('should call closeAllButFirstTab on the browser', () => { + closeAllButFirstTab(''); - done = jest.fn(); - }); + expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - it('should call closeAllButFirstTab on the browser', () => { - closeAllButFirstTab('', done); - - expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - - expect(global.browser.switchTab).toHaveBeenCalledTimes(2); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); + expect(global.browser.switchTab).toHaveBeenCalledTimes(2); + }); +}); diff --git a/test/support/action/closeLastOpenedWindow.spec.js b/test/support/action/closeLastOpenedWindow.spec.js index 8e6d2aed..5e5e95c1 100644 --- a/test/support/action/closeLastOpenedWindow.spec.js +++ b/test/support/action/closeLastOpenedWindow.spec.js @@ -1,37 +1,29 @@ import closeLastOpenedWindow from 'src/support/action/closeLastOpenedWindow'; -describe( - 'closeLastOpenedWindow', () => { - let done; - - beforeEach(() => { - global.browser = { - windowHandles: jest.fn(() => ({ - value: [ - 'one', - 'two', - 'three', - ], - })), - window: jest.fn(), - close: jest.fn(), - }; - - done = jest.fn(); - }); - - it('should call closeLastOpenedWindow on the browser', () => { - closeLastOpenedWindow('', done); - - expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - - expect(global.browser.window).toHaveBeenCalledTimes(1); - - expect(global.browser.window).toHaveBeenCalledWith('three'); - - expect(global.browser.close).toHaveBeenCalledTimes(1); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); +describe('closeLastOpenedWindow', () => { + beforeEach(() => { + global.browser = { + windowHandles: jest.fn(() => ({ + value: [ + 'one', + 'two', + 'three', + ], + })), + window: jest.fn(), + close: jest.fn(), + }; + }); + + it('should call closeLastOpenedWindow on the browser', () => { + closeLastOpenedWindow(''); + + expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + + expect(global.browser.window).toHaveBeenCalledTimes(1); + + expect(global.browser.window).toHaveBeenCalledWith('three'); + + expect(global.browser.close).toHaveBeenCalledTimes(1); + }); +}); diff --git a/test/support/action/deleteCookie.spec.js b/test/support/action/deleteCookie.spec.js index 6b046a82..c1390315 100644 --- a/test/support/action/deleteCookie.spec.js +++ b/test/support/action/deleteCookie.spec.js @@ -1,25 +1,17 @@ import deleteCookie from 'src/support/action/deleteCookie'; -describe( - 'deleteCookie', () => { - let done; +describe('deleteCookie', () => { + beforeEach(() => { + global.browser = { + deleteCookie: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - deleteCookie: jest.fn(), - }; + it('should call deleteCookie on the browser', () => { + deleteCookie('test'); - done = jest.fn(); - }); + expect(global.browser.deleteCookie).toHaveBeenCalledTimes(1); - it('should call deleteCookie on the browser', () => { - deleteCookie('test', done); - - expect(global.browser.deleteCookie).toHaveBeenCalledTimes(1); - - expect(global.browser.deleteCookie).toHaveBeenCalledWith('test'); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); + expect(global.browser.deleteCookie).toHaveBeenCalledWith('test'); + }); +}); diff --git a/test/support/action/dragElement.spec.js b/test/support/action/dragElement.spec.js index aa38b2f9..e2644699 100644 --- a/test/support/action/dragElement.spec.js +++ b/test/support/action/dragElement.spec.js @@ -1,26 +1,18 @@ import dragElement from 'src/support/action/dragElement'; -describe( - 'dragElement', () => { - let done; +describe('dragElement', () => { + beforeEach(() => { + global.browser = { + dragAndDrop: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - dragAndDrop: jest.fn(), - }; + it('should call dragAndDrop on the browser', () => { + dragElement('source', 'destination'); - done = jest.fn(); - }); + expect(global.browser.dragAndDrop).toHaveBeenCalledTimes(1); - it('should call dragAndDrop on the browser', () => { - dragElement('source', 'destination', done); - - expect(global.browser.dragAndDrop).toHaveBeenCalledTimes(1); - - expect(global.browser.dragAndDrop) - .toHaveBeenCalledWith('source', 'destination'); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); + expect(global.browser.dragAndDrop) + .toHaveBeenCalledWith('source', 'destination'); + }); +}); diff --git a/test/support/action/focusLastOpenedWindow.spec.js b/test/support/action/focusLastOpenedWindow.spec.js index d5e46d10..274ee258 100644 --- a/test/support/action/focusLastOpenedWindow.spec.js +++ b/test/support/action/focusLastOpenedWindow.spec.js @@ -1,34 +1,26 @@ import focusLastOpenedWindow from 'src/support/action/focusLastOpenedWindow'; -describe( - 'focusLastOpenedWindow', () => { - let done; - - beforeEach(() => { - global.browser = { - windowHandles: jest.fn(() => ({ - value: [ - 'one', - 'two', - 'three', - ], - })), - window: jest.fn(), - }; - - done = jest.fn(); - }); - - it('should call focusLastOpenedWindow on the browser', () => { - focusLastOpenedWindow('', done); - - expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - - expect(global.browser.window).toHaveBeenCalledTimes(1); - - expect(global.browser.window).toHaveBeenCalledWith('three'); - - expect(done).toHaveBeenCalledTimes(1); - }); - } -); +describe('focusLastOpenedWindow', () => { + beforeEach(() => { + global.browser = { + windowHandles: jest.fn(() => ({ + value: [ + 'one', + 'two', + 'three', + ], + })), + window: jest.fn(), + }; + }); + + it('should call focusLastOpenedWindow on the browser', () => { + focusLastOpenedWindow(''); + + expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + + expect(global.browser.window).toHaveBeenCalledTimes(1); + + expect(global.browser.window).toHaveBeenCalledWith('three'); + }); +}); diff --git a/test/support/action/handleModal.spec.js b/test/support/action/handleModal.spec.js index 0ec0cf98..f96e646f 100644 --- a/test/support/action/handleModal.spec.js +++ b/test/support/action/handleModal.spec.js @@ -1,95 +1,62 @@ import handleModal from 'src/support/action/handleModal'; -describe( - 'handleModal', () => { - let done; - - beforeEach(() => { - global.browser = { - alertAccept: jest.fn(), - alertDismiss: jest.fn(), - alertText: jest.fn(), - }; - - done = jest.fn(); - }); - - it( - 'should call alertAccept on the browser to close a alertbox', - () => { - handleModal('accept', 'alertbox', done); - - expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); - expect(global.browser.alertDismiss).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call alertAccept on the browser to close a confirmbox', - () => { - handleModal('accept', 'confirmbox', done); - - expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); - expect(global.browser.alertDismiss).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call alertAccept on the browser to close a prompt', - () => { - handleModal('accept', 'prompt', done); - - expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); - expect(global.browser.alertDismiss).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call alertAccept on the browser to dismiss a alertbox', - () => { - handleModal('dismiss', 'alertbox', done); - - expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); - expect(global.browser.alertDismiss).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call alertDismiss on the browser to dismiss a confirmbox', - () => { - handleModal('dismiss', 'confirmbox', done); - - expect(global.browser.alertDismiss).toHaveBeenCalledTimes(1); - expect(global.browser.alertAccept).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call alertDismiss on the browser to dismiss a prompt', - () => { - handleModal('dismiss', 'prompt', done); - - expect(global.browser.alertDismiss).toHaveBeenCalledTimes(1); - expect(global.browser.alertAccept).not.toHaveBeenCalled(); - expect(global.browser.alertText).not.toHaveBeenCalled(); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); +describe('handleModal', () => { + beforeEach(() => { + global.browser = { + alertAccept: jest.fn(), + alertDismiss: jest.fn(), + alertText: jest.fn(), + }; + }); + + it('should call alertAccept on the browser to close a alertbox', () => { + handleModal('accept', 'alertbox'); + + expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); + expect(global.browser.alertDismiss).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + }); + + it('should call alertAccept on the browser to close a confirmbox', () => { + handleModal('accept', 'confirmbox'); + + expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); + expect(global.browser.alertDismiss).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + }); + + it('should call alertAccept on the browser to close a prompt', () => { + handleModal('accept', 'prompt'); + + expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); + expect(global.browser.alertDismiss).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + }); + + it('should call alertAccept on the browser to dismiss a alertbox', () => { + handleModal('dismiss', 'alertbox'); + + expect(global.browser.alertAccept).toHaveBeenCalledTimes(1); + expect(global.browser.alertDismiss).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + }); + + it( + 'should call alertDismiss on the browser to dismiss a confirmbox', + () => { + handleModal('dismiss', 'confirmbox'); + + expect(global.browser.alertDismiss).toHaveBeenCalledTimes(1); + expect(global.browser.alertAccept).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + } + ); + + it('should call alertDismiss on the browser to dismiss a prompt', () => { + handleModal('dismiss', 'prompt'); + + expect(global.browser.alertDismiss).toHaveBeenCalledTimes(1); + expect(global.browser.alertAccept).not.toHaveBeenCalled(); + expect(global.browser.alertText).not.toHaveBeenCalled(); + }); +}); diff --git a/test/support/action/moveToElement.spec.js b/test/support/action/moveToElement.spec.js index 04117297..ae45d8e7 100644 --- a/test/support/action/moveToElement.spec.js +++ b/test/support/action/moveToElement.spec.js @@ -1,68 +1,45 @@ import moveToElement from 'src/support/action/moveToElement'; -describe( - 'moveToElement', () => { - let done; - - beforeEach(() => { - global.browser = { - moveToObject: jest.fn(), - }; - - done = jest.fn(); - }); - - it( - 'should call moveToObject with only the element when no x and y ' + - 'are provided', - () => { - moveToElement('element', '', undefined, undefined, done); - - expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); - expect(global.browser.moveToObject) - .toHaveBeenCalledWith('element', undefined, undefined); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call moveToObject with x when provided as int', - () => { - moveToElement('element', '', 1, undefined, done); - - expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); - expect(global.browser.moveToObject) - .toHaveBeenCalledWith('element', 1, undefined); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call moveToObject with y when provided as int', - () => { - moveToElement('element', '', undefined, 1, done); - - expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); - expect(global.browser.moveToObject) - .toHaveBeenCalledWith('element', undefined, 1); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call moveToObject with x and y when provided as int', - () => { - moveToElement('element', '', 1, 2, done); - - expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); - expect(global.browser.moveToObject) - .toHaveBeenCalledWith('element', 1, 2); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); +describe('moveToElement', () => { + beforeEach(() => { + global.browser = { + moveToObject: jest.fn(), + }; + }); + + it( + 'should call moveToObject with only the element when no x and y ' + + 'are provided', + () => { + moveToElement('element', undefined, undefined); + + expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); + expect(global.browser.moveToObject) + .toHaveBeenCalledWith('element', undefined, undefined); + } + ); + + it('should call moveToObject with x when provided as int', () => { + moveToElement('element', 1, undefined); + + expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); + expect(global.browser.moveToObject) + .toHaveBeenCalledWith('element', 1, undefined); + }); + + it('should call moveToObject with y when provided as int', () => { + moveToElement('element', undefined, 1); + + expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); + expect(global.browser.moveToObject) + .toHaveBeenCalledWith('element', undefined, 1); + }); + + it('should call moveToObject with x and y when provided as int', () => { + moveToElement('element', 1, 2); + + expect(global.browser.moveToObject).toHaveBeenCalledTimes(1); + expect(global.browser.moveToObject) + .toHaveBeenCalledWith('element', 1, 2); + }); +}); diff --git a/test/support/action/openWebsite.spec.js b/test/support/action/openWebsite.spec.js index c8a071ba..5bf1af4d 100644 --- a/test/support/action/openWebsite.spec.js +++ b/test/support/action/openWebsite.spec.js @@ -1,45 +1,32 @@ import openWebsite from 'src/support/action/openWebsite'; -describe( - 'openWebsite', () => { - let done; - - beforeEach(() => { - global.browser = { - url: jest.fn(), - options: { - baseUrl: 'http://mysite.com', - }, - }; - - done = jest.fn(); - }); - - it( - 'should call url with the given url if the first param is `url`', - () => { - openWebsite('url', 'http://example.com', done); - - expect(global.browser.url).toHaveBeenCalledTimes(1); - expect(global.browser.url) - .toHaveBeenCalledWith('http://example.com'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call url with the given path on the baseUrl if the first ' + - 'param is `site`', - () => { - openWebsite('site', '/path/to/page', done); - - expect(global.browser.url).toHaveBeenCalledTimes(1); - expect(global.browser.url) - .toHaveBeenCalledWith('http://mysite.com/path/to/page'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); +describe('openWebsite', () => { + beforeEach(() => { + global.browser = { + url: jest.fn(), + options: { + baseUrl: 'http://mysite.com', + }, + }; + }); + + it('should call url with the given url if the first param is `url`', () => { + openWebsite('url', 'http://example.com'); + + expect(global.browser.url).toHaveBeenCalledTimes(1); + expect(global.browser.url) + .toHaveBeenCalledWith('http://example.com'); + }); + + it( + 'should call url with the given path on the baseUrl if the first ' + + 'param is `site`', + () => { + openWebsite('site', '/path/to/page'); + + expect(global.browser.url).toHaveBeenCalledTimes(1); + expect(global.browser.url) + .toHaveBeenCalledWith('http://mysite.com/path/to/page'); + } + ); +}); diff --git a/test/support/action/pause.spec.js b/test/support/action/pause.spec.js index b3b3fc66..f1103694 100644 --- a/test/support/action/pause.spec.js +++ b/test/support/action/pause.spec.js @@ -1,27 +1,16 @@ import pause from 'src/support/action/pause'; -describe( - 'pause', () => { - let done; +describe('pause', () => { + beforeEach(() => { + global.browser = { + pause: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - pause: jest.fn(), - }; + it('should call pause on the browser object', () => { + pause(1000); - done = jest.fn(); - }); - - it( - 'should call pause on the browser object', - () => { - pause(1000, done); - - expect(global.browser.pause).toHaveBeenCalledTimes(1); - expect(global.browser.pause).toHaveBeenCalledWith(1000); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.pause).toHaveBeenCalledTimes(1); + expect(global.browser.pause).toHaveBeenCalledWith(1000); + }); +}); diff --git a/test/support/action/pressButton.spec.js b/test/support/action/pressButton.spec.js index 33e85daf..1f16a028 100644 --- a/test/support/action/pressButton.spec.js +++ b/test/support/action/pressButton.spec.js @@ -1,27 +1,16 @@ import pressButton from 'src/support/action/pressButton'; -describe( - 'pressButton', () => { - let done; +describe('pressButton', () => { + beforeEach(() => { + global.browser = { + keys: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - keys: jest.fn(), - }; + it('should call keys on the browser object', () => { + pressButton('e'); - done = jest.fn(); - }); - - it( - 'should call keys on the browser object', - () => { - pressButton('e', done); - - expect(global.browser.keys).toHaveBeenCalledTimes(1); - expect(global.browser.keys).toHaveBeenCalledWith('e'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.keys).toHaveBeenCalledTimes(1); + expect(global.browser.keys).toHaveBeenCalledWith('e'); + }); +}); diff --git a/test/support/action/resizeScreenSize.spec.js b/test/support/action/resizeScreenSize.spec.js index 945b6a02..853a8a01 100644 --- a/test/support/action/resizeScreenSize.spec.js +++ b/test/support/action/resizeScreenSize.spec.js @@ -1,32 +1,21 @@ import resizeScreenSize from 'src/support/action/resizeScreenSize'; -describe( - 'resizeScreenSize', () => { - let done; +describe('resizeScreenSize', () => { + beforeEach(() => { + global.browser = { + windowHandleSize: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - windowHandleSize: jest.fn(), - }; + it('should call windowHandleSize on the browser object', () => { + resizeScreenSize(1, 2); - done = jest.fn(); - }); - - it( - 'should call windowHandleSize on the browser object', - () => { - resizeScreenSize(1, 2, done); - - expect(global.browser.windowHandleSize) - .toHaveBeenCalledTimes(1); - expect(global.browser.windowHandleSize) - .toHaveBeenCalledWith({ - width: 1, - height: 2, - }); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.windowHandleSize) + .toHaveBeenCalledTimes(1); + expect(global.browser.windowHandleSize) + .toHaveBeenCalledWith({ + width: 1, + height: 2, + }); + }); +}); diff --git a/test/support/action/scroll.spec.js b/test/support/action/scroll.spec.js index c1d76f41..1d6c7eb2 100644 --- a/test/support/action/scroll.spec.js +++ b/test/support/action/scroll.spec.js @@ -1,27 +1,16 @@ import scroll from 'src/support/action/scroll'; -describe( - 'scroll', () => { - let done; +describe('scroll', () => { + beforeEach(() => { + global.browser = { + scroll: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - scroll: jest.fn(), - }; + it('should call scroll on the browser object', () => { + scroll('element'); - done = jest.fn(); - }); - - it( - 'should call scroll on the browser object', - () => { - scroll('element', done); - - expect(global.browser.scroll).toHaveBeenCalledTimes(1); - expect(global.browser.scroll).toHaveBeenCalledWith('element'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.scroll).toHaveBeenCalledTimes(1); + expect(global.browser.scroll).toHaveBeenCalledWith('element'); + }); +}); diff --git a/test/support/action/selectOption.spec.js b/test/support/action/selectOption.spec.js index 2d8f9260..f39bbab3 100644 --- a/test/support/action/selectOption.spec.js +++ b/test/support/action/selectOption.spec.js @@ -1,91 +1,64 @@ import selectOption from 'src/support/action/selectOption'; -describe( - 'selectOption', () => { - let done; - let selectByAttribute; - let selectByValue; - let selectByVisibleText; - - beforeEach(() => { - selectByAttribute = jest.fn(); - selectByValue = jest.fn(); - selectByVisibleText = jest.fn(); - - global.browser = { - element: jest.fn(() => ({ - selectByAttribute, - selectByValue, - selectByVisibleText, - })), - }; - - done = jest.fn(); - }); - - it( - 'should call selectByAttribute on the browser object', - () => { - selectOption('name', 'option1', 'element1', done); - - expect(global.browser.element).toHaveBeenCalledTimes(1); - expect(global.browser.element).toHaveBeenCalledWith('element1'); - - expect(selectByAttribute).toHaveBeenCalledTimes(1); - expect(selectByAttribute) - .toHaveBeenCalledWith('element1', 'name', 'option1'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call selectByValue on the browser object', - () => { - selectOption('value', 'value1', 'element2', done); - - expect(global.browser.element).toHaveBeenCalledTimes(1); - expect(global.browser.element).toHaveBeenCalledWith('element2'); - - expect(selectByValue).toHaveBeenCalledTimes(1); - expect(selectByValue) - .toHaveBeenCalledWith('element2', 'value1'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call selectByVisibleText on the browser object', - () => { - selectOption('text', 'text1', 'element3', done); - - expect(global.browser.element).toHaveBeenCalledTimes(1); - expect(global.browser.element).toHaveBeenCalledWith('element3'); - - expect(selectByVisibleText).toHaveBeenCalledTimes(1); - expect(selectByVisibleText) - .toHaveBeenCalledWith('element3', 'text1'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should throw an error when an unknown selection type is passed', - () => { - const spySelectOption = jest.fn(selectOption); - - expect( - spySelectOption - .bind(null, 'test', 'option1', 'element1', done) - ).toThrow(); - - expect(global.browser.element).toHaveBeenCalledTimes(1); - expect(global.browser.element).toHaveBeenCalledWith('element1'); - - expect(done).not.toHaveBeenCalled(); - } - ); - } -); +describe('selectOption', () => { + let selectByAttribute; + let selectByValue; + let selectByVisibleText; + + beforeEach(() => { + selectByAttribute = jest.fn(); + selectByValue = jest.fn(); + selectByVisibleText = jest.fn(); + + global.browser = { + element: jest.fn(() => ({ + selectByAttribute, + selectByValue, + selectByVisibleText, + })), + }; + }); + + it('should call selectByAttribute on the browser object', () => { + selectOption('name', 'option1', 'element1'); + + expect(global.browser.element).toHaveBeenCalledTimes(1); + expect(global.browser.element).toHaveBeenCalledWith('element1'); + + expect(selectByAttribute).toHaveBeenCalledTimes(1); + expect(selectByAttribute) + .toHaveBeenCalledWith('element1', 'name', 'option1'); + }); + + it('should call selectByValue on the browser object', () => { + selectOption('value', 'value1', 'element2'); + + expect(global.browser.element).toHaveBeenCalledTimes(1); + expect(global.browser.element).toHaveBeenCalledWith('element2'); + + expect(selectByValue).toHaveBeenCalledTimes(1); + expect(selectByValue) + .toHaveBeenCalledWith('element2', 'value1'); + }); + + it('should call selectByVisibleText on the browser object', () => { + selectOption('text', 'text1', 'element3'); + + expect(global.browser.element).toHaveBeenCalledTimes(1); + expect(global.browser.element).toHaveBeenCalledWith('element3'); + + expect(selectByVisibleText).toHaveBeenCalledTimes(1); + expect(selectByVisibleText) + .toHaveBeenCalledWith('element3', 'text1'); + }); + + it('should throw an error when an unknown selection type is passed', () => { + const spySelectOption = jest.fn(selectOption); + + expect(spySelectOption.bind(null, 'test', 'option1', 'element1')) + .toThrow(); + + expect(global.browser.element).toHaveBeenCalledTimes(1); + expect(global.browser.element).toHaveBeenCalledWith('element1'); + }); +}); diff --git a/test/support/action/selectOptionByIndex.spec.js b/test/support/action/selectOptionByIndex.spec.js index 3a320aa2..08815cb3 100644 --- a/test/support/action/selectOptionByIndex.spec.js +++ b/test/support/action/selectOptionByIndex.spec.js @@ -1,28 +1,17 @@ import selectOptionByIndex from 'src/support/action/selectOptionByIndex'; -describe( - 'selectOptionByIndex', () => { - let done; +describe('selectOptionByIndex', () => { + beforeEach(() => { + global.browser = { + selectByIndex: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - selectByIndex: jest.fn(), - }; + it('should call selectByIndex on the browser object', () => { + selectOptionByIndex(1, '', 'element'); - done = jest.fn(); - }); - - it( - 'should call selectByIndex on the browser object', - () => { - selectOptionByIndex(1, '', 'element', done); - - expect(global.browser.selectByIndex).toHaveBeenCalledTimes(1); - expect(global.browser.selectByIndex) - .toHaveBeenCalledWith('element', 1); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.selectByIndex).toHaveBeenCalledTimes(1); + expect(global.browser.selectByIndex) + .toHaveBeenCalledWith('element', 1); + }); +}); diff --git a/test/support/action/setCookie.spec.js b/test/support/action/setCookie.spec.js index c22d958b..ff4668dd 100644 --- a/test/support/action/setCookie.spec.js +++ b/test/support/action/setCookie.spec.js @@ -1,31 +1,20 @@ import setCookie from 'src/support/action/setCookie'; -describe( - 'setCookie', () => { - let done; +describe('setCookie', () => { + beforeEach(() => { + global.browser = { + setCookie: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - setCookie: jest.fn(), - }; + it('should call setCookie on the browser object', () => { + setCookie('cookieName', 'cookieContent'); - done = jest.fn(); - }); - - it( - 'should call setCookie on the browser object', - () => { - setCookie('cookieName', 'cookieContent', done); - - expect(global.browser.setCookie).toHaveBeenCalledTimes(1); - expect(global.browser.setCookie) - .toHaveBeenCalledWith({ - name: 'cookieName', - value: 'cookieContent', - }); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.setCookie).toHaveBeenCalledTimes(1); + expect(global.browser.setCookie) + .toHaveBeenCalledWith({ + name: 'cookieName', + value: 'cookieContent', + }); + }); +}); diff --git a/test/support/action/setInputField.spec.js b/test/support/action/setInputField.spec.js index 6379d5e0..74c40dcf 100644 --- a/test/support/action/setInputField.spec.js +++ b/test/support/action/setInputField.spec.js @@ -1,153 +1,123 @@ import setInputField from 'src/support/action/setInputField'; -describe( - 'setInputField', () => { - let expectToHaveLengthOf; - let expectToHaveLengthOfAtLeast; - let done; - - beforeEach(() => { - global.browser = { - addValue: jest.fn(), - setValue: jest.fn(), - elements: jest.fn(() => ({ - value: ['1'], - })).mockImplementationOnce(() => ({ - value: [], - })).mockImplementationOnce(() => ({ - value: ['1', '2'], - })), - }; - - expectToHaveLengthOf = jest.fn(); - expectToHaveLengthOfAtLeast = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - have: { - length: { - of: { - at: { - least: expectToHaveLengthOfAtLeast, - }, +describe('setInputField', () => { + let expectToHaveLengthOf; + let expectToHaveLengthOfAtLeast; + + beforeEach(() => { + global.browser = { + addValue: jest.fn(), + setValue: jest.fn(), + elements: jest.fn(() => ({ + value: ['1'], + })).mockImplementationOnce(() => ({ + value: [], + })).mockImplementationOnce(() => ({ + value: ['1', '2'], + })), + }; + + expectToHaveLengthOf = jest.fn(); + expectToHaveLengthOfAtLeast = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + have: { + length: { + of: { + at: { + least: expectToHaveLengthOfAtLeast, }, }, - lengthOf: expectToHaveLengthOf, }, + lengthOf: expectToHaveLengthOf, }, - })); + }, + })); + }); - done = jest.fn(); - }); + it('should fail if the element is not on the page', () => { + setInputField('add', 'value', 'element'); - it( - 'should fail if the element is not on the page', - () => { - setInputField('add', 'value', 'element', done); + _expect(global.browser.addValue).toHaveBeenCalledTimes(1); + _expect(global.browser.addValue) + .toHaveBeenCalledWith('element', 'value'); - _expect(global.browser.addValue).toHaveBeenCalledTimes(1); - _expect(global.browser.addValue) - .toHaveBeenCalledWith('element', 'value'); + _expect(global.browser.setValue).not.toHaveBeenCalled(); - _expect(global.browser.setValue).not.toHaveBeenCalled(); - - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 1, - 'Element with selector "element" should exist ' + - 'exactly 1 time(s)' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 1, + 'Element with selector "element" should exist ' + + 'exactly 1 time(s)' ); + }); - it( - 'should fail if there is more than 1 element on the page', - () => { - setInputField('add', 'value', 'element', done); - - _expect(global.browser.addValue).toHaveBeenCalledTimes(1); - _expect(global.browser.addValue) - .toHaveBeenCalledWith('element', 'value'); + it('should fail if there is more than 1 element on the page', () => { + setInputField('add', 'value', 'element'); - _expect(global.browser.setValue).not.toHaveBeenCalled(); + _expect(global.browser.addValue).toHaveBeenCalledTimes(1); + _expect(global.browser.addValue) + .toHaveBeenCalledWith('element', 'value'); - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 1, - 'Element with selector "element" should exist ' + - 'exactly 1 time(s)' - ); + _expect(global.browser.setValue).not.toHaveBeenCalled(); - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 1, + 'Element with selector "element" should exist ' + + 'exactly 1 time(s)' ); + }); - it( - 'should be able to add a value to an element', - () => { - setInputField('add', 'value', 'element', done); + it('should be able to add a value to an element', () => { + setInputField('add', 'value', 'element'); - _expect(global.browser.addValue).toHaveBeenCalledTimes(1); - _expect(global.browser.addValue) - .toHaveBeenCalledWith('element', 'value'); + _expect(global.browser.addValue).toHaveBeenCalledTimes(1); + _expect(global.browser.addValue) + .toHaveBeenCalledWith('element', 'value'); - _expect(global.browser.setValue).not.toHaveBeenCalled(); + _expect(global.browser.setValue).not.toHaveBeenCalled(); - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 1, - 'Element with selector "element" should exist ' + - 'exactly 1 time(s)' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 1, + 'Element with selector "element" should exist ' + + 'exactly 1 time(s)' ); + }); - it( - 'should be able to set the value of an element', - () => { - setInputField('set', 'value', 'element', done); - - _expect(global.browser.setValue).toHaveBeenCalledTimes(1); - _expect(global.browser.setValue) - .toHaveBeenCalledWith('element', 'value'); + it('should be able to set the value of an element', () => { + setInputField('set', 'value', 'element'); - _expect(global.browser.addValue).not.toHaveBeenCalled(); + _expect(global.browser.setValue).toHaveBeenCalledTimes(1); + _expect(global.browser.setValue) + .toHaveBeenCalledWith('element', 'value'); - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 1, - 'Element with selector "element" should exist ' + - 'exactly 1 time(s)' - ); + _expect(global.browser.addValue).not.toHaveBeenCalled(); - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 1, + 'Element with selector "element" should exist ' + + 'exactly 1 time(s)' ); + }); - it( - 'should be able to set an empty value of an element', - () => { - setInputField('set', '', 'element', done); - - _expect(global.browser.setValue).toHaveBeenCalledTimes(1); - _expect(global.browser.setValue) - .toHaveBeenCalledWith('element', ''); + it('should be able to set an empty value of an element', () => { + setInputField('set', '', 'element'); - _expect(global.browser.addValue).not.toHaveBeenCalled(); + _expect(global.browser.setValue).toHaveBeenCalledTimes(1); + _expect(global.browser.setValue) + .toHaveBeenCalledWith('element', ''); - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 1, - 'Element with selector "element" should exist ' + - 'exactly 1 time(s)' - ); + _expect(global.browser.addValue).not.toHaveBeenCalled(); - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 1, + 'Element with selector "element" should exist ' + + 'exactly 1 time(s)' ); - } -); + }); +}); diff --git a/test/support/action/setPromptText.spec.js b/test/support/action/setPromptText.spec.js index 859569f3..8c60b590 100644 --- a/test/support/action/setPromptText.spec.js +++ b/test/support/action/setPromptText.spec.js @@ -1,56 +1,40 @@ import setPromptText from 'src/support/action/setPromptText'; -describe( - 'setPromptText', () => { - let done; - - beforeEach(() => { - global.browser = { - alertText: jest.fn(), - }; - - global.assert = jest.fn(); - - done = jest.fn(); +describe('setPromptText', () => { + beforeEach(() => { + global.browser = { + alertText: jest.fn(), + }; + + global.assert = jest.fn(); + }); + + it('should call alertText on the browser object', () => { + setPromptText('modalText'); + + expect(global.browser.alertText).toHaveBeenCalledTimes(1); + expect(global.browser.alertText) + .toHaveBeenCalledWith('modalText'); + }); + + it('should call fail when no prompt is open', () => { + const error = new Error(); + global.browser.alertText = jest.fn(() => { + throw error; }); - it( - 'should call alertText on the browser object', - () => { - setPromptText('modalText', done); - - expect(global.browser.alertText).toHaveBeenCalledTimes(1); - expect(global.browser.alertText) - .toHaveBeenCalledWith('modalText'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call fail when no prompt is open', - () => { - const error = new Error(); - global.browser.alertText = jest.fn(() => { - throw error; - }); - - setPromptText('modalText2', done); - - expect(global.browser.alertText).toHaveBeenCalledTimes(1); - expect(global.browser.alertText) - .toHaveBeenCalledWith('modalText2'); - expect(global.browser.alertText).toThrow(); - - expect(global.assert).toHaveBeenCalledTimes(1); - expect(global.assert) - .toHaveBeenCalledWith( - error, - 'A prompt was not open when it should have been open' - ); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + setPromptText('modalText2'); + + expect(global.browser.alertText).toHaveBeenCalledTimes(1); + expect(global.browser.alertText) + .toHaveBeenCalledWith('modalText2'); + expect(global.browser.alertText).toThrow(); + + expect(global.assert).toHaveBeenCalledTimes(1); + expect(global.assert) + .toHaveBeenCalledWith( + error, + 'A prompt was not open when it should have been open' + ); + }); +}); diff --git a/test/support/action/submitForm.spec.js b/test/support/action/submitForm.spec.js index d0841b43..efc797d8 100644 --- a/test/support/action/submitForm.spec.js +++ b/test/support/action/submitForm.spec.js @@ -1,27 +1,16 @@ import submitForm from 'src/support/action/submitForm'; -describe( - 'submitForm', () => { - let done; +describe('submitForm', () => { + beforeEach(() => { + global.browser = { + submitForm: jest.fn(), + }; + }); - beforeEach(() => { - global.browser = { - submitForm: jest.fn(), - }; + it('should call submitForm on the browser object', () => { + submitForm('form'); - done = jest.fn(); - }); - - it( - 'should call submitForm on the browser object', - () => { - submitForm('form', done); - - expect(global.browser.submitForm).toHaveBeenCalledTimes(1); - expect(global.browser.submitForm).toHaveBeenCalledWith('form'); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + expect(global.browser.submitForm).toHaveBeenCalledTimes(1); + expect(global.browser.submitForm).toHaveBeenCalledWith('form'); + }); +}); diff --git a/test/support/action/waitFor.spec.js b/test/support/action/waitFor.spec.js index 42b47e34..7d2c5d79 100644 --- a/test/support/action/waitFor.spec.js +++ b/test/support/action/waitFor.spec.js @@ -1,163 +1,102 @@ import waitFor from 'src/support/action/waitFor'; -describe( - 'waitFor', () => { - let done; - - beforeEach(() => { - global.browser = { - waitForExist: jest.fn(), - waitForSelected: jest.fn(), - waitForEnabled: jest.fn(), - waitForVisible: jest.fn(), - waitForText: jest.fn(), - waitForValue: jest.fn(), - }; - - done = jest.fn(); - }); - - it( - 'should call waitForExist on the browser object', - () => { - waitFor('element', '', 1, false, undefined, '', done); - - expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); - expect(global.browser.waitForExist) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForExist on the browser object', - () => { - waitFor('element', '', 1, false, false, '', done); - - expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); - expect(global.browser.waitForExist) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForExist on the browser object', - () => { - waitFor('element', '', 1, false, true, '', done); - - expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); - expect(global.browser.waitForExist) - .toHaveBeenCalledWith('element', 1, true); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should use a default value for the timeout', - () => { - waitFor('element', '', 0, false, false, '', done); - - expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); - expect(global.browser.waitForExist) - .toHaveBeenCalledWith('element', 3000, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForSelected on the browser object', - () => { - waitFor('element', '', 1, true, false, 'be checked', done); - - expect(global.browser.waitForSelected).toHaveBeenCalledTimes(1); - expect(global.browser.waitForSelected) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForEnabled on the browser object', - () => { - waitFor('element', '', 1, true, false, 'be enabled', done); - - expect(global.browser.waitForEnabled).toHaveBeenCalledTimes(1); - expect(global.browser.waitForEnabled) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForSelected on the browser object', - () => { - waitFor('element', '', 1, true, false, 'be selected', done); - - expect(global.browser.waitForSelected).toHaveBeenCalledTimes(1); - expect(global.browser.waitForSelected) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForVisible on the browser object', - () => { - waitFor('element', '', 1, true, false, 'be visible', done); - - expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); - expect(global.browser.waitForVisible) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForText on the browser object', - () => { - waitFor('element', '', 1, true, false, 'contain a text', done); - - expect(global.browser.waitForText).toHaveBeenCalledTimes(1); - expect(global.browser.waitForText) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForValue on the browser object', - () => { - waitFor('element', '', 1, true, false, 'contain a value', done); - - expect(global.browser.waitForValue).toHaveBeenCalledTimes(1); - expect(global.browser.waitForValue) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForExist on the browser object', - () => { - waitFor('element', '', 1, true, false, 'exist', done); - - expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); - expect(global.browser.waitForExist) - .toHaveBeenCalledWith('element', 1, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); +describe('waitFor', () => { + beforeEach(() => { + global.browser = { + waitForExist: jest.fn(), + waitForSelected: jest.fn(), + waitForEnabled: jest.fn(), + waitForVisible: jest.fn(), + waitForText: jest.fn(), + waitForValue: jest.fn(), + }; + }); + + it('should call waitForExist on the browser object', () => { + waitFor('element', 1, undefined, ''); + + expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); + expect(global.browser.waitForExist) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForExist on the browser object', () => { + waitFor('element', 1, false, ''); + + expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); + expect(global.browser.waitForExist) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForExist on the browser object', () => { + waitFor('element', 1, true, ''); + + expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); + expect(global.browser.waitForExist) + .toHaveBeenCalledWith('element', 1, true); + }); + + it('should use a default value for the timeout', () => { + waitFor('element', 0, false, ''); + + expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); + expect(global.browser.waitForExist) + .toHaveBeenCalledWith('element', 3000, false); + }); + + it('should call waitForSelected on the browser object', () => { + waitFor('element', 1, false, 'be checked'); + + expect(global.browser.waitForSelected).toHaveBeenCalledTimes(1); + expect(global.browser.waitForSelected) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForEnabled on the browser object', () => { + waitFor('element', 1, false, 'be enabled'); + + expect(global.browser.waitForEnabled).toHaveBeenCalledTimes(1); + expect(global.browser.waitForEnabled) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForSelected on the browser object', () => { + waitFor('element', 1, false, 'be selected'); + + expect(global.browser.waitForSelected).toHaveBeenCalledTimes(1); + expect(global.browser.waitForSelected) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForVisible on the browser object', () => { + waitFor('element', 1, false, 'be visible'); + + expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); + expect(global.browser.waitForVisible) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForText on the browser object', () => { + waitFor('element', 1, false, 'contain a text'); + + expect(global.browser.waitForText).toHaveBeenCalledTimes(1); + expect(global.browser.waitForText) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForValue on the browser object', () => { + waitFor('element', 1, false, 'contain a value'); + + expect(global.browser.waitForValue).toHaveBeenCalledTimes(1); + expect(global.browser.waitForValue) + .toHaveBeenCalledWith('element', 1, false); + }); + + it('should call waitForExist on the browser object', () => { + waitFor('element', 1, false, 'exist'); + + expect(global.browser.waitForExist).toHaveBeenCalledTimes(1); + expect(global.browser.waitForExist) + .toHaveBeenCalledWith('element', 1, false); + }); +}); diff --git a/test/support/action/waitForVisible.spec.js b/test/support/action/waitForVisible.spec.js index 9646276a..5af4ec02 100644 --- a/test/support/action/waitForVisible.spec.js +++ b/test/support/action/waitForVisible.spec.js @@ -1,41 +1,25 @@ import waitForVisible from 'src/support/action/waitForVisible'; -describe( - 'waitForVisible', () => { - let done; - - beforeEach(() => { - global.browser = { - waitForVisible: jest.fn(), - }; - - done = jest.fn(); - }); - - it( - 'should call waitForVisible on the browser object', - () => { - waitForVisible('element', true, done); - - expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); - expect(global.browser.waitForVisible) - .toHaveBeenCalledWith('element', 10000, true); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call waitForVisible on the browser object', - () => { - waitForVisible('element', false, done); - - expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); - expect(global.browser.waitForVisible) - .toHaveBeenCalledWith('element', 10000, false); - - expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); +describe('waitForVisible', () => { + beforeEach(() => { + global.browser = { + waitForVisible: jest.fn(), + }; + }); + + it('should call waitForVisible on the browser object', () => { + waitForVisible('element', true); + + expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); + expect(global.browser.waitForVisible) + .toHaveBeenCalledWith('element', 10000, true); + }); + + it('should call waitForVisible on the browser object', () => { + waitForVisible('element', false); + + expect(global.browser.waitForVisible).toHaveBeenCalledTimes(1); + expect(global.browser.waitForVisible) + .toHaveBeenCalledWith('element', 10000, false); + }); +}); diff --git a/test/support/check/checkClass.spec.js b/test/support/check/checkClass.spec.js index a7003902..70e7b459 100644 --- a/test/support/check/checkClass.spec.js +++ b/test/support/check/checkClass.spec.js @@ -1,125 +1,100 @@ import checkClass from 'src/support/check/checkClass'; -describe( - 'checkClass', () => { - let done; - let expectToIncludeStub; - let expectToNotIncludeStub; - - beforeEach(() => { - global.browser = { - getAttribute: jest.fn(() => 'class1 class2'), - }; - - expectToIncludeStub = jest.fn(); - expectToNotIncludeStub = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - include: expectToIncludeStub, - not: { - include: expectToNotIncludeStub, - }, +describe('checkClass', () => { + let expectToIncludeStub; + let expectToNotIncludeStub; + + beforeEach(() => { + global.browser = { + getAttribute: jest.fn(() => 'class1 class2'), + }; + + expectToIncludeStub = jest.fn(); + expectToNotIncludeStub = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + include: expectToIncludeStub, + not: { + include: expectToNotIncludeStub, }, - })); - - done = jest.fn(); - }); - - it( - 'should call checkClass on the browser object', - () => { - checkClass('element1', 'has', 'class1', done); - - _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); - _expect(global.browser.getAttribute) - .toHaveBeenCalledWith('element1', 'className'); - - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect) - .toHaveBeenCalledWith(['class1', 'class2']); - - _expect(expectToIncludeStub).toHaveBeenCalledTimes(1); - _expect(expectToIncludeStub) - .toHaveBeenCalledWith( - 'class1', - 'Element element1 should have the class class1' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call checkClass on the browser object', - () => { - checkClass('element1', 'has', 'class3', done); - - _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); - _expect(global.browser.getAttribute) - .toHaveBeenCalledWith('element1', 'className'); - - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect) - .toHaveBeenCalledWith(['class1', 'class2']); - - _expect(expectToIncludeStub).toHaveBeenCalledTimes(1); - _expect(expectToIncludeStub) - .toHaveBeenCalledWith( - 'class3', - 'Element element1 should have the class class3' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call checkClass on the browser object', - () => { - checkClass('element1', 'does not have', 'class3', done); - - _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); - _expect(global.browser.getAttribute) - .toHaveBeenCalledWith('element1', 'className'); - - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect) - .toHaveBeenCalledWith(['class1', 'class2']); - - _expect(expectToNotIncludeStub).toHaveBeenCalledTimes(1); - _expect(expectToNotIncludeStub) - .toHaveBeenCalledWith( - 'class3', - 'Element element1 should not have the class class3' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call checkClass on the browser object', - () => { - checkClass('element1', 'does not have', 'class1', done); - - _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); - _expect(global.browser.getAttribute) - .toHaveBeenCalledWith('element1', 'className'); - - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect) - .toHaveBeenCalledWith(['class1', 'class2']); - - _expect(expectToNotIncludeStub).toHaveBeenCalledTimes(1); - _expect(expectToNotIncludeStub) - .toHaveBeenCalledWith( - 'class1', - 'Element element1 should not have the class class1' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + }, + })); + }); + + it('should call checkClass on the browser object', () => { + checkClass('element1', 'has', 'class1'); + + _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); + _expect(global.browser.getAttribute) + .toHaveBeenCalledWith('element1', 'className'); + + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect) + .toHaveBeenCalledWith(['class1', 'class2']); + + _expect(expectToIncludeStub).toHaveBeenCalledTimes(1); + _expect(expectToIncludeStub) + .toHaveBeenCalledWith( + 'class1', + 'Element element1 should have the class class1' + ); + }); + + it('should call checkClass on the browser object', () => { + checkClass('element1', 'has', 'class3'); + + _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); + _expect(global.browser.getAttribute) + .toHaveBeenCalledWith('element1', 'className'); + + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect) + .toHaveBeenCalledWith(['class1', 'class2']); + + _expect(expectToIncludeStub).toHaveBeenCalledTimes(1); + _expect(expectToIncludeStub) + .toHaveBeenCalledWith( + 'class3', + 'Element element1 should have the class class3' + ); + }); + + it('should call checkClass on the browser object', () => { + checkClass('element1', 'does not have', 'class3'); + + _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); + _expect(global.browser.getAttribute) + .toHaveBeenCalledWith('element1', 'className'); + + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect) + .toHaveBeenCalledWith(['class1', 'class2']); + + _expect(expectToNotIncludeStub).toHaveBeenCalledTimes(1); + _expect(expectToNotIncludeStub) + .toHaveBeenCalledWith( + 'class3', + 'Element element1 should not have the class class3' + ); + }); + + it('should call checkClass on the browser object', () => { + checkClass('element1', 'does not have', 'class1'); + + _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); + _expect(global.browser.getAttribute) + .toHaveBeenCalledWith('element1', 'className'); + + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect) + .toHaveBeenCalledWith(['class1', 'class2']); + + _expect(expectToNotIncludeStub).toHaveBeenCalledTimes(1); + _expect(expectToNotIncludeStub) + .toHaveBeenCalledWith( + 'class1', + 'Element element1 should not have the class class1' + ); + }); +}); diff --git a/test/support/check/checkContainsAnyText.spec.js b/test/support/check/checkContainsAnyText.spec.js index 93f8fc7a..5a498b29 100644 --- a/test/support/check/checkContainsAnyText.spec.js +++ b/test/support/check/checkContainsAnyText.spec.js @@ -1,94 +1,81 @@ import checkContent from 'src/support/check/checkContainsAnyText'; -describe( - 'checkContent', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getAttribute: jest.fn((element) => { - if (element === 'element1') { - return ''; - } - - return null; - }), - getText: jest.fn(() => 'text'), - getValue: jest.fn(() => 'value'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - equal: expectToEqual, - not: { - equal: expectToNotEqual, - }, +describe('checkContent', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getAttribute: jest.fn((element) => { + if (element === 'element1') { + return ''; + } + + return null; + }), + getText: jest.fn(() => 'text'), + getValue: jest.fn(() => 'value'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + equal: expectToEqual, + not: { + equal: expectToNotEqual, }, - })); + }, + })); + }); - done = jest.fn(); - }); + it('Should handle input fields', () => { + checkContent('element1', false); - it('Should handle input fields', () => { - checkContent('element1', false, done); + _expect(global.browser.getText).not.toHaveBeenCalledTimes(1); - _expect(global.browser.getText).not.toHaveBeenCalledTimes(1); + _expect(global.browser.getValue).toHaveBeenCalledTimes(1); + _expect(global.browser.getValue).toHaveBeenCalledWith('element1'); - _expect(global.browser.getValue).toHaveBeenCalledTimes(1); - _expect(global.browser.getValue).toHaveBeenCalledWith('element1'); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith(''); + }); - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith(''); + it('Should handle elements', () => { + checkContent('element2', false); - _expect(done).toHaveBeenCalledTimes(1); - }); + _expect(global.browser.getText).toHaveBeenCalledTimes(1); + _expect(global.browser.getText).toHaveBeenCalledWith('element2'); - it('Should handle elements', () => { - checkContent('element2', false, done); + _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); - _expect(global.browser.getText).toHaveBeenCalledTimes(1); - _expect(global.browser.getText).toHaveBeenCalledWith('element2'); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual).toHaveBeenCalledWith(''); + }); - _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); + it('Handle the false case', () => { + checkContent('element3', true); - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual).toHaveBeenCalledWith(''); + _expect(global.browser.getText).toHaveBeenCalledTimes(1); + _expect(global.browser.getText).toHaveBeenCalledWith('element3'); - _expect(done).toHaveBeenCalledTimes(1); - }); + _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); - it('Handle the false case', () => { - checkContent('element3', true, done); + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual).toHaveBeenCalledWith(''); + }); - _expect(global.browser.getText).toHaveBeenCalledTimes(1); - _expect(global.browser.getText).toHaveBeenCalledWith('element3'); + it('should handle no expected text and no falsecase', () => { + checkContent('element4'); - _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); + _expect(global.browser.getText).toHaveBeenCalledTimes(1); + _expect(global.browser.getText).toHaveBeenCalledWith('element4'); - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual).toHaveBeenCalledWith(''); + _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('should handle no expected text and no falsecase', () => { - checkContent('element4', done); - - _expect(global.browser.getText).toHaveBeenCalledTimes(1); - _expect(global.browser.getText).toHaveBeenCalledWith('element4'); - - _expect(global.browser.getValue).not.toHaveBeenCalledTimes(1); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual).toHaveBeenCalledWith(''); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual).toHaveBeenCalledWith(''); + }); +}); diff --git a/test/support/check/checkContainsText.spec.js b/test/support/check/checkContainsText.spec.js index 0ea84fe0..86cf1325 100644 --- a/test/support/check/checkContainsText.spec.js +++ b/test/support/check/checkContainsText.spec.js @@ -1,122 +1,95 @@ import checkContainsText from 'src/support/check/checkContainsText'; -describe( - 'checkContainsText', () => { - let done; - let expectToContain; - let expectToNotContain; - - beforeEach(() => { - global.browser = { - getAttribute: jest.fn((element) => { - if (element === 'element1') { - return null; - } - - return ''; - }), - getText: jest.fn(() => 'text'), - getValue: jest.fn(() => 'value'), - }; - - expectToContain = jest.fn(); - expectToNotContain = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - contain: expectToContain, - not: { - contain: expectToNotContain, - }, +describe('checkContainsText', () => { + let expectToContain; + let expectToNotContain; + + beforeEach(() => { + global.browser = { + getAttribute: jest.fn((element) => { + if (element === 'element1') { + return null; + } + + return ''; + }), + getText: jest.fn(() => 'text'), + getValue: jest.fn(() => 'value'), + }; + + expectToContain = jest.fn(); + expectToNotContain = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + contain: expectToContain, + not: { + contain: expectToNotContain, }, - })); + }, + })); + }); - done = jest.fn(); - }); + it('should call checkContainsText on the browser object', () => { + checkContainsText('element1', 'text'); - it( - 'should call checkContainsText on the browser object', - () => { - checkContainsText('element1', 'text', done); + _expect(global.browser.getText).toHaveBeenCalledTimes(1); + _expect(global.browser.getText) + .toHaveBeenCalledWith('element1'); - _expect(global.browser.getText).toHaveBeenCalledTimes(1); - _expect(global.browser.getText) - .toHaveBeenCalledWith('element1'); + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect).toHaveBeenCalledWith('text'); - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect).toHaveBeenCalledWith('text'); + _expect(expectToContain).toHaveBeenCalledTimes(1); + _expect(expectToContain).toHaveBeenCalledWith('text'); + }); - _expect(expectToContain).toHaveBeenCalledTimes(1); - _expect(expectToContain).toHaveBeenCalledWith('text'); + it('should call checkContainsText on the browser object', () => { + checkContainsText('element1', ' not', 'text'); - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it( - 'should call checkContainsText on the browser object', - () => { - checkContainsText('element1', ' not', 'text', done); + _expect(global.browser.getText).toHaveBeenCalledTimes(1); + _expect(global.browser.getText) + .toHaveBeenCalledWith('element1'); - _expect(global.browser.getText).toHaveBeenCalledTimes(1); - _expect(global.browser.getText) - .toHaveBeenCalledWith('element1'); + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect).toHaveBeenCalledWith('text'); - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect).toHaveBeenCalledWith('text'); + _expect(expectToNotContain).toHaveBeenCalledTimes(1); + _expect(expectToNotContain).toHaveBeenCalledWith('text'); + }); - _expect(expectToNotContain).toHaveBeenCalledTimes(1); - _expect(expectToNotContain).toHaveBeenCalledWith('text'); - - _expect(done).toHaveBeenCalledTimes(1); - } + it('should call checkContainsText on the browser object', () => { + checkContainsText( + 'element2', + 'text' ); - it( - 'should call checkContainsText on the browser object', - () => { - checkContainsText( - 'element2', - 'text', - done - ); - - _expect(global.browser.getValue).toHaveBeenCalledTimes(1); - _expect(global.browser.getValue) - .toHaveBeenCalledWith('element2'); + _expect(global.browser.getValue).toHaveBeenCalledTimes(1); + _expect(global.browser.getValue) + .toHaveBeenCalledWith('element2'); - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect).toHaveBeenCalledWith('value'); + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect).toHaveBeenCalledWith('value'); - _expect(expectToContain).toHaveBeenCalledTimes(1); - _expect(expectToContain).toHaveBeenCalledWith('text'); + _expect(expectToContain).toHaveBeenCalledTimes(1); + _expect(expectToContain).toHaveBeenCalledWith('text'); + }); - _expect(done).toHaveBeenCalledTimes(1); - } + it('should call checkContainsText on the browser object', () => { + checkContainsText( + 'element2', + ' not', + 'text' ); - it( - 'should call checkContainsText on the browser object', - () => { - checkContainsText( - 'element2', - ' not', - 'text', - done - ); + _expect(global.browser.getValue).toHaveBeenCalledTimes(1); + _expect(global.browser.getValue) + .toHaveBeenCalledWith('element2'); - _expect(global.browser.getValue).toHaveBeenCalledTimes(1); - _expect(global.browser.getValue) - .toHaveBeenCalledWith('element2'); + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect).toHaveBeenCalledWith('value'); - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect).toHaveBeenCalledWith('value'); - - _expect(expectToNotContain).toHaveBeenCalledTimes(1); - _expect(expectToNotContain).toHaveBeenCalledWith('text'); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + _expect(expectToNotContain).toHaveBeenCalledTimes(1); + _expect(expectToNotContain).toHaveBeenCalledWith('text'); + }); +}); diff --git a/test/support/check/checkCookieContent.spec.js b/test/support/check/checkCookieContent.spec.js index d54bc879..80428610 100644 --- a/test/support/check/checkCookieContent.spec.js +++ b/test/support/check/checkCookieContent.spec.js @@ -1,81 +1,70 @@ import checkCookieContent from 'src/support/check/checkCookieContent'; -describe( - 'checkCookieContent', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getCookie: jest.fn(() => ({ - name: 'cookie1', - value: 'value1', - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - equal: expectToEqual, - not: { - equal: expectToNotEqual, - }, +describe('checkCookieContent', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getCookie: jest.fn(() => ({ + name: 'cookie1', + value: 'value1', + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + equal: expectToEqual, + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should fail if no cookie was found with the given name', () => { - checkCookieContent('cookie2', true, '', done); - - _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); - _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie2'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'cookie2', - 'no cookie found with the name "cookie2"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Handle the false case', () => { - checkCookieContent('cookie1', true, 'value2', done); - - _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); - _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'value2', - 'expected cookie "cookie1" not to have value "value2"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should be able to validated against an expected string', () => { - checkCookieContent('cookie1', false, 'value2', done); - - _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); - _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(2); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'value2', - 'expected cookie "cookie1" to have value "value2" but got' + - ' "value1"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + }, + })); + }); + + it('Should fail if no cookie was found with the given name', () => { + checkCookieContent('cookie2', true, ''); + + _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); + _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie2'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'cookie2', + 'no cookie found with the name "cookie2"' + ); + }); + + it('Handle the false case', () => { + checkCookieContent('cookie1', true, 'value2'); + + _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); + _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'value2', + 'expected cookie "cookie1" not to have value "value2"' + ); + }); + + it('Should be able to validated against an expected string', () => { + checkCookieContent('cookie1', false, 'value2'); + + _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); + _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(2); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'value2', + 'expected cookie "cookie1" to have value "value2" but got' + + ' "value1"' + ); + }); +}); diff --git a/test/support/check/checkCookieExists.spec.js b/test/support/check/checkCookieExists.spec.js index bbce106b..762da487 100644 --- a/test/support/check/checkCookieExists.spec.js +++ b/test/support/check/checkCookieExists.spec.js @@ -1,68 +1,59 @@ import checkCookieExists from 'src/support/check/checkCookieExists'; -describe( - 'checkCookieExists', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getCookie: jest.fn(), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkCookieExists', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getCookie: jest.fn(), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); + equal: expectToEqual, + }, + })); + }); + + it('Should succeed if a cookie was found with the given name', () => { + global.browser.getCookie.mockReturnValueOnce({ + name: 'cookie1', + value: 'value1', }); - it('Should succeed if a cookie was found with the given name', () => { - global.browser.getCookie.mockReturnValueOnce({ - name: 'cookie1', - value: 'value1', - }); + checkCookieExists('cookie1', false); - checkCookieExists('cookie1', false, done); + _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); + _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); - _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); - _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie1'); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + null, + 'Expected cookie "cookie1" to exists but it does not' + ); + }); - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - null, - 'Expected cookie "cookie1" to exists but it does not' - ); + it('Should fail if no cookie was found with the given name', () => { + global.browser.getCookie.mockReturnValueOnce(null); - _expect(done).toHaveBeenCalledTimes(1); - }); + checkCookieExists('cookie2', true); - it('Should fail if no cookie was found with the given name', () => { - global.browser.getCookie.mockReturnValueOnce(null); + _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); + _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie2'); - checkCookieExists('cookie2', true, done); - - _expect(global.browser.getCookie).toHaveBeenCalledTimes(1); - _expect(global.browser.getCookie).toHaveBeenCalledWith('cookie2'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - null, - 'Expected cookie "cookie2" not to exists but it does' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + null, + 'Expected cookie "cookie2" not to exists but it does' + ); + }); +}); diff --git a/test/support/check/checkDimension.spec.js b/test/support/check/checkDimension.spec.js index f50653fc..ee9de2bf 100644 --- a/test/support/check/checkDimension.spec.js +++ b/test/support/check/checkDimension.spec.js @@ -1,85 +1,74 @@ import checkDimension from 'src/support/check/checkDimension'; -describe( - 'checkDimension', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getElementSize: jest.fn(() => ({ - width: 100, - height: 200, - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - equal: expectToEqual, - not: { - equal: expectToNotEqual, - }, +describe('checkDimension', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getElementSize: jest.fn(() => ({ + width: 100, + height: 200, + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + equal: expectToEqual, + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test the height of an element against a given value', () => { - checkDimension('element1', false, 200, 'tall', done); - - _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); - _expect(global.browser.getElementSize) - .toHaveBeenCalledWith('element1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 200, - 'Element "element1" should have a height of ' + - '200px, but is 200px' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test the width of an element against a given value', () => { - checkDimension('element2', false, 100, 'broad', done); - - _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); - _expect(global.browser.getElementSize) - .toHaveBeenCalledWith('element2'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 100, - 'Element "element2" should have a width of ' + - '100px, but is 100px' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test the height of an element against a given value', () => { - checkDimension('element3', true, 200, 'tall', done); - - _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); - _expect(global.browser.getElementSize) - .toHaveBeenCalledWith('element3'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 200, - 'Element "element3" should not have a height of 200px' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + }, + })); + }); + + it('Should test the height of an element against a given value', () => { + checkDimension('element1', false, 200, 'tall'); + + _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); + _expect(global.browser.getElementSize) + .toHaveBeenCalledWith('element1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 200, + 'Element "element1" should have a height of ' + + '200px, but is 200px' + ); + }); + + it('Should test the width of an element against a given value', () => { + checkDimension('element2', false, 100, 'broad'); + + _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); + _expect(global.browser.getElementSize) + .toHaveBeenCalledWith('element2'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 100, + 'Element "element2" should have a width of ' + + '100px, but is 100px' + ); + }); + + it('Should test the height of an element against a given value', () => { + checkDimension('element3', true, 200, 'tall'); + + _expect(global.browser.getElementSize).toHaveBeenCalledTimes(1); + _expect(global.browser.getElementSize) + .toHaveBeenCalledWith('element3'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 200, + 'Element "element3" should not have a height of 200px' + ); + }); +}); diff --git a/test/support/check/checkElementExists.spec.js b/test/support/check/checkElementExists.spec.js index 2e2b3e9d..c262c4bb 100644 --- a/test/support/check/checkElementExists.spec.js +++ b/test/support/check/checkElementExists.spec.js @@ -1,67 +1,58 @@ import checkElementExists from 'src/support/check/checkElementExists'; -describe( - 'checkElementExists', () => { - let expectToHaveLengthOf; - let expectToHaveLengthOfAtLeast; - let done; - - beforeEach(() => { - global.browser = { - elements: jest.fn(() => ({ - value: 1, - })), - }; - - expectToHaveLengthOf = jest.fn(); - expectToHaveLengthOfAtLeast = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - have: { - length: { - of: { - at: { - least: expectToHaveLengthOfAtLeast, - }, +describe('checkElementExists', () => { + let expectToHaveLengthOf; + let expectToHaveLengthOfAtLeast; + + beforeEach(() => { + global.browser = { + elements: jest.fn(() => ({ + value: 1, + })), + }; + + expectToHaveLengthOf = jest.fn(); + expectToHaveLengthOfAtLeast = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + have: { + length: { + of: { + at: { + least: expectToHaveLengthOfAtLeast, }, }, - lengthOf: expectToHaveLengthOf, }, + lengthOf: expectToHaveLengthOf, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element exists', () => { - checkElementExists('an', 'element1', done); - - _expect(global.browser.elements).toHaveBeenCalledTimes(1); - _expect(global.browser.elements).toHaveBeenCalledWith('element1'); - - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( - 1, - 'Element with selector "element1" should exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if the element does not exist', () => { - checkElementExists('no', 'element2', done); - - _expect(global.browser.elements).toHaveBeenCalledTimes(1); - _expect(global.browser.elements).toHaveBeenCalledWith('element2'); - - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf).toHaveBeenCalledWith( - 0, - 'Element with selector "element2" should not exist on the page' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + }, + })); + }); + + it('Should test if the element exists', () => { + checkElementExists('an', 'element1'); + + _expect(global.browser.elements).toHaveBeenCalledTimes(1); + _expect(global.browser.elements).toHaveBeenCalledWith('element1'); + + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOfAtLeast).toHaveBeenCalledWith( + 1, + 'Element with selector "element1" should exist on the page' + ); + }); + + it('Should test if the element does not exist', () => { + checkElementExists('no', 'element2'); + + _expect(global.browser.elements).toHaveBeenCalledTimes(1); + _expect(global.browser.elements).toHaveBeenCalledWith('element2'); + + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf).toHaveBeenCalledWith( + 0, + 'Element with selector "element2" should not exist on the page' + ); + }); +}); diff --git a/test/support/check/checkFocus.spec.js b/test/support/check/checkFocus.spec.js index a3b7c8cc..1a89b55c 100644 --- a/test/support/check/checkFocus.spec.js +++ b/test/support/check/checkFocus.spec.js @@ -1,61 +1,52 @@ import checkFocus from 'src/support/check/checkFocus'; -describe( - 'checkFocus', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - hasFocus: jest.fn(() => true), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkFocus', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + hasFocus: jest.fn(() => true), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element has focus', () => { - checkFocus('element1', false, done); - - _expect(global.browser.hasFocus).toHaveBeenCalledTimes(1); - _expect(global.browser.hasFocus).toHaveBeenCalledWith('element1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - true, - 'Expected element to be focused, but it is not' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if the element does not have the focus', () => { - checkFocus('element1', true, done); - - _expect(global.browser.hasFocus).toHaveBeenCalledTimes(1); - _expect(global.browser.hasFocus).toHaveBeenCalledWith('element1'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - true, - 'Expected element to not be focused, but it is' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element has focus', () => { + checkFocus('element1', false); + + _expect(global.browser.hasFocus).toHaveBeenCalledTimes(1); + _expect(global.browser.hasFocus).toHaveBeenCalledWith('element1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + true, + 'Expected element to be focused, but it is not' + ); + }); + + it('Should test if the element does not have the focus', () => { + checkFocus('element1', true); + + _expect(global.browser.hasFocus).toHaveBeenCalledTimes(1); + _expect(global.browser.hasFocus).toHaveBeenCalledWith('element1'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + true, + 'Expected element to not be focused, but it is' + ); + }); +}); diff --git a/test/support/check/checkInURLPath.spec.js b/test/support/check/checkInURLPath.spec.js index 3ea10786..f6846c4f 100644 --- a/test/support/check/checkInURLPath.spec.js +++ b/test/support/check/checkInURLPath.spec.js @@ -1,65 +1,56 @@ import checkInURLPath from 'src/support/check/checkInURLPath'; -describe( - 'checkInURLPath', () => { - let done; - let expectShouldContain; - let expectShouldNotContain; - - beforeEach(() => { - global.browser = { - url: jest.fn(() => ({ - value: 'http://www.example.com/test', - })), - }; - - expectShouldContain = jest.fn(); - expectShouldNotContain = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - contain: expectShouldNotContain, - }, - contain: expectShouldContain, +describe('checkInURLPath', () => { + let expectShouldContain; + let expectShouldNotContain; + + beforeEach(() => { + global.browser = { + url: jest.fn(() => ({ + value: 'http://www.example.com/test', + })), + }; + + expectShouldContain = jest.fn(); + expectShouldNotContain = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + contain: expectShouldNotContain, }, - })); - - done = jest.fn(); - }); - - it('Should test if URL contains the given value', () => { - checkInURLPath(false, 'test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectShouldContain).toHaveBeenCalledTimes(1); - _expect(expectShouldContain) - .toHaveBeenCalledWith( - 'test', - 'Expected URL "http://www.example.com/test" to contain ' + - '"test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if URL does not contain the given value', () => { - checkInURLPath(true, 'test2', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectShouldNotContain).toHaveBeenCalledTimes(1); - _expect(expectShouldNotContain) - .toHaveBeenCalledWith( - 'test2', - 'Expected URL "http://www.example.com/test" not to ' + - 'contain "test2"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + contain: expectShouldContain, + }, + })); + }); + + it('Should test if URL contains the given value', () => { + checkInURLPath(false, 'test'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectShouldContain).toHaveBeenCalledTimes(1); + _expect(expectShouldContain) + .toHaveBeenCalledWith( + 'test', + 'Expected URL "http://www.example.com/test" to contain ' + + '"test"' + ); + }); + + it('Should test if URL does not contain the given value', () => { + checkInURLPath(true, 'test2'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectShouldNotContain).toHaveBeenCalledTimes(1); + _expect(expectShouldNotContain) + .toHaveBeenCalledWith( + 'test2', + 'Expected URL "http://www.example.com/test" not to ' + + 'contain "test2"' + ); + }); +}); diff --git a/test/support/check/checkIsOpenedInNewWindow.spec.js b/test/support/check/checkIsOpenedInNewWindow.spec.js index c26b55a0..9841597d 100644 --- a/test/support/check/checkIsOpenedInNewWindow.spec.js +++ b/test/support/check/checkIsOpenedInNewWindow.spec.js @@ -1,116 +1,105 @@ import checkIsOpenedInNewWindow from 'src/support/check/checkIsOpenedInNewWindow'; -describe( - 'checkIsOpenedInNewWindow', () => { - let done; - let expectLengthShouldNotEqual; - let expectShouldContain; - - beforeEach(() => { - global.browser = { - windowHandles: jest.fn(() => ({ - value: [ - 'window1', - 'window2', - ], - })), - window: jest.fn(() => {}), - url: jest.fn(() => ({ - value: 'http://www.example.com/test', - })), - close: jest.fn(() => {}), - }; - - expectLengthShouldNotEqual = jest.fn(); - expectShouldContain = jest.fn(); - - global.expect = jest.fn(() => ({ - length: { - to: { - not: { - equal: expectLengthShouldNotEqual, - }, - }, - }, - to: { - contain: expectShouldContain, - }, - })); - - done = jest.fn(); - }); - - it('Should fail if no popup was opened', () => { - global.expect = jest.fn(() => { - throw new Error(); - }); +describe('checkIsOpenedInNewWindow', () => { + let expectLengthShouldNotEqual; + let expectShouldContain; - global.browser.windowHandles.mockReturnValueOnce({ + beforeEach(() => { + global.browser = { + windowHandles: jest.fn(() => ({ value: [ 'window1', + 'window2', ], - }); - - try { - checkIsOpenedInNewWindow( - 'http://www.example.com/test', - '', - done - ); - } catch (e) { - _expect(e); - } + })), + window: jest.fn(() => {}), + url: jest.fn(() => ({ + value: 'http://www.example.com/test', + })), + close: jest.fn(() => {}), + }; + + expectLengthShouldNotEqual = jest.fn(); + expectShouldContain = jest.fn(); + + global.expect = jest.fn(() => ({ + length: { + to: { + not: { + equal: expectLengthShouldNotEqual, + }, + }, + }, + to: { + contain: expectShouldContain, + }, + })); + }); + + it('Should fail if no popup was opened', () => { + global.expect = jest.fn(() => { + throw new Error(); + }); - _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - _expect(global.browser.windowHandles).toHaveBeenCalledWith(); + global.browser.windowHandles.mockReturnValueOnce({ + value: [ + 'window1', + ], + }); - _expect(global.browser.window).not.toHaveBeenCalled(); + try { + checkIsOpenedInNewWindow( + 'http://www.example.com/test', + '' + ); + } catch (e) { + _expect(e); + } - _expect(global.browser.url).not.toHaveBeenCalled(); + _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + _expect(global.browser.windowHandles).toHaveBeenCalledWith(); - _expect(global.browser.close).not.toHaveBeenCalled(); + _expect(global.browser.window).not.toHaveBeenCalled(); - _expect(global.expect).toHaveBeenCalledTimes(1); - _expect(global.expect).toHaveBeenCalledWith([ - 'window1', - ]); + _expect(global.browser.url).not.toHaveBeenCalled(); - _expect(global.expect).toThrow(); + _expect(global.browser.close).not.toHaveBeenCalled(); - _expect(expectLengthShouldNotEqual).not.toHaveBeenCalled(); - _expect(expectShouldContain).not.toHaveBeenCalled(); + _expect(global.expect).toHaveBeenCalledTimes(1); + _expect(global.expect).toHaveBeenCalledWith([ + 'window1', + ]); - _expect(done).not.toHaveBeenCalled(); - }); + _expect(global.expect).toThrow(); - it('Should not fail if the URL of the popup does match', () => { - checkIsOpenedInNewWindow( - 'http://www.example.com/test', - '', - done - ); + _expect(expectLengthShouldNotEqual).not.toHaveBeenCalled(); + _expect(expectShouldContain).not.toHaveBeenCalled(); + }); - _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - _expect(global.browser.windowHandles).toHaveBeenCalledWith(); + it('Should not fail if the URL of the popup does match', () => { + checkIsOpenedInNewWindow( + 'http://www.example.com/test', + '' + ); - _expect(global.browser.window).toHaveBeenCalledTimes(1); - _expect(global.browser.window).toHaveBeenCalledWith('window2'); + _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + _expect(global.browser.windowHandles).toHaveBeenCalledWith(); - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); + _expect(global.browser.window).toHaveBeenCalledTimes(1); + _expect(global.browser.window).toHaveBeenCalledWith('window2'); - _expect(global.browser.close).toHaveBeenCalledTimes(1); - _expect(global.browser.close).toHaveBeenCalledWith(); + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); - _expect(expectLengthShouldNotEqual).toHaveBeenCalledTimes(1); - _expect(expectShouldContain).toHaveBeenCalledTimes(1); - _expect(expectShouldContain).toHaveBeenCalledWith( - 'http://www.example.com/test', - 'The popup has a incorrect url' - ); + _expect(global.browser.close).toHaveBeenCalledTimes(1); + _expect(global.browser.close).toHaveBeenCalledWith(); - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + _expect(expectLengthShouldNotEqual).toHaveBeenCalledTimes(1); + _expect(expectShouldContain).toHaveBeenCalledTimes(1); + _expect(expectShouldContain).toHaveBeenCalledWith( + 'http://www.example.com/test', + 'The popup has a incorrect url' + ); + }); +}); diff --git a/test/support/check/checkModal.spec.js b/test/support/check/checkModal.spec.js index 4b332a6e..37b6bb09 100644 --- a/test/support/check/checkModal.spec.js +++ b/test/support/check/checkModal.spec.js @@ -1,99 +1,86 @@ import checkModal from 'src/support/check/checkModal'; -describe( - 'checkModal', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - alertText: jest.fn(() => 'test'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkModal', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + alertText: jest.fn(() => 'test'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); + equal: expectToEqual, + }, + })); + }); + + it('Should test if alertbox is opened', () => { + global.browser.alertText = jest.fn(() => { + throw new Error(); }); - it('Should test if alertbox is opened', () => { - global.browser.alertText = jest.fn(() => { - throw new Error(); - }); - - try { - checkModal('alertbox', false, done); - } catch (e) { - _expect(e); - } - - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual).toHaveBeenCalledWith( - null, - 'A alertbox was not opened when it should have been' - ); - - _expect(done).toHaveBeenCalledTimes(1); + try { + checkModal('alertbox', false); + } catch (e) { + _expect(e); + } + + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual).toHaveBeenCalledWith( + null, + 'A alertbox was not opened when it should have been' + ); + }); + + it('Should test if confirmbox is not opened', () => { + checkModal('confirmbox', true); + + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual).toHaveBeenCalledWith( + null, + 'A confirmbox was opened when it shouldn\'t' + ); + }); + + it('Should test if alertbox is not opened', () => { + global.browser.alertText = jest.fn(() => { + throw new Error(); }); - it('Should test if confirmbox is not opened', () => { - checkModal('confirmbox', true, done); - - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); + try { + checkModal('alertbox', true); + } catch (e) { + _expect(e); + } - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual).toHaveBeenCalledWith( - null, - 'A confirmbox was opened when it shouldn\'t' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); - it('Should test if alertbox is not opened', () => { - global.browser.alertText = jest.fn(() => { - throw new Error(); - }); + _expect(expectToEqual).not.toHaveBeenCalled(); + _expect(expectToNotEqual).not.toHaveBeenCalled(); + }); - try { - checkModal('alertbox', true, done); - } catch (e) { - _expect(e); - } + it('Should test if confirmbox is opened', () => { + checkModal('confirmbox', false); - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); - _expect(expectToEqual).not.toHaveBeenCalled(); - _expect(expectToNotEqual).not.toHaveBeenCalled(); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if confirmbox is opened', () => { - checkModal('confirmbox', false, done); - - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); - - _expect(expectToEqual).not.toHaveBeenCalled(); - _expect(expectToNotEqual).not.toHaveBeenCalled(); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + _expect(expectToEqual).not.toHaveBeenCalled(); + _expect(expectToNotEqual).not.toHaveBeenCalled(); + }); +}); diff --git a/test/support/check/checkModalText.spec.js b/test/support/check/checkModalText.spec.js index d030b772..69746b65 100644 --- a/test/support/check/checkModalText.spec.js +++ b/test/support/check/checkModalText.spec.js @@ -1,83 +1,72 @@ import checkModalText from 'src/support/check/checkModalText'; -describe( - 'checkModalText', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - alertText: jest.fn(() => 'test'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkModalText', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + alertText: jest.fn(() => 'test'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if alertText contains the given value', () => { - checkModalText('alertbox', false, 'test', done); - - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'test', - 'Expected the text of alertbox not to equal ' + - '"test", instead found "test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); + equal: expectToEqual, + }, + })); + }); + + it('Should test if alertText contains the given value', () => { + checkModalText('alertbox', false, 'test'); + + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'test', + 'Expected the text of alertbox not to equal ' + + '"test", instead found "test"' + ); + }); + + it('Should test if alertText does not contain the given value', () => { + checkModalText('confirmbox', true, 'test'); + + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'test', + 'Expected the text of confirmbox not to equal ' + + '"test"' + ); + }); + + it('Should test if alertText does not contain the given value', () => { + global.browser.alertText = jest.fn(() => { + throw new Error(); }); - it('Should test if alertText does not contain the given value', () => { - checkModalText('confirmbox', true, 'test', done); + try { + checkModalText('confirmbox', false, 'test'); + } catch (e) { + _expect(e); + } - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); + _expect(global.browser.alertText).toHaveBeenCalledTimes(1); + _expect(global.browser.alertText).toHaveBeenCalledWith(); - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'test', - 'Expected the text of confirmbox not to equal ' + - '"test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if alertText does not contain the given value', () => { - global.browser.alertText = jest.fn(() => { - throw new Error(); - }); - - try { - checkModalText('confirmbox', false, 'test', done); - } catch (e) { - _expect(e); - } - - _expect(global.browser.alertText).toHaveBeenCalledTimes(1); - _expect(global.browser.alertText).toHaveBeenCalledWith(); - - _expect(expectToEqual).not.toHaveBeenCalled(); - _expect(expectToNotEqual).not.toHaveBeenCalled(); - - _expect(done).not.toHaveBeenCalled(); - }); - } -); + _expect(expectToEqual).not.toHaveBeenCalled(); + _expect(expectToNotEqual).not.toHaveBeenCalled(); + }); +}); diff --git a/test/support/check/checkNewWindow.spec.js b/test/support/check/checkNewWindow.spec.js index bd50e9e7..8e9355fa 100644 --- a/test/support/check/checkNewWindow.spec.js +++ b/test/support/check/checkNewWindow.spec.js @@ -1,63 +1,54 @@ import checkNewWindow from 'src/support/check/checkNewWindow'; -describe( - 'checkNewWindow', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - windowHandles: jest.fn(() => ({ - value: ['window1'], - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkNewWindow', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + windowHandles: jest.fn(() => ({ + value: ['window1'], + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if a new window is opened', () => { - checkNewWindow('', false, done); - - _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - _expect(global.browser.windowHandles).toHaveBeenCalledWith(); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 1, - 'A new window has been opened' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - - it('Should test if a new window is not opened', () => { - checkNewWindow('', true, done); - - _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); - _expect(global.browser.windowHandles).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 1, - 'A new window should not have been opened' - ); - - _expect(done).toHaveBeenCalledTimes(1); - }); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if a new window is opened', () => { + checkNewWindow('', false); + + _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + _expect(global.browser.windowHandles).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 1, + 'A new window has been opened' + ); + }); + + it('Should test if a new window is not opened', () => { + checkNewWindow('', true); + + _expect(global.browser.windowHandles).toHaveBeenCalledTimes(1); + _expect(global.browser.windowHandles).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 1, + 'A new window should not have been opened' + ); + }); +}); diff --git a/test/support/check/checkOffset.spec.js b/test/support/check/checkOffset.spec.js index c2763a34..e2c02d37 100644 --- a/test/support/check/checkOffset.spec.js +++ b/test/support/check/checkOffset.spec.js @@ -1,78 +1,70 @@ import checkOffset from 'src/support/check/checkOffset'; -describe( - 'checkOffset', () => { - let done; - let expectToEqual; - let expectToNotEqual; +describe('checkOffset', () => { + let expectToEqual; + let expectToNotEqual; - beforeEach(() => { - global.browser = { - getLocation: jest.fn(() => 100), - }; + beforeEach(() => { + global.browser = { + getLocation: jest.fn(() => 100), + }; - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); + equal: expectToEqual, + }, + })); + }); - done = jest.fn(); - }); + it( + 'Should test if the element is positioned at the expected location', + () => { + checkOffset('#elem1', false, 100, 'x'); - it('Should test if the element is positioned at the expected location', - () => { - checkOffset('#elem1', false, 100, 'x', done); + _expect(global.browser.getLocation).toHaveBeenCalledTimes(1); + _expect(global.browser.getLocation) + .toHaveBeenCalledWith( + '#elem1', + 'x' + ); - _expect(global.browser.getLocation).toHaveBeenCalledTimes(1); - _expect(global.browser.getLocation) - .toHaveBeenCalledWith( - '#elem1', - 'x' - ); + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 100, + 'Element "#elem1" should be positioned at ' + + '100px on the x axis, but was ' + + 'found at 100px' + ); + } + ); - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 100, - 'Element "#elem1" should be positioned at ' + - '100px on the x axis, but was ' + - 'found at 100px' - ); + it( + 'Should test if the element is not positioned at the expected ' + + 'location', + () => { + checkOffset('#elem2', true, 200, 'y'); - _expect(done).toHaveBeenCalledTimes(1); - } - ); + _expect(global.browser.getLocation).toHaveBeenCalledTimes(1); + _expect(global.browser.getLocation) + .toHaveBeenCalledWith( + '#elem2', + 'y' + ); - it( - 'Should test if the element is not positioned at the expected ' + - 'location', - () => { - checkOffset('#elem2', true, 200, 'y', done); - - _expect(global.browser.getLocation).toHaveBeenCalledTimes(1); - _expect(global.browser.getLocation) - .toHaveBeenCalledWith( - '#elem2', - 'y' - ); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 200, - 'Element "#elem2" should not be positioned at ' + - '200px on the y axis' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 200, + 'Element "#elem2" should not be positioned at ' + + '200px on the y axis' + ); + } + ); +}); diff --git a/test/support/check/checkProperty.spec.js b/test/support/check/checkProperty.spec.js index 6f9729b5..520d8075 100644 --- a/test/support/check/checkProperty.spec.js +++ b/test/support/check/checkProperty.spec.js @@ -1,119 +1,99 @@ import checkProperty from 'src/support/check/checkProperty'; -describe( - 'checkProperty', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getCssProperty: jest.fn(() => {}), - getAttribute: jest.fn(() => 'element-name'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkProperty', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getCssProperty: jest.fn(() => {}), + getAttribute: jest.fn(() => 'element-name'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element has the correct color', () => { + global.browser.getCssProperty.mockReturnValueOnce({ + value: 'black', }); - it('Should test if the element has the correct color', - () => { - global.browser.getCssProperty.mockReturnValueOnce({ - value: 'black', - }); - - checkProperty(true, 'color', '#elem1', false, 'black', done); - - _expect(global.browser.getCssProperty).toHaveBeenCalledTimes(1); - _expect(global.browser.getCssProperty) - .toHaveBeenCalledWith( - '#elem1', - 'color' - ); - - _expect(global.browser.getAttribute).not.toHaveBeenCalled(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'black', - 'CSS attribute of element "#elem1" should not ' + - 'contain "black", but "black"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } + checkProperty(true, 'color', '#elem1', false, 'black'); + + _expect(global.browser.getCssProperty).toHaveBeenCalledTimes(1); + _expect(global.browser.getCssProperty) + .toHaveBeenCalledWith( + '#elem1', + 'color' + ); + + _expect(global.browser.getAttribute).not.toHaveBeenCalled(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'black', + 'CSS attribute of element "#elem1" should not ' + + 'contain "black", but "black"' + ); + }); + + it('Should test if the element does not have a width of 1px', () => { + global.browser.getCssProperty.mockReturnValueOnce('1px'); + + checkProperty(true, 'width', '#elem2', true, '1px'); + + _expect(global.browser.getCssProperty).toHaveBeenCalledTimes(1); + _expect(global.browser.getCssProperty) + .toHaveBeenCalledWith( + '#elem2', + 'width' + ); + + _expect(global.browser.getAttribute).not.toHaveBeenCalled(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + '1px', + 'CSS attribute of element "#elem2" should not ' + + 'contain "1px"' + ); + }); + + it('Should test if the element has the correct name', () => { + checkProperty( + false, + 'name', + '#elem3', + false, + 'element-name' ); - it('Should test if the element does not have a width of 1px', - () => { - global.browser.getCssProperty.mockReturnValueOnce( - '1px' - ); - - checkProperty(true, 'width', '#elem2', true, '1px', done); - - _expect(global.browser.getCssProperty).toHaveBeenCalledTimes(1); - _expect(global.browser.getCssProperty) - .toHaveBeenCalledWith( - '#elem2', - 'width' - ); - - _expect(global.browser.getAttribute).not.toHaveBeenCalled(); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - '1px', - 'CSS attribute of element "#elem2" should not ' + - 'contain "1px"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); + _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); + _expect(global.browser.getAttribute) + .toHaveBeenCalledWith( + '#elem3', + 'name' + ); + + _expect(global.browser.getCssProperty).not.toHaveBeenCalled(); - it('Should test if the element has the correct name', - () => { - checkProperty( - false, - 'name', - '#elem3', - false, - 'element-name', - done - ); - - _expect(global.browser.getAttribute).toHaveBeenCalledTimes(1); - _expect(global.browser.getAttribute) - .toHaveBeenCalledWith( - '#elem3', - 'name' - ); - - _expect(global.browser.getCssProperty).not.toHaveBeenCalled(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual).toHaveBeenCalledWith( - 'element-name', - 'Attribute of element "#elem3" should not contain ' + - '"element-name", but "element-name"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual).toHaveBeenCalledWith( + 'element-name', + 'Attribute of element "#elem3" should not contain ' + + '"element-name", but "element-name"' ); - } -); + }); +}); diff --git a/test/support/check/checkSelected.spec.js b/test/support/check/checkSelected.spec.js index a6523933..35b155db 100644 --- a/test/support/check/checkSelected.spec.js +++ b/test/support/check/checkSelected.spec.js @@ -1,69 +1,56 @@ import checkSelected from 'src/support/check/checkSelected'; -describe( - 'checkSelected', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - isSelected: jest.fn(() => ({ - value: 'black', - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkSelected', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + isSelected: jest.fn(() => ({ + value: 'black', + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element is selected', - () => { - checkSelected('#elem1', false, done); - - _expect(global.browser.isSelected).toHaveBeenCalledTimes(1); - _expect(global.browser.isSelected) - .toHaveBeenCalledWith('#elem1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - true, - '"#elem1" should be selected' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the element is not selected', - () => { - checkSelected('#elem2', true, done); - - _expect(global.browser.isSelected).toHaveBeenCalledTimes(1); - _expect(global.browser.isSelected) - .toHaveBeenCalledWith('#elem2'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - true, - '"#elem2" should not be selected' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element is selected', () => { + checkSelected('#elem1', false); + + _expect(global.browser.isSelected).toHaveBeenCalledTimes(1); + _expect(global.browser.isSelected) + .toHaveBeenCalledWith('#elem1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + true, + '"#elem1" should be selected' + ); + }); + + it('Should test if the element is not selected', () => { + checkSelected('#elem2', true); + + _expect(global.browser.isSelected).toHaveBeenCalledTimes(1); + _expect(global.browser.isSelected) + .toHaveBeenCalledWith('#elem2'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + true, + '"#elem2" should not be selected' + ); + }); +}); diff --git a/test/support/check/checkTitle.spec.js b/test/support/check/checkTitle.spec.js index 230deb7e..06bc0f19 100644 --- a/test/support/check/checkTitle.spec.js +++ b/test/support/check/checkTitle.spec.js @@ -1,66 +1,53 @@ import checkTitle from 'src/support/check/checkTitle'; -describe( - 'checkTitle', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getTitle: jest.fn(() => 'page title'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkTitle', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getTitle: jest.fn(() => 'page title'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the title matches the given text', - () => { - checkTitle(false, 'page title', done); - - _expect(global.browser.getTitle).toHaveBeenCalledTimes(1); - _expect(global.browser.getTitle).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'page title', - 'Expected title to be "page title" but found ' + - '"page title"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the title does not match the given text', - () => { - checkTitle(true, 'page title', done); - - _expect(global.browser.getTitle).toHaveBeenCalledTimes(1); - _expect(global.browser.getTitle).toHaveBeenCalledWith(); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'page title', - 'Expected title not to be "page title"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the title matches the given text', () => { + checkTitle(false, 'page title'); + + _expect(global.browser.getTitle).toHaveBeenCalledTimes(1); + _expect(global.browser.getTitle).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'page title', + 'Expected title to be "page title" but found ' + + '"page title"' + ); + }); + + it('Should test if the title does not match the given text', () => { + checkTitle(true, 'page title'); + + _expect(global.browser.getTitle).toHaveBeenCalledTimes(1); + _expect(global.browser.getTitle).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'page title', + 'Expected title not to be "page title"' + ); + }); +}); diff --git a/test/support/check/checkURL.spec.js b/test/support/check/checkURL.spec.js index d3464092..fd294ef4 100644 --- a/test/support/check/checkURL.spec.js +++ b/test/support/check/checkURL.spec.js @@ -1,68 +1,58 @@ import checkURL from 'src/support/check/checkURL'; -describe( - 'checkURL', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - url: jest.fn(() => ({ - value: 'http://www.example.com/test', - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkURL', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + url: jest.fn(() => ({ + value: 'http://www.example.com/test', + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the current URL matches the expected value', - () => { - checkURL(false, 'http://www.example.com/test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'http://www.example.com/test', - 'expected url to be "http://www.example.com/test" ' + - 'but found "http://www.example.com/test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the current URL does not match the expected value', - () => { - checkURL(true, 'http://www.example.com/test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'http://www.example.com/test', - 'expected url not to be "http://www.example.com/test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the current URL matches the expected value', () => { + checkURL(false, 'http://www.example.com/test'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'http://www.example.com/test', + 'expected url to be "http://www.example.com/test" ' + + 'but found "http://www.example.com/test"' + ); + }); + + it( + 'Should test if the current URL doesn\'t match the expected value', + () => { + checkURL(true, 'http://www.example.com/test'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'http://www.example.com/test', + 'expected url not to be "http://www.example.com/test"' + ); + } + ); +}); diff --git a/test/support/check/checkURLPath.spec.js b/test/support/check/checkURLPath.spec.js index d586b043..5cabfa11 100644 --- a/test/support/check/checkURLPath.spec.js +++ b/test/support/check/checkURLPath.spec.js @@ -1,89 +1,72 @@ import checkURLPath from 'src/support/check/checkURLPath'; -describe( - 'checkURLPath', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - url: jest.fn(() => ({ - value: 'http://example.com/test', - })), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkURLPath', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + url: jest.fn(() => ({ + value: 'http://example.com/test', + })), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the URL path matches the given value', () => { + checkURLPath(false, 'test'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'test', + 'expected path to be "test" but found "/test"' + ); + }); + + it('Should test if the URL path does not match the given value', () => { + checkURLPath(true, 'test'); + + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'test', + 'expected path not to be "/test"' + ); + }); + + it('Should replace the domain from the current url', () => { + global.browser.url.mockReturnValueOnce({ + value: 'http://www.example.com/test', }); - it('Should test if the URL path matches the given value', - () => { - checkURLPath(false, 'test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'test', - 'expected path to be "test" but found "/test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the URL path does not match the given value', - () => { - checkURLPath(true, 'test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'test', - 'expected path not to be "/test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should replace the domain from the current url', - () => { - global.browser.url.mockReturnValueOnce({ - value: 'http://www.example.com/test', - }); - - checkURLPath(true, 'test', done); - - _expect(global.browser.url).toHaveBeenCalledTimes(1); - _expect(global.browser.url).toHaveBeenCalledWith(); + checkURLPath(true, 'test'); - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'test', - 'expected path not to be "/test"' - ); + _expect(global.browser.url).toHaveBeenCalledTimes(1); + _expect(global.browser.url).toHaveBeenCalledWith(); - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'test', + 'expected path not to be "/test"' + ); + }); +}); diff --git a/test/support/check/checkWithinViewport.spec.js b/test/support/check/checkWithinViewport.spec.js index 131a5b3f..1787a6dd 100644 --- a/test/support/check/checkWithinViewport.spec.js +++ b/test/support/check/checkWithinViewport.spec.js @@ -1,73 +1,60 @@ import checkWithinViewport from 'src/support/check/checkWithinViewport'; -describe( - 'checkWithinViewport', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - isVisibleWithinViewport: jest.fn(() => true), - }; - - browser.options = { - baseisVisibleWithinViewport: 'http://www.example.com/', - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('checkWithinViewport', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + isVisibleWithinViewport: jest.fn(() => true), + }; + + browser.options = { + baseisVisibleWithinViewport: 'http://www.example.com/', + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element is visible within the viewport', - () => { - checkWithinViewport('#elem1', false, done); - - _expect(global.browser.isVisibleWithinViewport) - .toHaveBeenCalledTimes(1); - _expect(global.browser.isVisibleWithinViewport) - .toHaveBeenCalledWith('#elem1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem1" to be inside the viewport' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the element is not visible within the viewport', - () => { - checkWithinViewport('#elem2', true, done); - - _expect(global.browser.isVisibleWithinViewport) - .toHaveBeenCalledTimes(1); - _expect(global.browser.isVisibleWithinViewport) - .toHaveBeenCalledWith('#elem2'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem2" to be outside the viewport' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element is visible within the viewport', () => { + checkWithinViewport('#elem1', false); + + _expect(global.browser.isVisibleWithinViewport) + .toHaveBeenCalledTimes(1); + _expect(global.browser.isVisibleWithinViewport) + .toHaveBeenCalledWith('#elem1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem1" to be inside the viewport' + ); + }); + + it('Should test if the element is not visible within the viewport', () => { + checkWithinViewport('#elem2', true); + + _expect(global.browser.isVisibleWithinViewport) + .toHaveBeenCalledTimes(1); + _expect(global.browser.isVisibleWithinViewport) + .toHaveBeenCalledWith('#elem2'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem2" to be outside the viewport' + ); + }); +}); diff --git a/test/support/check/compareText.spec.js b/test/support/check/compareText.spec.js index 918558de..eff8a2b9 100644 --- a/test/support/check/compareText.spec.js +++ b/test/support/check/compareText.spec.js @@ -1,67 +1,54 @@ import compareText from 'src/support/check/compareText'; -describe( - 'compareText', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - getText: jest.fn(() => 'test'), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('compareText', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + getText: jest.fn(() => 'test'), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the text of the given element is the same', - () => { - compareText('#elem1', false, '#elem2', done); - - _expect(global.browser.getText).toHaveBeenCalledTimes(2); - _expect(global.browser.getText).toHaveBeenCalledWith('#elem1'); - _expect(global.browser.getText).toHaveBeenCalledWith('#elem2'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - 'test', - 'Expected text to be "test" but found "test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the text of the given element is not the same', - () => { - compareText('#elem3', true, '#elem4', done); - - _expect(global.browser.getText).toHaveBeenCalledTimes(2); - _expect(global.browser.getText).toHaveBeenCalledWith('#elem3'); - _expect(global.browser.getText).toHaveBeenCalledWith('#elem4'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - 'test', - 'Expected text not to be "test"' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the text of the given element is the same', () => { + compareText('#elem1', false, '#elem2'); + + _expect(global.browser.getText).toHaveBeenCalledTimes(2); + _expect(global.browser.getText).toHaveBeenCalledWith('#elem1'); + _expect(global.browser.getText).toHaveBeenCalledWith('#elem2'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + 'test', + 'Expected text to be "test" but found "test"' + ); + }); + + it('Should test if the text of the given element is not the same', () => { + compareText('#elem3', true, '#elem4'); + + _expect(global.browser.getText).toHaveBeenCalledTimes(2); + _expect(global.browser.getText).toHaveBeenCalledWith('#elem3'); + _expect(global.browser.getText).toHaveBeenCalledWith('#elem4'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + 'test', + 'Expected text not to be "test"' + ); + }); +}); diff --git a/test/support/check/isEnabled.spec.js b/test/support/check/isEnabled.spec.js index 4defcb67..825765ce 100644 --- a/test/support/check/isEnabled.spec.js +++ b/test/support/check/isEnabled.spec.js @@ -1,67 +1,54 @@ import isEnabled from 'src/support/check/isEnabled'; -describe( - 'isEnabled', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - isEnabled: jest.fn(() => true), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('isEnabled', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + isEnabled: jest.fn(() => true), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element is enabled', - () => { - isEnabled('#elem1', false, done); - - _expect(global.browser.isEnabled).toHaveBeenCalledTimes(1); - _expect(global.browser.isEnabled) - .toHaveBeenCalledWith('#elem1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem1" to be enabled' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the element is not enabled', - () => { - isEnabled('#elem2', true, done); - - _expect(global.browser.isEnabled).toHaveBeenCalledTimes(1); - _expect(global.browser.isEnabled) - .toHaveBeenCalledWith('#elem2'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem2" not to be enabled' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element is enabled', () => { + isEnabled('#elem1', false); + + _expect(global.browser.isEnabled).toHaveBeenCalledTimes(1); + _expect(global.browser.isEnabled) + .toHaveBeenCalledWith('#elem1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem1" to be enabled' + ); + }); + + it('Should test if the element is not enabled', () => { + isEnabled('#elem2', true); + + _expect(global.browser.isEnabled).toHaveBeenCalledTimes(1); + _expect(global.browser.isEnabled) + .toHaveBeenCalledWith('#elem2'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem2" not to be enabled' + ); + }); +}); diff --git a/test/support/check/isExisting.spec.js b/test/support/check/isExisting.spec.js index 42b957b4..bef63d58 100644 --- a/test/support/check/isExisting.spec.js +++ b/test/support/check/isExisting.spec.js @@ -1,69 +1,56 @@ import isExisting from 'src/support/check/isExisting'; -describe( - 'isExisting', () => { - let done; - let expectToHaveLengthAbove; - let expectToHaveLengthOf; - - beforeEach(() => { - global.browser = { - elements: jest.fn(() => ({ - value: ['1'], - })), - }; - - expectToHaveLengthAbove = jest.fn(); - expectToHaveLengthOf = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - have: { - length: { - above: expectToHaveLengthAbove, - }, - lengthOf: expectToHaveLengthOf, +describe('isExisting', () => { + let expectToHaveLengthAbove; + let expectToHaveLengthOf; + + beforeEach(() => { + global.browser = { + elements: jest.fn(() => ({ + value: ['1'], + })), + }; + + expectToHaveLengthAbove = jest.fn(); + expectToHaveLengthOf = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + have: { + length: { + above: expectToHaveLengthAbove, }, + lengthOf: expectToHaveLengthOf, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element exists', - () => { - isExisting('#elem1', false, done); - - _expect(global.browser.elements).toHaveBeenCalledTimes(1); - _expect(global.browser.elements).toHaveBeenCalledWith('#elem1'); - - _expect(expectToHaveLengthAbove).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthAbove) - .toHaveBeenCalledWith( - 0, - 'Expected element "#elem1" to exist' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the element does not exist', - () => { - isExisting('#elem2', true, done); - - _expect(global.browser.elements).toHaveBeenCalledTimes(1); - _expect(global.browser.elements).toHaveBeenCalledWith('#elem2'); - - _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); - _expect(expectToHaveLengthOf) - .toHaveBeenCalledWith( - 0, - 'Expected element "#elem2" not to exist' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + }, + })); + }); + + it('Should test if the element exists', () => { + isExisting('#elem1', false); + + _expect(global.browser.elements).toHaveBeenCalledTimes(1); + _expect(global.browser.elements).toHaveBeenCalledWith('#elem1'); + + _expect(expectToHaveLengthAbove).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthAbove) + .toHaveBeenCalledWith( + 0, + 'Expected element "#elem1" to exist' + ); + }); + + it('Should test if the element does not exist', () => { + isExisting('#elem2', true); + + _expect(global.browser.elements).toHaveBeenCalledTimes(1); + _expect(global.browser.elements).toHaveBeenCalledWith('#elem2'); + + _expect(expectToHaveLengthOf).toHaveBeenCalledTimes(1); + _expect(expectToHaveLengthOf) + .toHaveBeenCalledWith( + 0, + 'Expected element "#elem2" not to exist' + ); + }); +}); diff --git a/test/support/check/isVisible.spec.js b/test/support/check/isVisible.spec.js index 67ea8e23..c12d7b25 100644 --- a/test/support/check/isVisible.spec.js +++ b/test/support/check/isVisible.spec.js @@ -1,67 +1,54 @@ import isVisible from 'src/support/check/isVisible'; -describe( - 'isVisible', () => { - let done; - let expectToEqual; - let expectToNotEqual; - - beforeEach(() => { - global.browser = { - isVisible: jest.fn(() => true), - }; - - expectToEqual = jest.fn(); - expectToNotEqual = jest.fn(); - - global.expect = jest.fn(() => ({ - to: { - not: { - equal: expectToNotEqual, - }, - equal: expectToEqual, +describe('isVisible', () => { + let expectToEqual; + let expectToNotEqual; + + beforeEach(() => { + global.browser = { + isVisible: jest.fn(() => true), + }; + + expectToEqual = jest.fn(); + expectToNotEqual = jest.fn(); + + global.expect = jest.fn(() => ({ + to: { + not: { + equal: expectToNotEqual, }, - })); - - done = jest.fn(); - }); - - it('Should test if the element is visible', - () => { - isVisible('#elem1', false, done); - - _expect(global.browser.isVisible).toHaveBeenCalled(); - _expect(global.browser.isVisible) - .toHaveBeenCalledWith('#elem1'); - - _expect(expectToEqual).toHaveBeenCalledTimes(1); - _expect(expectToEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem1" to be visible' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - - it('Should test if the element is not visible', - () => { - isVisible('#elem2', true, done); - - _expect(global.browser.isVisible).toHaveBeenCalledTimes(1); - _expect(global.browser.isVisible) - .toHaveBeenCalledWith('#elem2'); - - _expect(expectToNotEqual).toHaveBeenCalledTimes(1); - _expect(expectToNotEqual) - .toHaveBeenCalledWith( - true, - 'Expected element "#elem2" not to be visible' - ); - - _expect(done).toHaveBeenCalledTimes(1); - } - ); - } -); + equal: expectToEqual, + }, + })); + }); + + it('Should test if the element is visible', () => { + isVisible('#elem1', false); + + _expect(global.browser.isVisible).toHaveBeenCalled(); + _expect(global.browser.isVisible) + .toHaveBeenCalledWith('#elem1'); + + _expect(expectToEqual).toHaveBeenCalledTimes(1); + _expect(expectToEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem1" to be visible' + ); + }); + + it('Should test if the element is not visible', () => { + isVisible('#elem2', true); + + _expect(global.browser.isVisible).toHaveBeenCalledTimes(1); + _expect(global.browser.isVisible) + .toHaveBeenCalledWith('#elem2'); + + _expect(expectToNotEqual).toHaveBeenCalledTimes(1); + _expect(expectToNotEqual) + .toHaveBeenCalledWith( + true, + 'Expected element "#elem2" not to be visible' + ); + }); +}); diff --git a/wdio.conf.js b/wdio.conf.js index a2a4dc8b..f838ef3b 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -123,35 +123,48 @@ exports.config = { // If you are using Cucumber you need to specify the location of your step // definitions. cucumberOpts: { + // show full backtrace for errors + backtrace: false, + // filetype:compiler used for processing required features + compiler: [ + 'js:babel-register', + ], + // invoke formatters without executing steps + // dryRun: false, + // abort the run on first failure + failFast: false, + // Enable this config to treat undefined definitions as + // warnings + ignoreUndefinedDefinitions: false, + // ("extension:module") require files with the given + // EXTENSION after requiring MODULE (repeatable) + name: [], + // hide step definition snippets for pending steps + snippets: true, + // hide source uris + source: true, + // (name) specify the profile to use + profile: [], + // (file/dir) require files before executing features require: [ './src/steps/given.js', './src/steps/then.js', './src/steps/when.js', - ], // (file/dir) require files before executing features - backtrace: false, // show full backtrace for errors - compiler: [ - 'js:babel-register', - ], // ("extension:module") require files with the given - // EXTENSION after requiring MODULE (repeatable) - dryRun: false, // invoke formatters without executing steps - failFast: false, // abort the run on first failure - format: ['pretty'], // (type[:path]) specify the output - // format, optionally supply PATH to redirect - // formatter output (repeatable) - colors: true, // disable colors in formatter output - snippets: true, // hide step definition snippets for pending - // steps - source: true, // hide source uris - profile: [], // (name) specify the profile to use - strict: true, // fail if there are any undefined or pending - // steps - tags: require('./src/tagProcessor')(process.argv), - // (expression) only execute the features or scenarios with - // tags matching the expression - timeout: 20000, // timeout for step definitions - ignoreUndefinedDefinitions: false, // Enable this config to - // treat undefined definitions as - // warnings. + ], + // specify a custom snippet syntax + snippetSyntax: undefined, + // fail if there are any undefined or pending steps + strict: true, + // (expression) only execute the features or scenarios with + // tags matching the expression, see + // https://docs.cucumber.io/tag-expressions/ + tagExpression: 'not @pending', + // add cucumber tags to feature or scenario name + tagsInTitle: false, + // timeout for step definitions + timeout: 20000, }, // From d8619530e1161a749e3027c869ee6b77f749348e Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:05:43 +0200 Subject: [PATCH 06/15] Removed no longer needed tagprocessor --- src/tagProcessor.js | 30 ------------------------------ test/tagProcessor.spec.js | 22 ---------------------- 2 files changed, 52 deletions(-) delete mode 100644 src/tagProcessor.js delete mode 100644 test/tagProcessor.spec.js diff --git a/src/tagProcessor.js b/src/tagProcessor.js deleted file mode 100644 index 1ca9e54c..00000000 --- a/src/tagProcessor.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Parse the tags from the CLI to pass to Cucumber - * @param {Object} consoleArguments The arguments to parse from the console - * @return {Array} The tags to process - */ -module.exports = (consoleArguments) => { - // This is required since this file is not parsed with Babel - - 'use strict'; - - /** - * The tags to pass to the cucumber options - * @type {Array} - */ - let tags = ['~@Pending']; // Always ignore @Pending tags - - consoleArguments.forEach((val) => { - if (val.indexOf('--tags=') === 0) { - /** - * The collected tags from the CLI param - * @type {String} - */ - const collectedTags = val.replace('--tags=', ''); - - tags = tags.concat(collectedTags); - } - }); - - return tags; -}; diff --git a/test/tagProcessor.spec.js b/test/tagProcessor.spec.js deleted file mode 100644 index 29502e4a..00000000 --- a/test/tagProcessor.spec.js +++ /dev/null @@ -1,22 +0,0 @@ -import tagProcessor from 'src/tagProcessor'; - -describe('tagProcessor', - () => { - it('should return ["~@Pending"] by default', () => { - const result = tagProcessor([]); - - expect(result).toEqual(['~@Pending']); - }); - - it('should add tags from the command line', () => { - const result = tagProcessor(['--tags=@Tag1']); - - expect(result).toEqual(['~@Pending', '@Tag1']); - }); - - it('should not react on other arguments from the command line', () => { - const result = tagProcessor(['--test=@Test']); - - expect(result).toEqual(['~@Pending']); - }); - }); From c972cfc00bd1dabe46a17d3931f83af3840f8f1d Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:06:04 +0200 Subject: [PATCH 07/15] Updated yarn.lock file --- yarn.lock | 493 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 384 insertions(+), 109 deletions(-) diff --git a/yarn.lock b/yarn.lock index 83f62454..3b735718 100644 --- a/yarn.lock +++ b/yarn.lock @@ -26,9 +26,9 @@ acorn@^4.0.4: version "4.0.11" resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.11.tgz#edcda3bd937e7556410d42ed5860f67399c794c0" -acorn@^5.0.1: - version "5.0.3" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d" +acorn@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.1.tgz#53fe161111f912ab999ee887a90a0bc52822fd75" ajv-keywords@^1.0.0: version "1.5.1" @@ -94,6 +94,10 @@ ansi-styles@^3.1.0: dependencies: color-convert "^1.0.0" +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + anymatch@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.0.tgz#a3e52fa39168c825ff57b0248126ce5a8ff95507" @@ -182,6 +186,14 @@ assert-plus@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-0.2.0.tgz#d74e1b87e7affc0db8aadb7021f3fe48101ab234" +assertion-error-formatter@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/assertion-error-formatter/-/assertion-error-formatter-2.0.0.tgz#17a24289cc8440889b54318e6d1187ebee2d5494" + dependencies: + diff "^3.0.0" + pad-right "^0.2.2" + repeat-string "^1.6.1" + assertion-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" @@ -220,6 +232,14 @@ babel-code-frame@^6.22.0: esutils "^2.0.2" js-tokens "^3.0.0" +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + babel-core@^6.0.0, babel-core@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.24.1.tgz#8c428564dce1e1f41fb337ec34f4c3b022b5ad83" @@ -244,6 +264,30 @@ babel-core@^6.0.0, babel-core@^6.24.1: slash "^1.0.0" source-map "^0.5.0" +babel-core@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + babel-generator@^6.18.0, babel-generator@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.24.1.tgz#e715f486c58ded25649d888944d52aa07c5d9497" @@ -257,6 +301,19 @@ babel-generator@^6.18.0, babel-generator@^6.24.1: source-map "^0.5.0" trim-right "^1.0.1" +babel-generator@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.0.tgz#ac1ae20070b79f6e3ca1d3269613053774f20dc5" + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.6" + trim-right "^1.0.1" + babel-helper-call-delegate@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" @@ -545,13 +602,13 @@ babel-plugin-transform-strict-mode@^6.24.1: babel-runtime "^6.22.0" babel-types "^6.24.1" -babel-polyfill@~6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.23.0.tgz#8364ca62df8eafb830499f699177466c3b03499d" +babel-polyfill@~6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" dependencies: - babel-runtime "^6.22.0" - core-js "^2.4.0" - regenerator-runtime "^0.10.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" babel-preset-es2015@~6.24.0: version "6.24.1" @@ -588,7 +645,7 @@ babel-preset-jest@^20.0.3: dependencies: babel-plugin-jest-hoist "^20.0.3" -babel-register@^6.24.1, babel-register@~6.24.0: +babel-register@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.24.1.tgz#7e10e13a2f71065bdfad5a1787ba45bca6ded75f" dependencies: @@ -600,13 +657,39 @@ babel-register@^6.24.1, babel-register@~6.24.0: mkdirp "^0.5.1" source-map-support "^0.4.2" -babel-runtime@6.23.0, babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@~6.23.0: +babel-register@^6.26.0, babel-register@~6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@6.25.0, babel-runtime@^6.11.6, babel-runtime@~6.25.0: + version "6.25.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.25.0.tgz#33b98eaa5d482bb01a8d1aa6b437ad2b01aec41c" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.10.0" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@~6.23.0: version "6.23.0" resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" dependencies: core-js "^2.4.0" regenerator-runtime "^0.10.0" +babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + babel-template@^6.16.0, babel-template@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.24.1.tgz#04ae514f1f93b3a2537f2a0f60a5a45fb8308333" @@ -617,6 +700,16 @@ babel-template@^6.16.0, babel-template@^6.24.1: babylon "^6.11.0" lodash "^4.2.0" +babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + babel-traverse@^6.18.0, babel-traverse@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.24.1.tgz#ab36673fd356f9a0948659e7b338d5feadb31695" @@ -631,6 +724,20 @@ babel-traverse@^6.18.0, babel-traverse@^6.24.1: invariant "^2.2.0" lodash "^4.2.0" +babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1: version "6.24.1" resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.24.1.tgz#a136879dc15b3606bda0d90c1fc74304c2ff0975" @@ -640,10 +747,23 @@ babel-types@^6.18.0, babel-types@^6.19.0, babel-types@^6.24.1: lodash "^4.2.0" to-fast-properties "^1.0.1" +babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + babylon@^6.11.0, babylon@^6.13.0, babylon@^6.15.0: version "6.17.1" resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.1.tgz#17f14fddf361b695981fe679385e4f1c01ebd86f" +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + balanced-match@^0.4.1: version "0.4.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" @@ -654,12 +774,20 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +becke-ch--regex--s0-0-v1--base--pl--lib@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.2.0.tgz#2e73e9d21f2c2e6f5a5454045636f0ab93e46130" + bl@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e" dependencies: readable-stream "^2.0.5" +bluebird@^3.4.1: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" + boom@2.x.x: version "2.10.1" resolved "https://registry.yarnpkg.com/boom/-/boom-2.10.1.tgz#39c8918ceff5799f83f9492a848f625add0c766f" @@ -755,13 +883,13 @@ center-align@^0.1.1: align-text "^0.1.3" lazy-cache "^1.0.3" -chai@~4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.0.tgz#331a0391b55c3af8740ae9c3b7458bc1c3805e6d" +chai@~4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chai/-/chai-4.1.2.tgz#0f64584ba642f0f2ace2806279f4f06ca23ad73c" dependencies: assertion-error "^1.0.1" check-error "^1.0.1" - deep-eql "^2.0.1" + deep-eql "^3.0.0" get-func-name "^2.0.0" pathval "^1.0.0" type-detect "^4.0.0" @@ -784,6 +912,14 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^4.0.0" +chalk@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.1.0.tgz#ac5becf14fa21b99c6c92ca7a7d7cfd5b17e743e" + dependencies: + ansi-styles "^3.1.0" + escape-string-regexp "^1.0.5" + supports-color "^4.0.0" + change-case@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/change-case/-/change-case-3.0.1.tgz#ee5f5ad0415ad1ad9e8072cf49cd4cfa7660a554" @@ -933,7 +1069,7 @@ content-type-parser@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/content-type-parser/-/content-type-parser-1.0.1.tgz#c3e56988c53c65127fb46d4032a3a900246fdc94" -convert-source-map@^1.1.0, convert-source-map@^1.4.0: +convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" @@ -941,7 +1077,11 @@ core-js@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" -core-util-is@~1.0.0: +core-js@^2.5.0: + version "2.5.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.1.tgz#ae6874dc66937789b80754ff5428df66819ca50b" + +core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -1003,23 +1143,80 @@ cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": dependencies: cssom "0.3.x" -cucumber@~1.3.1: - version "1.3.3" - resolved "https://registry.yarnpkg.com/cucumber/-/cucumber-1.3.3.tgz#65afb65f2f93f72dad78df2ab5eacf14609fec2f" +cucumber-expressions@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cucumber-expressions/-/cucumber-expressions-3.0.0.tgz#4cf424813dae396cc9dab714b8104b459befc32c" + +cucumber-expressions@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/cucumber-expressions/-/cucumber-expressions-4.0.3.tgz#fc70d1a94e1959c9fd555a41b7e2200e57ac33a7" dependencies: - camel-case "^3.0.0" + becke-ch--regex--s0-0-v1--base--pl--lib "^1.2.0" + +cucumber-tag-expressions@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cucumber-tag-expressions/-/cucumber-tag-expressions-1.0.1.tgz#d6d3c43180a03f5fb4fc957fe1382ddce5cb9ac8" + +cucumber@~2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/cucumber/-/cucumber-2.3.1.tgz#3791a51ffd0c61462ad57fdb8ed111d55b51cde3" + dependencies: + assertion-error-formatter "^2.0.0" + babel-runtime "^6.11.6" + bluebird "^3.4.1" cli-table "^0.3.1" - co "^4.6.0" colors "^1.1.2" commander "^2.9.0" + cucumber-expressions "^3.0.0" + cucumber-tag-expressions "^1.0.0" duration "^0.2.0" - figures "1.7.0" + figures "2.0.0" gherkin "^4.1.0" glob "^7.0.0" + indent-string "^3.1.0" is-generator "^1.0.2" + is-stream "^1.1.0" lodash "^4.0.0" + mz "^2.4.0" + progress "^2.0.0" + resolve "^1.3.3" stack-chain "^1.3.5" - stacktrace-js "^1.3.0" + stacktrace-js "^2.0.0" + string-argv "0.0.2" + upper-case-first "^1.1.2" + util-arity "^1.0.2" + verror "^1.9.0" + +cucumber@~3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/cucumber/-/cucumber-3.0.1.tgz#2e4f49ee9d5949cb6249ae0cd1626444457be71e" + dependencies: + assertion-error-formatter "^2.0.0" + babel-runtime "^6.11.6" + bluebird "^3.4.1" + cli-table "^0.3.1" + colors "^1.1.2" + commander "^2.9.0" + cucumber-expressions "^4.0.3" + cucumber-tag-expressions "^1.0.0" + duration "^0.2.0" + escape-string-regexp "^1.0.5" + figures "2.0.0" + gherkin "^4.1.0" + glob "^7.0.0" + indent-string "^3.1.0" + is-generator "^1.0.2" + is-stream "^1.1.0" + lodash "^4.0.0" + mz "^2.4.0" + progress "^2.0.0" + resolve "^1.3.3" + stack-chain "^1.3.5" + stacktrace-js "^2.0.0" + string-argv "0.0.2" + title-case "^2.1.1" + util-arity "^1.0.2" + verror "^1.9.0" d@1: version "1.0.0" @@ -1059,11 +1256,11 @@ decamelize@^1.0.0, decamelize@^1.1.1: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" -deep-eql@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-2.0.2.tgz#b1bac06e56f0a76777686d50c9feb75c2ed7679a" +deep-eql@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.0.tgz#b9162a49cf4b54d911425975ac95d03e56448471" dependencies: - type-detect "^3.0.0" + type-detect "^4.0.0" deep-is@~0.1.3: version "0.1.3" @@ -1108,6 +1305,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +diff@^3.0.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/diff/-/diff-3.3.0.tgz#056695150d7aa93237ca7e378ac3b1682b7963b9" + diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" @@ -1176,11 +1377,11 @@ error-ex@^1.2.0: dependencies: is-arrayish "^0.2.1" -error-stack-parser@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-1.3.6.tgz#e0e73b93e417138d1cd7c0b746b1a4a14854c292" +error-stack-parser@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/error-stack-parser/-/error-stack-parser-2.0.1.tgz#a3202b8fb03114aa9b40a0e3669e48b2b65a010a" dependencies: - stackframe "^0.3.1" + stackframe "^1.0.3" es5-ext@^0.10.14, es5-ext@^0.10.9, es5-ext@~0.10.14, es5-ext@~0.10.2: version "0.10.16" @@ -1223,9 +1424,11 @@ escodegen@^1.6.1: optionalDependencies: source-map "~0.2.0" -eslint-config-airbnb-base@~11.2.0: - version "11.2.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.2.0.tgz#19a9dc4481a26f70904545ec040116876018f853" +eslint-config-airbnb-base@~12.0.0: + version "12.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-12.0.0.tgz#99063aaef4b8698083481a00e165cbe15e82d615" + dependencies: + eslint-restricted-globals "^0.1.1" eslint-import-resolver-node@^0.3.1: version "0.3.1" @@ -1256,6 +1459,10 @@ eslint-plugin-import@~2.7.0: minimatch "^3.0.3" read-pkg-up "^2.0.0" +eslint-restricted-globals@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -1263,29 +1470,31 @@ eslint-scope@^3.7.1: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint@~4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.2.0.tgz#a2b3184111b198e02e9c7f3cca625a5e01c56b3d" +eslint@~4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-4.6.0.tgz#98ced4a706a87abbe63207895d0023a38e250bbe" dependencies: ajv "^5.2.0" babel-code-frame "^6.22.0" - chalk "^1.1.3" + chalk "^2.1.0" concat-stream "^1.6.0" + cross-spawn "^5.1.0" debug "^2.6.8" doctrine "^2.0.0" eslint-scope "^3.7.1" - espree "^3.4.3" + espree "^3.5.0" esquery "^1.0.0" estraverse "^4.2.0" esutils "^2.0.2" file-entry-cache "^2.0.0" + functional-red-black-tree "^1.0.1" glob "^7.1.2" globals "^9.17.0" ignore "^3.3.3" imurmurhash "^0.1.4" inquirer "^3.0.6" is-resolvable "^1.0.0" - js-yaml "^3.8.4" + js-yaml "^3.9.1" json-stable-stringify "^1.0.1" levn "^0.3.0" lodash "^4.17.4" @@ -1297,15 +1506,17 @@ eslint@~4.2.0: pluralize "^4.0.0" progress "^2.0.0" require-uncached "^1.0.3" + semver "^5.3.0" + strip-ansi "^4.0.0" strip-json-comments "~2.0.1" table "^4.0.1" text-table "~0.2.0" -espree@^3.4.3: - version "3.4.3" - resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374" +espree@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.0.tgz#98358625bdd055861ea27e2867ea729faf463d8d" dependencies: - acorn "^5.0.1" + acorn "^5.1.1" acorn-jsx "^3.0.0" esprima@^2.7.1: @@ -1408,6 +1619,10 @@ extsprintf@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.0.2.tgz#e1080e0658e300b06294990cc70e1502235fd550" +extsprintf@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" + fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" @@ -1434,18 +1649,11 @@ fd-slicer@~1.0.1: dependencies: pend "~1.2.0" -fibers@~1.0.15: - version "1.0.15" - resolved "https://registry.yarnpkg.com/fibers/-/fibers-1.0.15.tgz#22f039c8f18b856190fbbe4decf056154c1eae9c" - -figures@1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" - dependencies: - escape-string-regexp "^1.0.5" - object-assign "^4.1.0" +fibers@~2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fibers/-/fibers-2.0.0.tgz#f26d0aaf1f99995fbe1cb3f340efac08bda9dc4b" -figures@^2.0.0: +figures@2.0.0, figures@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" dependencies: @@ -1553,6 +1761,10 @@ function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + gaze@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.2.tgz#847224677adb8870d679257ed3388fdb61e40105" @@ -1626,7 +1838,7 @@ globals@^9.0.0: version "9.17.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.17.0.tgz#0c0ca696d9b9bb694d2e5470bd37777caad50286" -globals@^9.17.0: +globals@^9.17.0, globals@^9.18.0: version "9.18.0" resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" @@ -1807,6 +2019,10 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" +indent-string@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" + inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1855,7 +2071,7 @@ inquirer@~3.0.6: strip-ansi "^3.0.0" through "^2.3.6" -invariant@^2.2.0: +invariant@^2.2.0, invariant@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" dependencies: @@ -1988,7 +2204,7 @@ is-resolvable@^1.0.0: dependencies: tryit "^1.0.1" -is-stream@^1.0.1: +is-stream@^1.0.1, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" @@ -2308,6 +2524,10 @@ js-tokens@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + js-yaml@^3.7.0: version "3.8.4" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.8.4.tgz#520b4564f86573ba96662af85a8cafa7b4b5a6f6" @@ -2315,9 +2535,9 @@ js-yaml@^3.7.0: argparse "^1.0.7" esprima "^3.1.1" -js-yaml@^3.8.4: - version "3.9.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.0.tgz#4ffbbf25c2ac963b8299dc74da7e3740de1c18ce" +js-yaml@^3.9.1: + version "3.9.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.9.1.tgz#08775cebdfdd359209f0d2acd383c8f86a6904a0" dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -2380,7 +2600,7 @@ json-stringify-safe@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" -json5@^0.5.0: +json5@^0.5.0, json5@^0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" @@ -2587,6 +2807,10 @@ mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@~0.5.1: dependencies: minimist "0.0.8" +mockery@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mockery/-/mockery-2.1.0.tgz#5b0aef1ff564f0f8139445e165536c7909713470" + ms@0.7.3: version "0.7.3" resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.3.tgz#708155a5e44e33f5fd0fc53e81d0d40a91be1fff" @@ -2599,6 +2823,14 @@ mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" +mz@^2.4.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.6.0.tgz#c8b8521d958df0a4f2768025db69c719ee4ef1ce" + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -2738,6 +2970,12 @@ p-map@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/p-map/-/p-map-1.1.1.tgz#05f5e4ae97a068371bc2a5cc86bfbdbc19c4ae7a" +pad-right@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/pad-right/-/pad-right-0.2.2.tgz#6fbc924045d244f2a2a244503060d3bfc6009774" + dependencies: + repeat-string "^1.5.2" + param-case@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/param-case/-/param-case-2.1.1.tgz#df94fd8cf6531ecf75e6bef9a0858fbc72be2247" @@ -2786,7 +3024,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -2885,7 +3123,7 @@ pretty-format@^20.0.3: ansi-regex "^2.1.1" ansi-styles "^3.0.0" -private@^0.1.6: +private@^0.1.6, private@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" @@ -3001,10 +3239,14 @@ regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" -regenerator-runtime@^0.10.0: +regenerator-runtime@^0.10.0, regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" +regenerator-runtime@^0.11.0: + version "0.11.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz#7e54fe5b5ccd5d6624ea6255c3473be090b802e1" + regenerator-transform@0.9.11: version "0.9.11" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.9.11.tgz#3a7d067520cb7b7176769eb5ff868691befe1283" @@ -3046,7 +3288,7 @@ repeat-element@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" -repeat-string@^1.5.2: +repeat-string@^1.5.2, repeat-string@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" @@ -3151,6 +3393,12 @@ resolve@^1.2.0, resolve@^1.3.2: dependencies: path-parse "^1.0.5" +resolve@^1.3.3: + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" + dependencies: + path-parse "^1.0.5" + restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -3294,6 +3542,12 @@ source-map-resolve@^0.3.0: source-map-url "~0.3.0" urix "~0.1.0" +source-map-support@^0.4.15: + version "0.4.17" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.17.tgz#6f2150553e6375375d0ccb3180502b78c18ba430" + dependencies: + source-map "^0.5.6" + source-map-support@^0.4.2: version "0.4.15" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" @@ -3363,34 +3617,34 @@ stack-chain@^1.3.5: version "1.3.7" resolved "https://registry.yarnpkg.com/stack-chain/-/stack-chain-1.3.7.tgz#d192c9ff4ea6a22c94c4dd459171e3f00cea1285" -stack-generator@^1.0.7: - version "1.1.0" - resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-1.1.0.tgz#36f6a920751a6c10f499a13c32cbb5f51a0b8b25" +stack-generator@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/stack-generator/-/stack-generator-2.0.2.tgz#3c13d952a596ab9318fec0669d0a1df8b87176c7" dependencies: - stackframe "^1.0.2" + stackframe "^1.0.4" -stackframe@^0.3.1, stackframe@~0.3: - version "0.3.1" - resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-0.3.1.tgz#33aa84f1177a5548c8935533cbfeb3420975f5a4" - -stackframe@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.0.3.tgz#fe64ab20b170e4ce49044b126c119dfa0e5dc7cc" +stackframe@^1.0.3, stackframe@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.0.4.tgz#357b24a992f9427cba6b545d96a14ed2cbca187b" -stacktrace-gps@^2.4.3: - version "2.4.4" - resolved "https://registry.yarnpkg.com/stacktrace-gps/-/stacktrace-gps-2.4.4.tgz#69c827e9d6d6f41cf438d7f195e2e3cbfcf28c44" +stacktrace-gps@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/stacktrace-gps/-/stacktrace-gps-3.0.2.tgz#33f8baa4467323ab2bd1816efa279942ba431ccc" dependencies: source-map "0.5.6" - stackframe "~0.3" + stackframe "^1.0.4" -stacktrace-js@^1.3.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/stacktrace-js/-/stacktrace-js-1.3.1.tgz#67cab2589af5c417b962f7369940277bb3b6a18b" +stacktrace-js@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/stacktrace-js/-/stacktrace-js-2.0.0.tgz#776ca646a95bc6c6b2b90776536a7fc72c6ddb58" dependencies: - error-stack-parser "^1.3.6" - stack-generator "^1.0.7" - stacktrace-gps "^2.4.3" + error-stack-parser "^2.0.1" + stack-generator "^2.0.1" + stacktrace-gps "^3.0.1" + +string-argv@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" string-length@^1.0.1: version "1.0.1" @@ -3521,6 +3775,18 @@ text-table@~0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.0" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.0.tgz#e69e38a1babe969b0108207978b9f62b88604839" + dependencies: + any-promise "^1.0.0" + throat@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/throat/-/throat-3.0.0.tgz#e7c64c867cbb3845f10877642f7b60055b8ec0d6" @@ -3533,7 +3799,7 @@ through@^2.3.6: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -title-case@^2.1.0: +title-case@^2.1.0, title-case@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" dependencies: @@ -3550,7 +3816,7 @@ tmpl@1.0.x: version "1.0.4" resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1" -to-fast-properties@^1.0.1: +to-fast-properties@^1.0.1, to-fast-properties@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" @@ -3592,10 +3858,6 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-3.0.0.tgz#46d0cc8553abb7b13a352b0d6dea2fd58f2d9b55" - type-detect@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.3.tgz#0e3f2670b44099b0b46c284d136a7ef49c74c2ea" @@ -3652,6 +3914,10 @@ url@~0.11.0: punycode "1.3.2" querystring "0.2.0" +util-arity@^1.0.2: + version "1.1.0" + resolved "https://registry.yarnpkg.com/util-arity/-/util-arity-1.1.0.tgz#59d01af1fdb3fede0ac4e632b0ab5f6ce97c9330" + util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" @@ -3677,6 +3943,14 @@ verror@1.3.6: dependencies: extsprintf "1.0.2" +verror@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" + dependencies: + assert-plus "^1.0.0" + core-util-is "1.0.2" + extsprintf "^1.2.0" + walkdir@^0.0.11: version "0.0.11" resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.0.11.tgz#a16d025eb931bd03b52f308caed0f40fcebe9532" @@ -3691,13 +3965,14 @@ watch@~0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/watch/-/watch-0.10.0.tgz#77798b2da0f9910d595f1ace5b0c2258521f21dc" -wdio-cucumber-framework@~0.3.1: - version "0.3.1" - resolved "https://registry.yarnpkg.com/wdio-cucumber-framework/-/wdio-cucumber-framework-0.3.1.tgz#0e45f485870d5b45d1ea9cbef110a44535e4c0c4" +wdio-cucumber-framework@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/wdio-cucumber-framework/-/wdio-cucumber-framework-1.0.1.tgz#0e2268e124d3ab3c0623424229c6cdf05674ab87" dependencies: - babel-runtime "~6.23.0" - cucumber "~1.3.1" - wdio-sync "0.6.14" + babel-runtime "~6.25.0" + cucumber "~2.3.1" + mockery "~2.1.0" + wdio-sync "0.7.0" wdio-dot-reporter@~0.0.8: version "0.0.8" @@ -3717,19 +3992,19 @@ wdio-selenium-standalone-service@~0.0.9: fs-extra "^0.30.0" selenium-standalone "^6.5.0" -wdio-spec-reporter@~0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/wdio-spec-reporter/-/wdio-spec-reporter-0.1.0.tgz#a45310c9ceb3d1c7570ef1124abe75b433c48179" +wdio-spec-reporter@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/wdio-spec-reporter/-/wdio-spec-reporter-0.1.2.tgz#91c6f6097f92ad251cd2b66e388505c4c0e24760" dependencies: - babel-runtime "~6.23.0" + babel-runtime "~6.25.0" humanize-duration "~3.10.0" -wdio-sync@0.6.14: - version "0.6.14" - resolved "https://registry.yarnpkg.com/wdio-sync/-/wdio-sync-0.6.14.tgz#a1dcd5907ba1d04154aae6176c622d910c3ca9b3" +wdio-sync@0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/wdio-sync/-/wdio-sync-0.7.0.tgz#2fb07d250121dc81f5635316542c3c49a1220168" dependencies: - babel-runtime "6.23.0" - fibers "~1.0.15" + babel-runtime "6.25.0" + fibers "~2.0.0" object.assign "^4.0.3" webdriverio@4.7.1: From 608d3862a759feb4babfca82411caa583b704cbe Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:06:26 +0200 Subject: [PATCH 08/15] Fixed ESLint warning for the build config --- wdio.BUILD.conf.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wdio.BUILD.conf.js b/wdio.BUILD.conf.js index 14d7d68e..c7305f0b 100644 --- a/wdio.BUILD.conf.js +++ b/wdio.BUILD.conf.js @@ -1,9 +1,9 @@ -const config = require('./wdio.conf.js').config; +const wdioConfig = require('./wdio.conf.js'); -config.capabilities = [{ +wdioConfig.config.capabilities = [{ browserName: 'phantomjs', }]; -config.services = ['phantomjs']; +wdioConfig.config.services = ['phantomjs']; -exports.config = config; +exports.config = wdioConfig.config; From 9245537632b7528bf922f7fdbfd917451c35a873 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Sun, 3 Sep 2017 20:08:23 +0200 Subject: [PATCH 09/15] added more node versions for Travis Caching Yarn inside Travis Moved to new distro (Tristy) by opt-in --- .travis.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8024d058..a2c8ee5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,18 @@ -notifications: - email: false +dist: trusty language: node_js +cache: yarn + +notifications: + email: false + node_js: - '4' + - '5' + - '6' + - '7' + - '8' env: - CXX=g++-4.8 From 523ea0a44ca5923cdd5cdedaa0dd0872fdbdff43 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Mon, 4 Sep 2017 08:16:15 +0200 Subject: [PATCH 10/15] Implemented `Forever` to start/stop the http-server --- package.json | 5 +- yarn.lock | 531 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 518 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 4f6c7461..5a38367a 100644 --- a/package.json +++ b/package.json @@ -5,9 +5,9 @@ "homepage": "https://github.com/webdriverio/cucumber-boilerplate", "scripts": { "clean": "read -p \"Are you sure you want to clean the project? [y/n] \" REPLY; if [[ $REPLY =~ ^[Yy]$ ]]; then rm -R .git .github demo-app test .codeclimate.yml .travis.yml jest.json wdio.BUILD.conf.js src/features/**; fi", - "local-webserver": "http-server ./demo-app -s", + "local-webserver": "forever start -s ./node_modules/.bin/http-server ./demo-app -s", "test": "npm run test:validate && npm run test:unit && npm run test:features", - "test:features": "npm run local-webserver & (wdio wdio.BUILD.conf.js; wdio_ret=$?; kill $(lsof -t -i:8080); exit $wdio_ret)", + "test:features": "npm run local-webserver & (wdio wdio.BUILD.conf.js; wdio_ret=$?; forever stopall; exit $wdio_ret)", "test:unit": "jest --config=jest.json", "test:validate": "eslint 'src/**/*.js' 'test/**/*.js!(setup.js)'" }, @@ -45,6 +45,7 @@ "eslint": "~4.6.0", "eslint-config-airbnb-base": "~12.0.0", "eslint-plugin-import": "~2.7.0", + "forever": "~0.15.3", "http-server": "~0.10.0", "jest": "~21.0.0" } diff --git a/yarn.lock b/yarn.lock index 3b735718..a98239e1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6,6 +6,10 @@ abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" +abbrev@1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.0.tgz#d0554c2256636e2f56e7c2e5ad183f859428d81f" + acorn-globals@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-3.1.0.tgz#fd8270f71fbb4996b004fa880ee5d46573a731bf" @@ -111,6 +115,10 @@ append-transform@^0.4.0: dependencies: default-require-extensions "^1.0.0" +aproba@^1.0.3: + version "1.1.2" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" + archiver-utils@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/archiver-utils/-/archiver-utils-1.3.0.tgz#e50b4c09c70bf3d680e32ff1b7994e9f9d895174" @@ -136,6 +144,13 @@ archiver@~1.3.0: walkdir "^0.0.11" zip-stream "^1.1.0" +are-we-there-yet@~1.1.2: + version "1.1.4" + resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz#bb5dca382bb94f05e15194373d16fd3ba1ca110d" + dependencies: + delegates "^1.0.0" + readable-stream "^2.0.6" + argparse@^1.0.7: version "1.0.9" resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86" @@ -198,6 +213,18 @@ assertion-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" +async-each@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d" + +async@0.2.9: + version "0.2.9" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.9.tgz#df63060fbf3d33286a76aaf6d55a2986d9ff8619" + +async@0.2.x, async@~0.2.9: + version "0.2.10" + resolved "https://registry.yarnpkg.com/async/-/async-0.2.10.tgz#b6bbe0b0674b9d719708ca38de8c237cb526c3d1" + async@^1.4.0, async@^1.5.2: version "1.5.2" resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" @@ -778,12 +805,22 @@ becke-ch--regex--s0-0-v1--base--pl--lib@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/becke-ch--regex--s0-0-v1--base--pl--lib/-/becke-ch--regex--s0-0-v1--base--pl--lib-1.2.0.tgz#2e73e9d21f2c2e6f5a5454045636f0ab93e46130" +binary-extensions@^1.0.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.10.0.tgz#9aeb9a6c5e88638aad171e167f5900abe24835d0" + bl@^1.0.0: version "1.2.1" resolved "https://registry.yarnpkg.com/bl/-/bl-1.2.1.tgz#cac328f7bee45730d404b692203fcb590e172d5e" dependencies: readable-stream "^2.0.5" +block-stream@*: + version "0.0.9" + resolved "https://registry.yarnpkg.com/block-stream/-/block-stream-0.0.9.tgz#13ebfe778a03205cfe03751481ebb4b3300c126a" + dependencies: + inherits "~2.0.0" + bluebird@^3.4.1: version "3.5.0" resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.0.tgz#791420d7f551eea2897453a8a77653f96606d67c" @@ -809,6 +846,16 @@ braces@^1.8.2: preserve "^0.2.0" repeat-element "^1.1.2" +broadway@~0.3.2, broadway@~0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/broadway/-/broadway-0.3.6.tgz#7dbef068b954b7907925fd544963b578a902ba7a" + dependencies: + cliff "0.1.9" + eventemitter2 "0.4.14" + nconf "0.6.9" + utile "0.2.1" + winston "0.8.0" + browser-resolve@^1.11.2: version "1.11.2" resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" @@ -845,6 +892,12 @@ caller-path@^0.1.0: dependencies: callsites "^0.2.0" +caller@~0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/caller/-/caller-0.0.1.tgz#f37a1d6ea10e829d94721ae29a90bb4fb52ab767" + dependencies: + tape "~2.3.2" + callsites@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-0.2.0.tgz#afab96262910a7f33c19a5775825c69f34e350ca" @@ -947,6 +1000,21 @@ check-error@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" +chokidar@^1.0.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + ci-info@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.0.0.tgz#dc5285f2b4e251821683681c381c3388f46ec534" @@ -971,6 +1039,22 @@ cli-width@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.1.0.tgz#b234ca209b29ef66fc518d9b98d5847b00edf00a" +cliff@0.1.9: + version "0.1.9" + resolved "https://registry.yarnpkg.com/cliff/-/cliff-0.1.9.tgz#a211e09c6a3de3ba1af27d049d301250d18812bc" + dependencies: + colors "0.x.x" + eyes "0.1.x" + winston "0.8.x" + +cliff@~0.1.9: + version "0.1.10" + resolved "https://registry.yarnpkg.com/cliff/-/cliff-0.1.10.tgz#53be33ea9f59bec85609ee300ac4207603e52013" + dependencies: + colors "~1.0.3" + eyes "~0.1.8" + winston "0.8.x" + cliui@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" @@ -987,6 +1071,10 @@ cliui@^3.2.0: strip-ansi "^3.0.1" wrap-ansi "^2.0.0" +clone@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.2.tgz#260b7a99ebb1edfe247538175f783243cb19d149" + co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1005,7 +1093,11 @@ color-name@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.2.tgz#5c8ab72b64bd2215d617ae9559ebb148475cf98d" -colors@1.0.3: +colors@0.6.x, colors@0.x.x, colors@~0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" + +colors@1.0.3, colors@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b" @@ -1054,6 +1146,10 @@ concat-stream@^1.6.0: readable-stream "^2.2.2" typedarray "^0.0.6" +console-control-strings@^1.0.0, console-control-strings@~1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" + constant-case@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/constant-case/-/constant-case-2.0.0.tgz#4175764d389d3fa9c8ecd29186ed6005243b6a46" @@ -1218,6 +1314,10 @@ cucumber@~3.0.1: util-arity "^1.0.2" verror "^1.9.0" +cycle@1.0.x: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cycle/-/cycle-1.0.3.tgz#21e80b2be8580f98b468f379430662b046c34ad2" + d@1: version "1.0.0" resolved "https://registry.yarnpkg.com/d/-/d-1.0.0.tgz#754bb5bfe55451da69a58b94d45f4c5b0462d58f" @@ -1262,6 +1362,18 @@ deep-eql@^3.0.0: dependencies: type-detect "^4.0.0" +deep-equal@*: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +deep-equal@~0.1.0: + version "0.1.2" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-0.1.2.tgz#b246c2b80a570a47c11be1d9bd1070ec878b87ce" + +deep-extend@~0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.4.2.tgz#48b699c27e334bf89f10892be432f6e4c7d34a7f" + deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -1283,6 +1395,10 @@ define-properties@^1.1.2: foreach "^2.0.5" object-keys "^1.0.8" +defined@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-0.0.0.tgz#f35eea7d705e933baf13b2f03b3f83d921403b3e" + del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -1299,6 +1415,10 @@ delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" +delegates@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" + detect-indent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" @@ -1313,6 +1433,10 @@ diff@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" +director@1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/director/-/director-1.2.7.tgz#bfd3741075fd7fb1a5b2e13658c5f4bec77736f3" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -1560,6 +1684,16 @@ esutils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" +event-stream@~0.5: + version "0.5.3" + resolved "https://registry.yarnpkg.com/event-stream/-/event-stream-0.5.3.tgz#b77b9309f7107addfeab63f0c0eafd8db0bd8c1c" + dependencies: + optimist "0.2" + +eventemitter2@0.4.14, eventemitter2@~0.4.14: + version "0.4.14" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-0.4.14.tgz#8f61b75cde012b2e9eb284d4545583b5643b61ab" + eventemitter3@1.x.x: version "1.2.0" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-1.2.0.tgz#1c86991d816ad1e504750e73874224ecf3bec508" @@ -1623,6 +1757,10 @@ extsprintf@^1.2.0: version "1.3.0" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" +eyes@0.1.x, eyes@~0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/eyes/-/eyes-0.1.8.tgz#62cf120234c683785d902348a800ef3e0cc20bc0" + fast-deep-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff" @@ -1709,6 +1847,15 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" +flatiron@~0.4.2: + version "0.4.3" + resolved "https://registry.yarnpkg.com/flatiron/-/flatiron-0.4.3.tgz#248cf79a3da7d7dc379e2a11c92a2719cbb540f6" + dependencies: + broadway "~0.3.2" + director "1.2.7" + optimist "0.6.0" + prompt "0.2.14" + for-in@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -1727,6 +1874,36 @@ forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" +forever-monitor@~1.7.0: + version "1.7.1" + resolved "https://registry.yarnpkg.com/forever-monitor/-/forever-monitor-1.7.1.tgz#5d820f4a3a78db2d81ae2671f158b9e86a091bb8" + dependencies: + broadway "~0.3.6" + chokidar "^1.0.1" + minimatch "~3.0.2" + ps-tree "0.0.x" + utile "~0.2.1" + +forever@0.15.3: + version "0.15.3" + resolved "https://registry.yarnpkg.com/forever/-/forever-0.15.3.tgz#77d9d7e15fd2f511ad9d84a110c7dd8fc8ecebc2" + dependencies: + cliff "~0.1.9" + clone "^1.0.2" + colors "~0.6.2" + flatiron "~0.4.2" + forever-monitor "~1.7.0" + nconf "~0.6.9" + nssocket "~0.5.1" + object-assign "^3.0.0" + optimist "~0.6.0" + path-is-absolute "~1.0.0" + prettyjson "^1.1.2" + shush "^1.0.0" + timespan "~2.3.0" + utile "~0.2.1" + winston "~0.8.1" + form-data@~2.1.1: version "2.1.4" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.1.4.tgz#33c183acf193276ecaa98143a69e94bfee1750d1" @@ -1757,6 +1934,30 @@ fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" +fsevents@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.1.2.tgz#3282b713fb3ad80ede0e9fcf4611b5aa6fc033f4" + dependencies: + nan "^2.3.0" + node-pre-gyp "^0.6.36" + +fstream-ignore@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fstream-ignore/-/fstream-ignore-1.0.5.tgz#9c31dae34767018fe1d249b24dada67d092da105" + dependencies: + fstream "^1.0.0" + inherits "2" + minimatch "^3.0.0" + +fstream@^1.0.0, fstream@^1.0.10, fstream@^1.0.2: + version "1.0.11" + resolved "https://registry.yarnpkg.com/fstream/-/fstream-1.0.11.tgz#5c1fb1f117477114f0632a0eb4b71b3cb0fd3171" + dependencies: + graceful-fs "^4.1.2" + inherits "~2.0.0" + mkdirp ">=0.5 0" + rimraf "2" + function-bind@^1.0.2, function-bind@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.0.tgz#16176714c801798e4e8f2cf7f7529467bb4a5771" @@ -1765,6 +1966,19 @@ functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" +gauge@~2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" + dependencies: + aproba "^1.0.3" + console-control-strings "^1.0.0" + has-unicode "^2.0.0" + object-assign "^4.1.0" + signal-exit "^3.0.0" + string-width "^1.0.1" + strip-ansi "^3.0.1" + wide-align "^1.1.0" + gaze@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.2.tgz#847224677adb8870d679257ed3388fdb61e40105" @@ -1917,6 +2131,10 @@ has-flag@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" +has-unicode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" + has@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -2003,6 +2221,10 @@ humanize-duration@~3.10.0: version "3.10.0" resolved "https://registry.yarnpkg.com/humanize-duration/-/humanize-duration-3.10.0.tgz#4d15bccaefcb12401b4d80475cf6c49a039e3959" +i@0.3.x: + version "0.3.5" + resolved "https://registry.yarnpkg.com/i/-/i-0.3.5.tgz#1d2b854158ec8169113c6cb7f6b6801e99e211d5" + iconv-lite@0.4.13: version "0.4.13" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.13.tgz#1f88aba4ab0b1508e8312acc39345f36e992e2f2" @@ -2030,10 +2252,14 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.0, inherits@~2.0.1, inherits@~2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" +ini@1.x.x, ini@~1.3.0: + version "1.3.4" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e" + inquirer@^3.0.6: version "3.2.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.2.0.tgz#45b44c2160c729d7578c54060b3eed94487bb42b" @@ -2085,6 +2311,12 @@ is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + dependencies: + binary-extensions "^1.0.0" + is-buffer@^1.1.5: version "1.1.5" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" @@ -2236,7 +2468,7 @@ isobject@^2.0.0: dependencies: isarray "1.0.0" -isstream@~0.1.2: +isstream@0.1.x, isstream@~0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" @@ -2647,6 +2879,10 @@ lazy-cache@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" +lazy@~1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/lazy/-/lazy-1.0.11.tgz#daa068206282542c088288e975c297c1ae77b690" + lazystream@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/lazystream/-/lazystream-1.0.0.tgz#f6995fe0f820392f61396be89462407bb77168e4" @@ -2781,7 +3017,7 @@ mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" -minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: +minimatch@^3.0.0, minimatch@^3.0.2, minimatch@^3.0.3, minimatch@^3.0.4, minimatch@~3.0.2: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: @@ -2801,7 +3037,7 @@ mkdirp@0.5.0: dependencies: minimist "0.0.8" -mkdirp@0.5.x, mkdirp@^0.5.1, mkdirp@~0.5.1: +mkdirp@0.5.x, mkdirp@0.x.x, "mkdirp@>=0.5 0", mkdirp@^0.5.1, mkdirp@~0.5.1: version "0.5.1" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" dependencies: @@ -2819,7 +3055,7 @@ ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" -mute-stream@0.0.7: +mute-stream@0.0.7, mute-stream@~0.0.4: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -2831,10 +3067,26 @@ mz@^2.4.0: object-assign "^4.0.1" thenify-all "^1.0.0" +nan@^2.3.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" +nconf@0.6.9, nconf@~0.6.9: + version "0.6.9" + resolved "https://registry.yarnpkg.com/nconf/-/nconf-0.6.9.tgz#9570ef15ed6f9ae6b2b3c8d5e71b66d3193cd661" + dependencies: + async "0.2.9" + ini "1.x.x" + optimist "0.6.0" + +ncp@0.4.x: + version "0.4.2" + resolved "https://registry.yarnpkg.com/ncp/-/ncp-0.4.2.tgz#abcc6cbd3ec2ed2a729ff6e7c1fa8f01784a8574" + no-case@^2.2.0: version "2.3.1" resolved "https://registry.yarnpkg.com/no-case/-/no-case-2.3.1.tgz#7aeba1c73a52184265554b7dc03baf720df80081" @@ -2854,6 +3106,27 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" +node-pre-gyp@^0.6.36: + version "0.6.36" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.36.tgz#db604112cb74e0d477554e9b505b17abddfab786" + dependencies: + mkdirp "^0.5.1" + nopt "^4.0.1" + npmlog "^4.0.2" + rc "^1.1.7" + request "^2.81.0" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^2.2.1" + tar-pack "^3.4.0" + +nopt@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/nopt/-/nopt-4.0.1.tgz#d0d4685afd5415193c8c7505602d0d17cd64474d" + dependencies: + abbrev "1" + osenv "^0.1.4" + normalize-package-data@^2.3.2: version "2.3.8" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" @@ -2873,6 +3146,22 @@ npm-install-package@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/npm-install-package/-/npm-install-package-2.1.0.tgz#d7efe3cfcd7ab00614b896ea53119dc9ab259125" +npmlog@^4.0.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b" + dependencies: + are-we-there-yet "~1.1.2" + console-control-strings "~1.1.0" + gauge "~2.7.3" + set-blocking "~2.0.0" + +nssocket@~0.5.1: + version "0.5.3" + resolved "https://registry.yarnpkg.com/nssocket/-/nssocket-0.5.3.tgz#883ca2ec605f5ed64a4d5190b2625401928f8f8d" + dependencies: + eventemitter2 "~0.4.14" + lazy "~1.0.11" + number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" @@ -2885,6 +3174,10 @@ oauth-sign@~0.8.1: version "0.8.2" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.8.2.tgz#46a6ab7f0aead8deae9ec0565780b7d4efeb9d43" +object-assign@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2" + object-assign@^4.0.1, object-assign@^4.1.0: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" @@ -2908,7 +3201,7 @@ object.omit@^2.0.0: for-own "^0.1.4" is-extendable "^0.1.1" -once@^1.3.0, once@^1.4.0: +once@^1.3.0, once@^1.3.3, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -2924,7 +3217,20 @@ opener@~1.4.0: version "1.4.3" resolved "https://registry.yarnpkg.com/opener/-/opener-1.4.3.tgz#5c6da2c5d7e5831e8ffa3964950f8d6674ac90b8" -optimist@0.6.x, optimist@^0.6.1, optimist@~0.6.1: +optimist@0.2: + version "0.2.8" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.2.8.tgz#e981ab7e268b457948593b55674c099a815cac31" + dependencies: + wordwrap ">=0.0.1 <0.1.0" + +optimist@0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.0.tgz#69424826f3405f79f142e6fc3d9ae58d4dbb9200" + dependencies: + minimist "~0.0.1" + wordwrap "~0.0.2" + +optimist@0.6.x, optimist@^0.6.1, optimist@~0.6.0, optimist@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" dependencies: @@ -2952,10 +3258,17 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: +os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" +osenv@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/osenv/-/osenv-0.1.4.tgz#42fe6d5953df06c8064be6f176c3d05aaaa34644" + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.0" + p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -3024,7 +3337,7 @@ path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" -path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1, path-is-absolute@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -3096,6 +3409,14 @@ pkg-dir@^1.0.0: dependencies: find-up "^1.0.0" +pkginfo@0.3.x: + version "0.3.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.3.1.tgz#5b29f6a81f70717142e09e765bbeab97b4f81e21" + +pkginfo@0.x.x: + version "0.4.1" + resolved "https://registry.yarnpkg.com/pkginfo/-/pkginfo-0.4.1.tgz#b5418ef0439de5425fc4995042dced14fb2a84ff" + pluralize@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-4.0.0.tgz#59b708c1c0190a2f692f1c7618c446b052fd1762" @@ -3123,6 +3444,13 @@ pretty-format@^20.0.3: ansi-regex "^2.1.1" ansi-styles "^3.0.0" +prettyjson@^1.1.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prettyjson/-/prettyjson-1.2.1.tgz#fcffab41d19cab4dfae5e575e64246619b12d289" + dependencies: + colors "^1.1.2" + minimist "^1.2.0" + private@^0.1.6, private@^0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/private/-/private-0.1.7.tgz#68ce5e8a1ef0a23bb570cc28537b5332aba63ef1" @@ -3139,10 +3467,26 @@ progress@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.0.tgz#8a1be366bf8fc23db2bd23f10c6fe920b4389d1f" +prompt@0.2.14: + version "0.2.14" + resolved "https://registry.yarnpkg.com/prompt/-/prompt-0.2.14.tgz#57754f64f543fd7b0845707c818ece618f05ffdc" + dependencies: + pkginfo "0.x.x" + read "1.0.x" + revalidator "0.1.x" + utile "0.2.x" + winston "0.8.x" + prr@~0.0.0: version "0.0.0" resolved "https://registry.yarnpkg.com/prr/-/prr-0.0.0.tgz#1a84b85908325501411853d0081ee3fa86e2926a" +ps-tree@0.0.x: + version "0.0.3" + resolved "https://registry.yarnpkg.com/ps-tree/-/ps-tree-0.0.3.tgz#dbf8d752a7fe22fa7d58635689499610e9276ddc" + dependencies: + event-stream "~0.5" + pseudomap@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" @@ -3182,6 +3526,15 @@ randomatic@^1.1.3: is-number "^2.0.2" kind-of "^3.0.2" +rc@^1.1.7: + version "1.2.1" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.1.tgz#2e03e8e42ee450b8cb3dce65be1bf8974e1dfd95" + dependencies: + deep-extend "~0.4.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + read-pkg-up@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" @@ -3212,6 +3565,12 @@ read-pkg@^2.0.0: normalize-package-data "^2.3.2" path-type "^2.0.0" +read@1.0.x: + version "1.0.7" + resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" + dependencies: + mute-stream "~0.0.4" + readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2: version "2.2.9" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.2.9.tgz#cf78ec6f4a6d1eb43d26488cac97f042e74b7fc8" @@ -3224,6 +3583,18 @@ readable-stream@^2.0.0, readable-stream@^2.0.5, readable-stream@^2.2.2: string_decoder "~1.0.0" util-deprecate "~1.0.1" +readable-stream@^2.0.2, readable-stream@^2.0.6, readable-stream@^2.1.4: + version "2.3.3" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.3.tgz#368f2512d79f9d46fdfc71349ae7878bbc1eb95c" + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~1.0.6" + safe-buffer "~5.1.1" + string_decoder "~1.0.3" + util-deprecate "~1.0.1" + readable-stream@~2.0.0: version "2.0.6" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.0.6.tgz#8f90341e68a53ccc928788dacfcd11b36eb9b78e" @@ -3235,6 +3606,15 @@ readable-stream@~2.0.0: string_decoder "~0.10.x" util-deprecate "~1.0.1" +readdirp@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.1.0.tgz#4ed0ad060df3073300c48440373f72d1cc642d78" + dependencies: + graceful-fs "^4.1.2" + minimatch "^3.0.2" + readable-stream "^2.0.2" + set-immediate-shim "^1.0.1" + regenerate@^1.2.1: version "1.3.2" resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" @@ -3329,7 +3709,7 @@ request@2.79.0, request@~2.79.0: tunnel-agent "~0.4.1" uuid "^3.0.0" -request@^2.79.0, request@~2.81.0: +request@^2.79.0, request@^2.81.0, request@~2.81.0: version "2.81.0" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0" dependencies: @@ -3406,6 +3786,16 @@ restore-cursor@^2.0.0: onetime "^2.0.0" signal-exit "^3.0.2" +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +revalidator@0.1.x: + version "0.1.8" + resolved "https://registry.yarnpkg.com/revalidator/-/revalidator-0.1.8.tgz#fece61bfa0c1b52a206bd6b18198184bdd523a3b" + rgb2hex@~0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/rgb2hex/-/rgb2hex-0.1.0.tgz#ccd55f860ae0c5c4ea37504b958e442d8d12325b" @@ -3416,7 +3806,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@^2.2.8, rimraf@^2.6.1: +rimraf@2, rimraf@2.x.x, rimraf@^2.2.8, rimraf@^2.5.1, rimraf@^2.6.1: version "2.6.1" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" dependencies: @@ -3446,6 +3836,10 @@ safe-buffer@^5.0.1, safe-buffer@~5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.0.1.tgz#d263ca54696cd8a306b5ca6551e92de57918fbe7" +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" + sane@~1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/sane/-/sane-1.6.0.tgz#9610c452307a135d29c1fdfe2547034180c46775" @@ -3491,10 +3885,14 @@ sentence-case@^2.1.0: no-case "^2.2.0" upper-case-first "^1.1.2" -set-blocking@^2.0.0: +set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" +set-immediate-shim@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61" + shebang-command@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" @@ -3509,7 +3907,14 @@ shellwords@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.0.tgz#66afd47b6a12932d9071cbfd98a52e785cd0ba14" -signal-exit@^3.0.2: +shush@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shush/-/shush-1.0.0.tgz#c27415a9e458f2fed39b27cf8eb37c003782b431" + dependencies: + caller "~0.0.1" + strip-json-comments "~0.1.1" + +signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -3623,6 +4028,10 @@ stack-generator@^2.0.1: dependencies: stackframe "^1.0.4" +stack-trace@0.0.x: + version "0.0.10" + resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0" + stackframe@^1.0.3, stackframe@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/stackframe/-/stackframe-1.0.4.tgz#357b24a992f9427cba6b545d96a14ed2cbca187b" @@ -3684,6 +4093,12 @@ string_decoder@~1.0.0: dependencies: buffer-shims "~1.0.0" +string_decoder@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.0.3.tgz#0fc67d7c141825de94282dd536bec6b9bce860ab" + dependencies: + safe-buffer "~5.1.0" + stringstream@~0.0.4: version "0.0.5" resolved "https://registry.yarnpkg.com/stringstream/-/stringstream-0.0.5.tgz#4e484cd4de5a0bbbee18e46307710a8a81621878" @@ -3710,6 +4125,10 @@ strip-bom@^2.0.0: dependencies: is-utf8 "^0.2.0" +strip-json-comments@~0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-0.1.3.tgz#164c64e370a8a3cc00c9e01b539e569823f0ee54" + strip-json-comments@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" @@ -3752,6 +4171,30 @@ table@^4.0.1: slice-ansi "0.0.4" string-width "^2.0.0" +tape@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tape/-/tape-2.3.3.tgz#2e7ce0a31df09f8d6851664a71842e0ca5057af7" + dependencies: + deep-equal "~0.1.0" + defined "~0.0.0" + inherits "~2.0.1" + jsonify "~0.0.0" + resumer "~0.0.0" + through "~2.3.4" + +tar-pack@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/tar-pack/-/tar-pack-3.4.0.tgz#23be2d7f671a8339376cbdb0b8fe3fdebf317984" + dependencies: + debug "^2.2.0" + fstream "^1.0.10" + fstream-ignore "^1.0.5" + once "^1.3.3" + readable-stream "^2.1.4" + rimraf "^2.5.1" + tar "^2.2.1" + uid-number "^0.0.6" + tar-stream@1.5.2, tar-stream@^1.5.0: version "1.5.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.2.tgz#fbc6c6e83c1a19d4cb48c7d96171fc248effc7bf" @@ -3761,6 +4204,14 @@ tar-stream@1.5.2, tar-stream@^1.5.0: readable-stream "^2.0.0" xtend "^4.0.0" +tar@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-2.2.1.tgz#8e4d2a256c0e2185c6b18ad694aec968b83cb1d1" + dependencies: + block-stream "*" + fstream "^1.0.2" + inherits "2" + test-exclude@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.0.tgz#04ca70b7390dd38c98d4a003a173806ca7991c91" @@ -3795,10 +4246,14 @@ throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" -through@^2.3.6: +through@^2.3.6, through@~2.3.4: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" +timespan@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/timespan/-/timespan-2.3.0.tgz#4902ce040bd13d845c8f59b27e9d59bad6f39929" + title-case@^2.1.0, title-case@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/title-case/-/title-case-2.1.1.tgz#3e127216da58d2bc5becf137ab91dae3a7cd8faa" @@ -3879,6 +4334,10 @@ uglify-to-browserify@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" +uid-number@^0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/uid-number/-/uid-number-0.0.6.tgz#0ea10e8035e8eb5b8e4449f06da1c730663baa81" + union@~0.4.3: version "0.4.6" resolved "https://registry.yarnpkg.com/union/-/union-0.4.6.tgz#198fbdaeba254e788b0efcb630bc11f24a2959e0" @@ -3922,6 +4381,17 @@ util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" +utile@0.2.1, utile@0.2.x, utile@~0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/utile/-/utile-0.2.1.tgz#930c88e99098d6220834c356cbd9a770522d90d7" + dependencies: + async "~0.2.9" + deep-equal "*" + i "0.3.x" + mkdirp "0.x.x" + ncp "0.4.x" + rimraf "2.x.x" + uuid@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.0.1.tgz#6544bba2dfda8c1cf17e629a3a305e2bb1fee6c1" @@ -4069,15 +4539,44 @@ which@^1.2.12, which@^1.2.9, which@~1.2.10: dependencies: isexe "^2.0.0" +wide-align@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.2.tgz#571e0f1b0604636ebc0dfc21b0339bbe31341710" + dependencies: + string-width "^1.0.2" + window-size@0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" +winston@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.0.tgz#61d0830fa699706212206b0a2b5ca69a93043668" + dependencies: + async "0.2.x" + colors "0.6.x" + cycle "1.0.x" + eyes "0.1.x" + pkginfo "0.3.x" + stack-trace "0.0.x" + +winston@0.8.x, winston@~0.8.1: + version "0.8.3" + resolved "https://registry.yarnpkg.com/winston/-/winston-0.8.3.tgz#64b6abf4cd01adcaefd5009393b1d8e8bec19db0" + dependencies: + async "0.2.x" + colors "0.6.x" + cycle "1.0.x" + eyes "0.1.x" + isstream "0.1.x" + pkginfo "0.3.x" + stack-trace "0.0.x" + wordwrap@0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" -wordwrap@~0.0.2: +"wordwrap@>=0.0.1 <0.1.0", wordwrap@~0.0.2: version "0.0.3" resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" From c67bd193e0f8eed735cd308fe45f2f084f08a564 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Mon, 4 Sep 2017 08:16:38 +0200 Subject: [PATCH 11/15] Resolved some `@Pending` scenario's being executed --- src/features/pending.feature | 2 +- wdio.conf.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/pending.feature b/src/features/pending.feature index 213ad6e4..4a97cf15 100644 --- a/src/features/pending.feature +++ b/src/features/pending.feature @@ -1,4 +1,4 @@ -@pending +@Pending Feature: Pending scenario As a test framework I should be able skip all these scenarios diff --git a/wdio.conf.js b/wdio.conf.js index f838ef3b..d673c222 100644 --- a/wdio.conf.js +++ b/wdio.conf.js @@ -160,7 +160,7 @@ exports.config = { // (expression) only execute the features or scenarios with // tags matching the expression, see // https://docs.cucumber.io/tag-expressions/ - tagExpression: 'not @pending', + tagExpression: 'not @Pending', // add cucumber tags to feature or scenario name tagsInTitle: false, // timeout for step definitions From b2996cd8a571705c6462222a54415dde31657134 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Mon, 4 Sep 2017 08:26:10 +0200 Subject: [PATCH 12/15] Updated readme to reflect changes in the tags processing mechanism --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 18c2283c..16e00cac 100644 --- a/README.md +++ b/README.md @@ -139,10 +139,10 @@ If you want to run only specific tests you can mark your features with tags. The Feature: ... ``` -To run only the tests with specific tag(s) use the `--tags=` parameter like so: +To run only the tests with specific tag(s) use the `--cucumberOpts.tagExpression=` parameter like so: ```sh -$ yarn run wdio -- --tags=@Tag,@AnotherTag +$ yarn run wdio -- --cucumberOpts.tagExpression=@Tag,@AnotherTag ``` You can add multiple tags separated by a comma @@ -165,7 +165,7 @@ Scenario: ... The predefined snippets allow you to do a lot of common things but you might need extra snippets which are better aligned with your aims. To do so you will find all step definitions in `./src/steps`. They -are separated in `given`, `when` and `then`. +are separated in `given`, `when` and `then`. You define your snippet using regular expressions. This is pretty powerful as it allows you to create complex sentences with multiple options. Everything that's within `"([^"]*)?"` gets captured and appended to the From 3cd5af654feeede1c7766e9378822aecc62c6d03 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Mon, 4 Sep 2017 08:31:33 +0200 Subject: [PATCH 13/15] Updated changelog for 1.3.0 release --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ea39a302..7b23c6be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [1.3.0] - T.B.D. +### Added +- Cucumber 3 as a dependency +- More Node versions to Travis build +- [Forever](https://www.npmjs.com/package/forever) for managing the `http-server` process + +### Changed +- Updated Chai, wdio-cucumber-framework & wdio-spec-reporter dependencies +- Updated codebase to match new Cucumber 3 syntax & functionalities +- Updated readme to reflect changes in the tags processing mechanism + +### Fixed +- Syntax issue in `.babelrc` + +### Removed +- No longer needed tagprocessor functionality + + ## [1.2.0] - 2017-07-12 ### Added - Rules: From 05892f036bbd3bda471aabf8dc703ae0f26adcfd Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Tue, 5 Sep 2017 08:50:22 +0200 Subject: [PATCH 14/15] Switched to ESLint 4 for CodeClimate --- .codeclimate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index da89b1dd..24b1a163 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -1,7 +1,7 @@ engines: eslint: enabled: true - channel: "eslint-3" + channel: "eslint-4" exclude_paths: - "demo-app/" From 053c7631fa3fb606cf9bfc9d6d9618c95c31c766 Mon Sep 17 00:00:00 2001 From: "W. van Kuipers" Date: Mon, 11 Sep 2017 12:34:24 +0200 Subject: [PATCH 15/15] Removed Cucumber 3 as a dependency & updated changelog to match this change (using Cucumber 2) --- CHANGELOG.md | 3 +-- package.json | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b23c6be..0e2d62e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,13 +2,12 @@ ## [1.3.0] - T.B.D. ### Added -- Cucumber 3 as a dependency - More Node versions to Travis build - [Forever](https://www.npmjs.com/package/forever) for managing the `http-server` process ### Changed - Updated Chai, wdio-cucumber-framework & wdio-spec-reporter dependencies -- Updated codebase to match new Cucumber 3 syntax & functionalities +- Updated codebase to match new Cucumber 2 syntax & functionalities - Updated readme to reflect changes in the tags processing mechanism ### Fixed diff --git a/package.json b/package.json index 5a38367a..ec721a64 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "babel-preset-es2015": "~6.24.0", "babel-register": "~6.26.0", "chai": "~4.1.2", - "cucumber": "~3.0.1", "wdio-cucumber-framework": "~1.0.2", "wdio-phantomjs-service": "~0.2.2", "wdio-selenium-standalone-service": "~0.0.9",