Skip to content
Permalink
Browse files

[bamboo] Automated branch merge (from release-25.0.0:cb7a3f33fc46f68b…

…fd1a9bc48d2770e9feeabf6d)
  • Loading branch information...
opennms-bamboo committed Sep 6, 2019
2 parents 3cb7644 + cb7a3f3 commit f11272f4eb5b78e2d7cfc7652733624a65c92858
Showing with 15 additions and 7 deletions.
  1. +15 −7 smoke-test/src/test/java/org/opennms/smoketest/ScheduledOutageIT.java
@@ -36,15 +36,18 @@

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.Select;
import org.openqa.selenium.support.ui.WebDriverWait;

/**
* Verifies that the scheduled outage text is correctly displayed. See LTS-233.
*/
public class ScheduledOutageIT extends OpenNMSSeleniumIT {

@Before
public void beforeClass() throws Exception {
final String node = "<node type=\"A\" label=\"TestMachine\" foreignSource=\"" + REQUISITION_NAME + "\" foreignId=\"TestMachine\">" +
@@ -65,25 +68,21 @@ public void after() throws Exception {
deleteTestRequisition();
}

@Ignore
@Test
public void testWeekly() throws Exception {
testOption("Weekly", "Every Sunday, From 00:00:00 Through 23:59:59");
}

@Ignore
@Test
public void testMonthly() throws Exception {
testOption("Monthly", "Every Sunday, From 00:00:00 Through 23:59:59");
}

@Ignore
@Test
public void testDaily() throws Exception {
testOption("Daily", "Daily, From 00:00:00 Through 23:59:59");
}

@Ignore
@Test
public void testSpecific() throws Exception {
final String dateString = new SimpleDateFormat("dd-MMM-yyyy").format(new Date());
@@ -96,7 +95,7 @@ public void testOption(final String option, final String text) throws Exception
// Enter the name...
enterText(By.xpath("//form[@action='admin/sched-outages/editoutage.jsp']//input[@name='newName']"), "My-Scheduled-Outage");
// ...and hit the button.
findElementByXpath("//form[@action='admin/sched-outages/editoutage.jsp']//input[@name='newOutage']").click();
findElementByXpath("//form[@action='admin/sched-outages/editoutage.jsp']//button[@name='newOutage']").click();

// Wait till the editor page appears.
with().pollInterval(1, SECONDS).await().atMost(10, SECONDS).until(() -> pageContainsText("Editing Outage: My-Scheduled-Outage"));
@@ -105,8 +104,17 @@ public void testOption(final String option, final String text) throws Exception
// ...and confirm the alert box.
getDriver().switchTo().alert().accept();

final WebDriverWait webDriverWait = new WebDriverWait(getDriver(), 10);
final String outageTypeSelectorXPath = "//select[@id='outageTypeSelector']";

try {
webDriverWait.until(ExpectedConditions.elementToBeClickable(By.xpath(outageTypeSelectorXPath)));
} catch (final StaleElementReferenceException e) {
webDriverWait.until(ExpectedConditions.elementToBeClickable(By.xpath(outageTypeSelectorXPath)));
}

// Set the specified outage type...
new Select(findElementByXpath("//select[@id='outageTypeSelector']")).selectByVisibleText(option);
new Select(findElementByXpath(outageTypeSelectorXPath)).selectByVisibleText(option);
// ...and apply.
findElementByXpath("//input[@name='setOutageType']").click();
// now add the outage

0 comments on commit f11272f

Please sign in to comment.
You can’t perform that action at this time.