question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognised test

See original GitHub issue

Hello, there!

I use latest versions of webdriverio and wdio-mocha-framework and recently I started to get a nasty error:

/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/utils/ReporterStats.js:269
                throw Error('Unrecognised test [' + title + '] for suite [' + runner.parent + ']');
                ^

Error: Unrecognised test [XXX] for suite [YYY]
    at Error (native)
    at ReporterStats.getTestStats (/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/utils/ReporterStats.js:269:23)
    at ReporterStats.testFail (/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/utils/ReporterStats.js:315:34)
    at BaseReporter.<anonymous> (/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/utils/BaseReporter.js:138:25)
    at emitOne (events.js:90:13)
    at BaseReporter.emit (events.js:182:7)
    at BaseReporter.handleEvent (/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/utils/BaseReporter.js:278:27)
    at Launcher.messageHandler (/Users/sullenor/Documents/repo/yharnam/node_modules/webdriverio/build/lib/launcher.js:469:28)
    at emitTwo (events.js:100:13)
    at ChildProcess.emit (events.js:185:7)

The error itself occurs in the before hook and wdio tries to get test stats for the suite, which doesn’t exist in the suiteStats.tests object.

I checked manually and looks like changing const title = runner.currentTest || runner.title to const title = runner.title || runner.currentTest helps here (https://github.com/webdriverio/webdriverio/blob/master/lib/utils/ReporterStats.js#L165), but I am not sure, that it’s a proper solution.

I wonder if you can check this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:33 (12 by maintainers)

github_iconTop GitHub Comments

8reactions
mattlubcommented, Dec 14, 2017

has anyone managed to patch the ReporterStats.js file to fix this temporarily?

4reactions
skeggsecommented, Dec 11, 2017

I’m still seeing this when, just like #2494, an error occurs in a test hook.

describe('things', function() {
  beforeEach(function() {
    throw new Error('failure');
  });

  it('should pass', function() {
    // noop
  });
});
exports.config = {
  specs: [
    './test/**/*.js'
  ],
  maxInstances: 1,
  capabilities: [{
    browserName: 'chrome',
    name: 'test failure'
  }],
  sync: true,
  logLevel: 'error',
  coloredLogs: true,
  deprecationWarnings: true,
  bail: 0,
  waitforTimeout: 10000,
  connectionRetryTimeout: 90000,
  connectionRetryCount: 3,
  services: ['selenium-standalone'],
  framework: 'mocha',
  mochaOpts: {
    ui: 'bdd'
  }
};
$ npx wdio

wdio-repro/node_modules/webdriverio/build/lib/utils/ReporterStats.js:381
            if (!suiteStats.tests[uid]) throw Error(`Unrecognised test [${runner.title}] for suite [${runner.parent}]`);
                                        ^

Error: Unrecognised test ["before each" hook for "should pass"] for suite [things]
    at Error (native)
    at ReporterStats.getTestStats (wdio-repro/node_modules/webdriverio/build/lib/utils/ReporterStats.js:381:47)
    at ReporterStats.testFail (wdio-repro/node_modules/webdriverio/build/lib/utils/ReporterStats.js:450:30)
    at BaseReporter.<anonymous> (wdio-repro/node_modules/webdriverio/build/lib/utils/BaseReporter.js:159:25)
    at emitOne (events.js:96:13)
    at BaseReporter.emit (events.js:188:7)
    at BaseReporter.handleEvent (wdio-repro/node_modules/webdriverio/build/lib/utils/BaseReporter.js:300:27)
    at Launcher.messageHandler (wdio-repro/node_modules/webdriverio/build/lib/launcher.js:646:28)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
$ (node:1665) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: channel closed
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown Test Status - Kaseya HelpDesk
In Traverse, tests can enter an Unknown test status for several reasons: When a new test is created, it is added to the...
Read more >
Pytest - testing parser Error : Unrecognised arguments
The problem comes from the parser.parse_args call which accepts an optional args argument. If this argument is not provided, args are taken ...
Read more >
Fever of Unknown Origin (FUO) - Infectious Diseases
Medical records are checked for previous test results, particularly those that effectively rule out certain disorders. Physical examination. The general ...
Read more >
Pulmonary function tests reveal unrecognised lung ... - PubMed
Pulmonary function tests reveal unrecognised lung dysfunction and have independent prognostic significance in patients with systemic AL ...
Read more >
[BUG] Unknown test(s) in worker #14425 - GitHub
When running parameterized tests with randomly generated names using faker library tests are failing with the error "Unknown test(s) in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found