Running test with wdio I get a failed hook without any information #2614
Replies: 2 comments 1 reply
-
|
I was also facing the same issue with cucumber and wdio. When I did some research got to know that few default wdio mocha hooks were getting failed and those were never used in project and neither written by me. reporters: [ Let me know if it helps to resolve your issue. Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
Im facing similar issue but with the afterScenario hook, in my case is still showing the hook failed |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using wdio to test a mobile app using appium, the test runs without errors but the report contains a strange failed hook without a name and information.
wdio.conf.js:
`import allure from 'allure-commandline';
import {browser} from "@wdio/globals";
export const config = {
runner: 'local',
port: 4723,
specs: [
'./features//*.feature'
],
exclude: [],
maxInstances: 1,
capabilities: [{
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
'appium:appPackage': 'com.test.app',
'appium:appActivity': 'MainActivity',
'appium:autoWebview': true,
'appium:autoGrantPermissions': true,
'appium:chromedriver_autodownload': true,
'appium:ensureWebviewsHavePages': true,
'appium:nativeWebScreenshot': true,
'appium:newCommandTimeout': 3600,
'appium:connectHardwareKeyboard': true
}],
logLevel: 'debug',
bail: 0,
waitforTimeout: 10000,
connectionRetryTimeout: 120000,
connectionRetryCount: 3,
services: [
['appium', {
logPath: './',
args: {
address: '127.0.0.1',
port: 4725
}
}]
],
framework: 'cucumber',
reporters: [
'spec',
['allure', {
outputDir: 'allure-results',
disableWebdriverStepsReporting: false,
disableWebdriverScreenshotsReporting: false
}]
],
cucumberOpts: {
require: ['./features/steps//*.js'],
backtrace: false,
requireModule: [],
dryRun: false,
failFast: false,
snippets: true,
source: true,
strict: false,
tagExpression: '',
timeout: 60000,
ignoreUndefinedDefinitions: false
},
before: function (capabilities, specs) {
console.log('Starting the test suite...');
},
beforeScenario: function (world, context) {
console.log('Starting a scenario...');
},
beforeStep: function (step, scenario, context) {
console.log('Starting a step...');
},
afterStep: function (step, scenario, result, context) {
console.log('Finished a step...');
},
afterScenario: function (world, result, context) {
console.log('Finished a scenario...');
},
after: function (result, capabilities, specs) {
console.log('Finished the test suite...');
},
onComplete: function (exitCode, config, capabilities, results) {
console.log("The start if the on complete hook");
const reportError = new Error('Could not generate Allure report')
const generation = allure(['generate', 'allure-results', '--clean'])
return new Promise((resolve, reject) => {
const generationTimeout = setTimeout(
() => reject(reportError),
5000)
}
`
Beta Was this translation helpful? Give feedback.
All reactions