public void RunOnSameNode()
 {
     Assert.That(_jenkins.IsChecked(
                     "Run this job on the same node where another job has last ran"), Is.True,
                 "'Run this job on the same node where another job has last ran' not checked");
     Assert.That(_jenkins.GetValueByName("_.job"),
                 Is.EqualTo("GitHub-Bloom-Linux-any-master-debug"));
     Assert.That(_jenkins.IsCheckedByName("_.shareWorkspace"), Is.True,
                 "'Share Workspace' not checked");
 }
Exemplo n.º 2
0
        public void TimeOutStrategy()
        {
            Assert.That(_jenkins.IsChecked("Abort the build if it's stuck"), Is.True,
                        "'Abort the build if it's stuck' not checked");

            Assert.That(_jenkins.GetTextByXPath(
                            "//td[preceding-sibling::td[text()='Time-out strategy']]/select/option[@selected]"),
                        Is.EqualTo("No Activity"));

            Assert.That(_jenkins.GetValueByName("_.timeoutSecondsString"), Is.EqualTo("180"));

            Assert.That(_jenkins.GetTextByXPath(
                            "//td[preceding-sibling::td[text()='Time-out actions']]//div/b"),
                        Is.EqualTo("Abort the build"));
        }
        public void GitHubTrigger()
        {
            Assert.That(_jenkins.IsChecked(
                            "GitHub Pull Request Builder"), Is.True,
                        "'GitHub Pull Request Builder' not checked");
            // It seems that no matter what we set the setting from the config.xml file is
            // ignored in the UI.
//			Assert.That(_jenkins.IsCheckedByName(
//				"_.displayBuildErrorsOnDownstreamBuilds"), Is.True,
//				"'Display build errors on downstream builds' not checked");
            Assert.That(_jenkins.IsCheckedByName(
                            "_.allowMembersOfWhitelistedOrgsAsAdmin"), Is.True,
                        "'Allow members of whitelisted organisations as admins' not checked");
            Assert.That(_jenkins.GetValueByName("_.branch"),
                        Is.EqualTo(BranchName));
            Assert.That(_jenkins.GetTextByName("_.adminlist"),
                        Is.EqualTo("ermshiperete"));
            Assert.That(_jenkins.IsCheckedByName("_.useGitHubHooks"), Is.True,
                        "'Use github hooks for build triggering' not checked");
            Assert.That(_jenkins.GetTextByName("_.whitelist"),
                        Is.EqualTo("StephenMcConnel hatton phillip-hopper davidmoore1 gmartin7 JohnThomson"));
            Assert.That(_jenkins.GetTextByName("_.orgslist"),
                        Is.EqualTo("BloomBooks"));
            Assert.That(_jenkins.GetValueByXPath("//td[preceding-sibling::td[text()='Crontab line']]/input"),
                        Is.EqualTo("H/5 * * * *"));
        }
        public void AllView()
        {
            _jenkins.OpenConfigurePage("view/Bloom/view/All", "Edit View");
            Assert.That(_jenkins.GetValueByName("name"), Is.EqualTo("All"));
            Assert.That(_jenkins.GetTextByXPath(
                            "//td[preceding-sibling::td[text()='Description']]/textarea"),
                        Is.EqualTo("All <b>Bloom</b> jobs"));
            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.IsCheckedByName("useincluderegex"), Is.True,
                        "'Use a regular expression to include jobs into the view' is not checked");
            Assert.That(_jenkins.GetValueByName("includeRegex"),
                        Is.EqualTo("(^Bloom(-|_).*|^GitHub-Bloom-.*)"));

            var groupingTable = _jenkins.Driver.FindElementsByXPath(
                "//tbody[tr/td/div/b[text()='Regex Grouping Rule']]");

            Assert.That(groupingTable.Count, Is.EqualTo(6));

            Assert.That(groupingTable[0].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo("^Bloom-.*-(default|master)-debug$"));
            Assert.That(groupingTable[0].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.EqualTo("master branch compile jobs"));

            Assert.That(groupingTable[1].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo("^Bloom-.*-(default|master)-.*Tests$"));
            Assert.That(groupingTable[1].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.EqualTo("master branch unit tests"));

            Assert.That(groupingTable[2].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo(".*(Packaging).*"));
            Assert.That(groupingTable[2].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.Empty);

            Assert.That(groupingTable[3].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo(".*-Trigger-.*"));
            Assert.That(groupingTable[3].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.EqualTo("master branch builds"));

            Assert.That(groupingTable[4].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo("^GitHub.*-master-.*"));
            Assert.That(groupingTable[4].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.EqualTo("Pre-merge builds of GitHub pull requests (master branch)"));

            Assert.That(groupingTable[5].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Regex for categorization']]/input")).GetAttribute("value"),
                        Is.EqualTo("^GitHub.*-Version.*-.*"));
            Assert.That(groupingTable[5].FindElement(By.XPath(
                                                         ".//td[preceding-sibling::td[text()='Naming Rule']]/input")).GetAttribute("value"),
                        Is.EqualTo("Pre-merge builds of GitHub pull requests (Release branch)"));
        }