diff --git a/.meteorignore b/.meteorignore new file mode 100644 index 0000000..b25101c --- /dev/null +++ b/.meteorignore @@ -0,0 +1,3 @@ +# Don't reload meteor server when we modify or do test +cucumber +output.json diff --git a/cucumber/features/pages.feature b/cucumber/features/pages.feature index 74afc36..fd2193b 100644 --- a/cucumber/features/pages.feature +++ b/cucumber/features/pages.feature @@ -1,5 +1,8 @@ Feature: Test all secundary pages + Background: + Given I am on the home page + Scenario: Check that all secondary pages work well Given a list of page ids and contents | license | License | diff --git a/cucumber/features/steps_definitions/hooks.js b/cucumber/features/steps_definitions/hooks.js index 574b9c4..64b405a 100644 --- a/cucumber/features/steps_definitions/hooks.js +++ b/cucumber/features/steps_definitions/hooks.js @@ -2,6 +2,31 @@ (function () { module.exports = function () { + const printLog = (type) => { + client.log(type).value.forEach((logItem) => { + const { source, message } = logItem; + if (type === 'browser' && source === 'console-api') { + // Clean messages of type: + // http://localhost:3000/app/app.js?hash=34da4258bd2caa4e14c7c0c20ba6396f309e7236 13325:18 "GMaps script just loaded" + // to get the last part + const cleanMessage = message.replace(/[^ ]{1,} [^ ]{1,} "(.*)"$/g, '$1'); + console.log(`${logItem.level}: ${cleanMessage}`); + } else { + // Right now we don't need logs like: + // %cDownload the React DevTools for a better development experience: https://fb.me/react-devtools + // console.log(`${logItem.level}: ${message}`); + } + }); + }; + + this.StepResult((stepResult) => { + if (stepResult.getStatus() === 'failed') { + // http://webdriver.io/api/protocol/log.html + console.log(`Step result: ${stepResult.getStatus()}`); + printLog('browser'); + } + }); + this.Before(() => { // global.expect = require('@xolvio/jasmine-expect').expect;