ProjectLighthouse/ProjectLighthouse.Tests.WebsiteTests/Extensions/WebDriverExtensions.cs
Josh 65f317d9bd
Improve website tests (#842)
* Improve website tests

* Use DefaultLang instead of hard coding English
2023-08-03 20:09:32 -05:00

13 lines
No EOL
441 B
C#

using System;
using OpenQA.Selenium;
namespace ProjectLighthouse.Tests.WebsiteTests.Extensions;
public static class WebDriverExtensions
{
private static Uri GetUri(this IWebDriver driver) => new(driver.Url);
public static string GetPath(this IWebDriver driver) => driver.GetUri().AbsolutePath;
public static string GetErrorMessage(this IWebDriver driver) => driver.FindElement(By.CssSelector("#error-message > p")).Text;
}