I have a test. I use wdio and mocha. And I want after test to get my test result (pass or fail) and save in some varible. How does I can do it? I red mocha documentation and find this https://mochajs.org/api/runnable but I always has undefined result. I can`t understand how I should use it?
describe('some title', () => {
it('some title', async () => {
const runnable = new Runnable('some title', async () => {
expect(await (await somePage1.someProp1).getText()).equal('some text 1');
expect(await (await SomePage2.someProp2).getText()).equal('some text 2');
});
console.log(runnable.state);
});
});