I am trying to execute the following script in selenium
result = driver.execute_script('let result; await axe.run().then((r)=> {result=r}); return result;')
But it is returning
javascript error: await is only valid in async function
I also tried doing
result = @driver.execute_async_script('(async() => {return await axe.run();})();')
but it returned the following error
Selenium::WebDriver::Error::ScriptTimeoutError: script timeout: result was not received in 30 seconds