Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

228
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda