Stub Gen Selenium Tests
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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 => System.Environment.GetEnvironmentVariable("BASE_URL") ?? "http://localhost:5000";
|
||||
|
||||
[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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user