I'm using webdriover.io and .js script to write script for performance testing. I want to mark the test case fail if the script falls into catch block. But the current implementation is showing the all test cases passed even if its falls into catch block.
describe("Android Tests", () => {
beforeEach(async function(){
process.env.SESSIONID=driver.sessionId;
if (args.flag==='true'){
let fx = await outer(inner)
await fx(ACCESSCODE,cmds.get_cpu_level)
}
})
for(let i = 0; i<10;i++)
{
it('App launch task', async () => {
if(type == 'cpu')
{
try {
await ClickBtn.clickHighTask();
await LoginScreen.logIn(USERNAME, PASSWORD, true);
}
catch(err) {
// spec report should log the current iteration is failed.
console.error(err);
}
}
else if(type == 'ram')
{
try {
await ClickBtn.clickHighTask();
await LoginScreen.logIn(USERNAME, PASSWORD, true);
}
catch(err) {
// I can't use any assertion here because I'm doing performance testing.
console.error(err);
}
}
});
}
afterEach(async function(){
await browserStack.sessionTags("Android Phone");
})
I want to mark the test case fail if the driver falls into catch block in the webdriver.io