コード例 #1
0
ファイル: SeleniumUtilsTest.cs プロジェクト: Magenic/MAQS
        public void AccessibilityPassesCheckRespectsMessageLevel()
        {
            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.CheckAccessibilityPasses(TestObject.WebDriver, fileLogger, MessageType.SUCCESS);
                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("Inapplicable check"), "Did not expect inapplicable check"));
                SoftAssert.Assert(() => Assert.IsTrue(!logContent.Contains("Incomplete check"), "Did not expect incomplete check"));
                SoftAssert.Assert(() => Assert.IsTrue(logContent.Contains("Passes check"), "Did expect pass check"));
            }
            finally
            {
                File.Delete(fileLogger.FilePath);
            }
        }