public void ParameterizedBuild()
 {
     Assert.That(_jenkins.IsChecked("This build is parameterized"), Is.True,
                 "'This build is parameterized' is not checked");
     Assert.That(_jenkins.GetValueByXPath("String Parameter",
                                          "./tr/td[preceding-sibling::td[text()='Name']]/input"),
                 Is.EqualTo("sha1"));
     Assert.That(_jenkins.GetValueByXPath("String Parameter",
                                          "./tr/td[preceding-sibling::td[text()='Default Value']]/input"),
                 Is.Empty);
     Assert.That(_jenkins.GetTextByXPath("String Parameter",
                                         "./tr/td[preceding-sibling::td[text()='Description']]/textarea"),
                 Is.EqualTo("What pull request to build, e.g. origin/pr/9/head"));
 }
        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"));
        }