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 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 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)")); }