using Microsoft.Playwright;

namespace Beam.Playwright {
    public delegate Task PlaywrightAsyncManipulator(IPage page);

    public static class PlaywrightContext {
        public static Lazy<IPlaywright> Playwright { get; set; }
        public static Lazy<IBrowser> Browser { get; set; }

        //public static Task<IBrowser> OpenBrowser() {

        //}

        static PlaywrightContext() {
            Playwright = new Lazy<IPlaywright>(() => Microsoft.Playwright.Playwright.CreateAsync().Result);
            Browser = new Lazy<IBrowser>(() => Playwright.Value.Chromium.LaunchAsync().Result);
        }
    }

}
