Protractor: Export Config: BeforeLaunch: How to get current spec file name?

Created on 23 Jul 2018  ·  3Comments  ·  Source: angular/protractor

we run multiple tests by some search pattern.

How to get current going to run spec file in 'beforeLaunch' of 'export.config' ?

it is logging by protractor here:

[chrome #01-0] Specs: C:Users....node_modules....js

but i can not get it programmatically. Is there any way?

100 thanks in advance

Most helpful comment

+1

All 3 comments

+1

+1

In case if you have not found solution you can use below snippet to get current specs name

onPrepare: async () => {
await browser.getProcessedConfig().then((config) => {
console.log(config.specs[0])
})

Was this page helpful?
0 / 5 - 0 ratings