Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda