I am performing browser testing of an application to check if video is played correctly on both Windows chrome and MAC Safari, this piece of code works fine in chrome and even andriod-ios devices. In all the devices I see both url1
and url2
being triggered in hfired
including on safari, but suprisingly on Safari a test case is being failed with error az is not defined
due to this code but it is working fine on Chrome with the same details
validate=async(hfired,scenario,tracking)=>{
let flag = false;
if(tracking=='ON' && scenario!=exit){
const url1='https://example.com'
hfired.forEach((temp)=>
{
if(temp.includes(url1) || temp.includes('https://abc.xyz')){
flag=true;
}
});
if(flag==false){
throw new Error('Not defined');
}
}
else{
const url2='https://guess.it';
hfired.forEach((temp)=>{
if(!temp.includes(url2) {
throw new Error('az is not defined');
}
});
}
};
Is there some mistake in the script?