public void RunScanOnGivenElement(string browser) { InitDriver(browser); LoadSimpleTestPage(); var mainElement = Wait.Until(drv => drv.FindElement(By.TagName(mainElementSelector))); AxeResult results = WebDriver.Analyze(mainElement); results.Violations.Should().HaveCount(3); }
public void LoginPageBasic() { LoginPageModel page = new LoginPageModel(this.TestObject); page.OpenLoginPage(); AxeResult result = WebDriver.Analyze(); var resultJson = JsonConvert.SerializeObject(result, Formatting.Indented); Assert.IsTrue(string.IsNullOrEmpty(result.Error) && result.Violations.Length == 0, "Failures:" + resultJson); }
public void LoginPageWithReport() { string reportPath = Path.Combine(LoggingConfig.GetLogDirectory(), "LoginPageWithReport.html"); LoginPageModel page = new LoginPageModel(this.TestObject); page.OpenLoginPage(); AxeResult result = WebDriver.Analyze(); WebDriver.CreateAxeHtmlReport(result, reportPath); if (!string.IsNullOrEmpty(result.Error) || result.Violations.Length != 0) { TestObject.AddAssociatedFile(reportPath); Assert.Fail($"Failed error and/or violation check see {reportPath} for more details."); } }