After successfully finishing the scenarios, cucumberjs hangs - indefinitely. How can I get this to stop?
I've got a cucumberjs running on npm/nodejs.
package.json:
{
"name": "foo-test-automation",
"version": "1.1.0",
"description": "Integration Regression UI Test Automation for Foo application",
"main": "fooAutoTest.js",
"scripts": {
"start": ". .env; node ./node_modules/.bin/cucumber-js --tags @RegressionTestSuite --format json:./results/log_`date +\\\"%Y\\\\%m\\\\%d_%H%M\\\"`.json",
},
After finishing, cumber appears to be running in the background
$ npm run new
............................
5 scenarios (5 passed)
28 steps (28 passed)
0m37.701s
I looked for hanging processes:
Hucks-MacBook-Pro:~ huckcarignan$ ps aux | grep node
huckcarignan 25252 0.0 0.0 4287512 856 s004 S+ 12:30PM 0:00.00 grep node
huckcarignan 18365 0.0 0.2 4652124 40804 s000 S+ 11:33AM 0:02.64 node ./node_modules/.bin/cucumber-js --tags @New --format json:./results/log_"20190521_1133".json
huckcarignan 18362 0.0 0.0 4280924 868 s000 S+ 11:33AM 0:00.01 sh -c . .env; node ./node_modules/.bin/cucumber-js --tags @New --format json:./results/log_`date +\"%Y\\%m\\%d_%H%M\"`.json
so nothing leaps out at me.
Am I missing something in my hooks.js:
const { BeforeAll, AfterAll } = require('cucumber');
const puppeteer = require('puppeteer');
const timestamp = require('time-stamp');
require('dotenv').config();
BeforeAll(async function() {
this.browser = await puppeteer.launch({
headless: (process.env.HEADLESS === 'true'),
slowMo: parseInt(process.env.SLOWMO),
defaultViewport: {
width: parseInt(process.env.SCREEN_SIZE_WIDTH),
height: parseInt(process.env.SCREEN_SIZE_HEIGHT)
}
});
this.page = await this.browser.newPage();
});
AfterAll(async function() {
// Teardown browser
if (this.browser) {
await this.browser.close();
}
});
Any help would be appreciated.
UPDATE 1 I've tried replacing my AfterAll with: // Asynchronous Promise AfterAll(function () { return Promise.resolve(); });
but it still hangs (but with the browser open)