diff --git a/Explorer/Assets/DCL/NetworkDefinitions/Browser/UnityAppWebBrowser.cs b/Explorer/Assets/DCL/NetworkDefinitions/Browser/UnityAppWebBrowser.cs index 32928a00c5..5153d42aba 100644 --- a/Explorer/Assets/DCL/NetworkDefinitions/Browser/UnityAppWebBrowser.cs +++ b/Explorer/Assets/DCL/NetworkDefinitions/Browser/UnityAppWebBrowser.cs @@ -1,6 +1,10 @@ using DCL.Multiplayer.Connections.DecentralandUrls; using System; using UnityEngine; +#if ALTTESTER +using DCL.Diagnostics; +using System.IO; +#endif namespace DCL.Browser { @@ -15,7 +19,22 @@ public UnityAppWebBrowser(IDecentralandUrlsSource decentralandUrlsSource) public void OpenUrl(string url) { - Application.OpenURL(Uri.EscapeUriString(url)); + var escaped = Uri.EscapeUriString(url); + +#if ALTTESTER + // ALTTESTER builds write auth URL to disk and suppress the system browser so Playwright tests can drive their own browser to it. + try + { + var path = Path.Combine(Application.persistentDataPath, "auth-url.txt"); + File.WriteAllText(path, escaped); + } + catch (Exception e) + { + ReportHub.LogException(e, ReportCategory.AUTHENTICATION); + } +#else + Application.OpenURL(escaped); +#endif } public void OpenUrl(DecentralandUrl url)