Ejemplo n.º 1
0
        public void AccessibilityInapplicableCheckRespectsMessageLevel()
        {
            WebDriver.Navigate().GoToUrl(TestSiteUrl);
            WebDriver.Wait().ForPageLoad();

            string     filePath   = Path.GetDirectoryName(((IFileLogger)Log).FilePath);
            FileLogger fileLogger = new FileLogger(filePath, this.TestContext.TestName + ".txt", MessageType.INFORMATION);

            try
            {
                SeleniumUtilities.CheckAccessibilityInapplicable(TestObject.WebDriver, fileLogger, MessageType.WARNING, false);
                string logContent = File.ReadAllText(fileLogger.FilePath);
                SoftAssert.Assert(() => Assert.IsTrue(!logContent.Contains("Violations check"), "Did not expect violation check"));
                SoftAssert.Assert(() => Assert.IsTrue(!logContent.Contains("Passes check"), "Did not expect pass check"));
                SoftAssert.Assert(() => Assert.IsTrue(!logContent.Contains("Incomplete check"), "Did not expect incomplete check"));
                SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Inapplicable check"), "Did expect inapplicable check"));
            }
            finally
            {
                File.Delete(fileLogger.FilePath);
            }
        }