public void HomePageWithComplexReport()
        {
            string reportPath = Path.Combine(LoggingConfig.GetLogDirectory(), "HomePageWithComplexReport.html");
            string rawResults = Path.Combine(LoggingConfig.GetLogDirectory(), "HomePageWithComplexReport.json");

            // Get to home page
            LoginPageModel page = new LoginPageModel(this.TestObject);

            page.OpenLoginPage();
            page.LoginWithValidCredentials(Config.GetGeneralValue("User"), Config.GetGeneralValue("Pass"));

            // Setup custom rules
            AxeBuilder builder = new AxeBuilder(WebDriver)
                                 .Exclude("#HomePage")
                                 .WithOutputFile(rawResults)
                                 .DisableRules("landmark-one-main", "page-has-heading-one");

            // Reprot
            WebDriver.CreateAxeHtmlReport(builder.Analyze(), reportPath);

            // Check if there were any violations
            if (!File.ReadAllText(reportPath).Contains("Violation: 0"))
            {
                TestObject.AddAssociatedFile(reportPath);
                TestObject.AddAssociatedFile(rawResults);
                Assert.Fail($"Failed violation check see {reportPath} for more details.");
            }
        }
        public void BasicLoginTest()
        {
            // Get to home page
            LoginPageModel page = new LoginPageModel(this.TestObject);

            page.OpenLoginPage();
            HomePageModel home = page.LoginWithValidCredentials(Config.GetGeneralValue("User"), Config.GetGeneralValue("Pass"));

            Assert.IsTrue(home.IsPageLoaded(), "Failed to load homepage");
        }
Beispiel #3
0
        public void EnterValidCredentialsTest()
        {
            string         username = "******";
            string         password = "******";
            LoginPageModel page     = new LoginPageModel(this.TestObject);

            page.OpenLoginPage();
            HomePageModel homepage = page.LoginWithValidCredentials(username, password);

            Assert.IsTrue(homepage.IsPageLoaded());
        }