using ESuite.UI.E2E.Helpers;
using OpenQA.Selenium;

namespace ESuite.UI.E2E
{
    [Binding]
    public class BrowserContext
    {
        public static IWebDriver? driver { get; private set; }

        [BeforeScenario(Order = 1)]
        public static void InitializeDriver()
        { 
            driver = WebDriverHelper.GetWebDriver();
        }
        public static void DeleteCookies()
        {
            driver!.Manage().Cookies.DeleteAllCookies();
        }

        [AfterTestRun]
        public static void Dispose()
        {
            driver?.Quit();
        }
    }
}
