Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
How to get the names of all spec-files after WDIO session

This is my first post on Stack Overflow so I hope I'm doing it right.

So I have a config file that looks like this

exports.config = {
    specs: [
        './test/specs/change-account-name.test.js',
        './test/specs/change-account-language.test.js',
        './test/specs/change-account-timezone.test.js'
    ],
    maxInstances: 10,
    capabilities: [{
        maxInstances: 5,
        //
        browserName: 'chrome',
        acceptInsecureCerts: true
    }],
    logLevel: 'info',
    baseUrl: "<webpage address>",
    waitforTimeout: 10000,
    connectionRetryTimeout: 120000,
    connectionRetryCount: 3,
    services: ['chromedriver'],
    framework: 'mocha',
    reporters: [
        'spec',
        [CustomReporter, {
            application: "<web app name>",
            system: "production",
            outputDir: "./results/"
        }]
    ],
    mochaOpts: {
        ui: 'bdd',
        timeout: 60000
    }
}

I want to gain access to the file names of the specs after all the test suites have run. I thought these would be accessible from the afterSession hook through the spec-parameter. For my example this would look something like this:

[
 './test/specs/change-account-name.test.js',
 './test/specs/change-account-language.test.js',
 './test/specs/change-account-timezone.test.js'
]

But when I inspect the argument only one of the spec files is passed to specs:

['./test/specs/change-account-name.test.js']

Any ideas why this is the case?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!