public void SourceCodeManagement()
 {
     Assert.That(_jenkins.GetTextByXPath("//label[input[@name='scm' and @checked='true']]").Trim(' ', '\n', '\t'),
                 Is.EqualTo("Git"));
     Assert.That(_jenkins.GetValue("Repository URL"),
                 Is.EqualTo("https://github.com/BloomBooks/BloomDesktop.git"));
     Assert.That(_jenkins.GetValue("Branch Specifier (blank for 'any')"),
                 Is.EqualTo("${sha1}"));
     Assert.That(_jenkins.GetTextByXPath("//td[preceding-sibling::td[text()='Repository browser']]" +
                                         "/select/option[@selected]"), Is.EqualTo("githubweb"));
     Assert.That(_jenkins.GetValueByXPath(
                     "//tr[preceding-sibling::tr/td[text()='Repository browser']]//td[preceding-sibling::td[text()='URL']]/input"),
                 Is.EqualTo("https://github.com/BloomBooks/BloomDesktop/"));
 }
        public void BuildPipelineMasterBranchView(string viewName, string branch, string initalJob,
                                                  bool isPreMerge)
        {
            _jenkins.OpenConfigurePage(string.Format("view/Bloom/view/{0}", viewName), "Edit View");
            Assert.That(_jenkins.GetValueByName("name"), Is.EqualTo(viewName));
            string expectedDescription = isPreMerge ?
                                         string.Format("Pre-merge builds of the {0} branch of <b>Bloom</b>", branch)
                                : string.Format("<b>Bloom</b> builds of the {0} branch", branch);

            Assert.That(_jenkins.GetTextByXPath(
                            "//td[preceding-sibling::td[text()='Description']]/textarea"),
                        Is.EqualTo(expectedDescription));
            Assert.That(_jenkins.IsCheckedByName("filterQueue"), Is.False,
                        "'Filter build queue' is checked");
            Assert.That(_jenkins.IsCheckedByName("filterExecutors"), Is.False,
                        "'Filter build executors' is checked");

            Assert.That(_jenkins.GetValue("Build Pipeline View Title"),
                        Is.EqualTo(string.Format("Builds of the `{0}` branch", branch)));
            Assert.That(_jenkins.GetTextByXPath(
                            "//td[preceding-sibling::td[text()='Layout']]"),
                        Is.EqualTo("Based on upstream/downstream relationship"));
            Assert.That(_jenkins.GetValueByXPath(
                            "//td[preceding-sibling::td[text()='Select Initial Job']]/select"),
                        Is.EqualTo(initalJob));
            Assert.That(_jenkins.GetValueByXPath(
                            "//td[preceding-sibling::td[text()='No Of Displayed Builds']]/select"),
                        Is.EqualTo("10"));
            Assert.That(_jenkins.GetValueByXPath("//input[@name='_.triggerOnlyLatestJob' and @checked='true']"),
                        Is.EqualTo("false"), "'Restrict triggers to most recent successful builds' is checked");
            Assert.That(_jenkins.GetValueByXPath("//input[@name='_.alwaysAllowManualTrigger' and @checked='true']"),
                        Is.EqualTo("true"), "'Always allow manual trigger on pipeline steps' is not checked");
            Assert.That(_jenkins.GetValueByXPath("//input[@name='_.showPipelineDefinitionHeader' and @checked='true']"),
                        Is.EqualTo("false"), "'Show pipeline project headers' is checked");
            Assert.That(_jenkins.GetValueByXPath("//input[@name='_.showPipelineParametersInHeaders' and @checked='true']"),
                        Is.EqualTo("true"), "'Show pipeline parameters in project headers' is not checked");
            Assert.That(_jenkins.GetValueByXPath("//input[@name='_.showPipelineParameters' and @checked='true']"),
                        Is.EqualTo("false"), "'Show pipeline parameters in revision box' is not checked");
            Assert.That(_jenkins.GetValue("Refresh frequency (in seconds)"), Is.EqualTo("3"));
            Assert.That(_jenkins.GetValue("URL for custom CSS files"), Is.Empty);
            Assert.That(_jenkins.GetValueByName("_.consoleOutputLinkStyle"),
                        Is.EqualTo("Lightbox"));
        }