public static void SaveVideoIfTestFalse() { if (TestContext.CurrentContext.Result.Outcome != ResultState.Failure) { return; } var pathToVideo = DriverBuilder.TryGetSolutionDirectoryInfo() + $@"\WebDriverFactory\selenoid\video\{TestContext.CurrentContext.Test.Name}.mp4"; WaitFor.Condition(() => File.Exists(pathToVideo), builder => builder.SetMaxWaitTime(TimeSpan.FromSeconds(10)).Build(), "File not exist after 10 seconds" ); TestContext.AddTestAttachment(pathToVideo); AllureLifecycle.Instance.AddAttachment(pathToVideo); }
public GetWeatherContext() { Driver = DriverBuilder.CreateDriver(); WeatherSearchPage = new WeatherSearchPageObject(Driver, TestsConfiguration.Url); }
public static IWebDriver GetWebDriver() => LocalWebDriver.Value ?? (LocalWebDriver.Value = DriverBuilder.GetDriver());