diff --git a/CHANGELOG.md b/CHANGELOG.md index ce73c0a3a2..3a8143050b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ Changelog ### Chores +- Improved the unit and e2e test setup ([PR 1743](https://github.com/input-output-hk/daedalus/pull/1743)) - Updated to react-polymorph@0.9.0-rc.25 which includes a theme var for checkbox icon color (([PR 1742](https://github.com/input-output-hk/daedalus/pull/1742))) - Updated `cardano-wallet` to latest master branch revision which includes Jormungandr 0.8.0-rc7 ([PR 1739](https://github.com/input-output-hk/daedalus/pull/1739)) - Updated stake header info component and adds new information with the countdown timer for next epoch ([PR 1729](https://github.com/input-output-hk/daedalus/pull/1729)) diff --git a/package.json b/package.json index 95bcf9b944..d4e8352858 100644 --- a/package.json +++ b/package.json @@ -11,12 +11,12 @@ "dev": "IS_WATCH_MODE=true gulp dev", "dev:itn": "NETWORK=itn_rewards_v1 IS_WATCH_MODE=true gulp dev", "test": "NODE_ENV=test yarn build && yarn test:unit && yarn test:e2e", - "test:unit": "yarn cucumber --require 'tests/**/unit/*.js' --tags '@unit and not @skip and not @wip'", + "test:unit": "yarn cucumber --require 'tests/**/unit/**/*.js' --tags '@unit and not @skip and not @wip'", "test:unit:watch": "nodemon --watch source --watch tests --exec \"yarn test:unit --tags '@unit and @watch'\"", "test:unit:unbound": "yarn cucumber --require 'tests/**/unit/*.js' --tags '@unbound and not @skip and not @wip'", - "test:e2e": "yarn cucumber --require 'tests/**/e2e/*.js' --tags '@e2e and not @skip and not @wip'", + "test:e2e": "yarn cucumber --require 'tests/setup-e2e.js' --require 'tests/**/e2e/**/*.js' --tags '@e2e and not @skip and not @wip'", "test:e2e:watch": "gulp test:e2e:watch", - "cucumber": "cross-env NODE_ENV=test cucumber-js tests --require 'tests/**/*.js' --require-module @babel/register -f node_modules/cucumber-pretty --format-options '{\"snippetInterface\": \"async-await\"}'", + "cucumber": "cross-env NODE_ENV=test cucumber-js tests --require 'tests/setup-common.js' --require-module @babel/register -f node_modules/cucumber-pretty --format-options '{\"snippetInterface\": \"async-await\"}'", "test:e2e:watch:once": "KEEP_APP_AFTER_TESTS=true yarn test:e2e --tags '@e2e and @watch'", "debug": "gulp debug", "package": "gulp build && cross-env NODE_ENV=production node -r @babel/register -r @babel/polyfill scripts/package.js", diff --git a/tests/setup-common.js b/tests/setup-common.js new file mode 100644 index 0000000000..85f02f60d6 --- /dev/null +++ b/tests/setup-common.js @@ -0,0 +1,6 @@ +import { Before } from 'cucumber'; + +// Add context object to share data between steps +Before(function() { + this.context = {}; +}); diff --git a/tests/setup.js b/tests/setup-e2e.js similarity index 98% rename from tests/setup.js rename to tests/setup-e2e.js index def1e8e214..dde3c0568a 100644 --- a/tests/setup.js +++ b/tests/setup-e2e.js @@ -134,11 +134,6 @@ Before({ tags: '@e2e', timeout: DEFAULT_TIMEOUT * 2 }, async function(testCase) }); }); -// adds context object to webdriver -Before(function() { - this.context = {}; -}); - Before({ tags: '@newsfeed' }, function() { setNewsFeedIsOpen(this.client, false); resetTestNews(this.client);