using NUnit.Framework;
using OpenQA.Selenium;
using AOW4.SeleniumTests.Driver;

namespace AOW4.SeleniumTests.Tests;

[TestFixture]
public abstract class BaseTest
{
    protected IWebDriver Driver = null!;
    protected string BaseUrl => "http://localhost:5212/";

    [OneTimeSetUp]
    public void GlobalSetup()
    {
        Driver = DriverFactory.CreateChromeDriver();
        Driver.Manage().Window.Maximize();
    }

    [OneTimeTearDown]
    public void GlobalTeardown()
    {
        try
        {
            Driver.Quit();
        }
        catch
        {
        }
    }

    protected void GoHome()
    {
        Driver.Navigate().GoToUrl(BaseUrl);
    }
}
