public void AccessibilityCheckThrows() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); SeleniumUtilities.CheckAccessibility(this.TestObject, true); }
public void AccessibilityCheckVerbose() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); string filePath = ((FileLogger)Log).FilePath; SeleniumUtilities.CheckAccessibility(this.TestObject); string logContent = File.ReadAllText(filePath); Assert.IsTrue(logContent.Contains("Found 18 items"), "Expected to find 18 pass matches."); Assert.IsTrue(logContent.Contains("Found 50 items"), "Expected to find 52 inapplicable matches."); Assert.IsTrue(logContent.Contains("Found 6 items"), "Expected to find 6 violations matches."); Assert.IsTrue(logContent.Contains("Incomplete check for"), "Expected to find any incomplete matches."); }
public void AccessibilityCheckVerbose() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); string filePath = ((IFileLogger)Log).FilePath; SeleniumUtilities.CheckAccessibility(this.TestObject); string logContent = File.ReadAllText(filePath); SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Found 20 items"), "Expected to find 20 pass matches.")); SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Found 62 items"), "Expected to find 62 inapplicable matches.")); SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Found 6 items"), "Expected to find 6 violations matches.")); SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Found 0 items"), "Expected to find 0 incomplete matches.")); SoftAssert.FailTestIfAssertFailed(); }
public void AccessibilityCheckRespectsMessageLevel() { WebDriver.Navigate().GoToUrl(TestSiteUrl); WebDriver.Wait().ForPageLoad(); string filePath = Path.GetDirectoryName(((IFileLogger)Log).FilePath); FileLogger fileLogger = new FileLogger(filePath, "LevTest.txt", MessageType.WARNING); try { SeleniumUtilities.CheckAccessibility(TestObject.WebDriver, fileLogger); string logContent = File.ReadAllText(fileLogger.FilePath); Assert.IsTrue(!logContent.Contains("Passes check for"), "Did not expect expected to check for pass matches."); Assert.IsTrue(!logContent.Contains("Inapplicable check for"), "Did not expect expected to check for inapplicable matches."); Assert.IsTrue(!logContent.Contains("Incomplete check for"), "Did not expected to find any incomplete matches."); Assert.IsTrue(logContent.Contains("Found 6 items"), "Expected to find 6 violations matches."); } finally { File.Delete(fileLogger.FilePath); } }