package guitests;

import javafx.application.Platform;
import org.junit.Test;
import util.DialogMessage;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

import static org.junit.Assert.assertEquals;
import static org.loadui.testfx.Assertions.assertNodeExists;
import static org.loadui.testfx.controls.Commons.hasText;

public class DialogMessageTests extends UITest {

    @Test
    public void showErrorDialogTest() {
        Platform.runLater(() -> DialogMessage.showErrorDialog("Error", "Test Error Dialog"));
        waitUntilNodeAppears(hasText("Test Error Dialog"));
        assertNodeExists(hasText("Test Error Dialog"));
        clickOn("OK");
    }

    @Test
    public void showYesNoWarningDialogTest() throws ExecutionException, InterruptedException {
        FutureTask<Boolean> yesTask = new FutureTask<>(() ->
                DialogMessage.showYesNoWarningDialog("Warning", "Warning Header", "Warning Message", "yEs", "nO"));
        Platform.runLater(yesTask);
        waitUntilNodeAppears(hasText("Warning Header"));
        assertNodeExists(hasText("Warning Header"));
        clickOn("yEs");
        assertEquals(true, yesTask.get());
        FutureTask<Boolean> noTask = new FutureTask<>(() ->
                DialogMessage.showYesNoWarningDialog("Warning", "Warning Header", "Warning Message", "yEs", "nO"));
        Platform.runLater(noTask);
        waitUntilNodeAppears(hasText("Warning Message"));
        assertNodeExists(hasText("Warning Message"));
        clickOn("nO");
        assertEquals(false, noTask.get());
    }

    @Test
    public void showInformationDialogTest() {
        Platform.runLater(() -> DialogMessage.showInformationDialog("Information", "Test Information Dialog"));
        waitUntilNodeAppears(hasText("Test Information Dialog"));
        assertNodeExists(hasText("Test Information Dialog"));
        clickOn("OK");
    }
}

@@ -1576,32 +1576,934 @@
 .get());%0A    %7D%0A%0A
+    @Test%0A    public void showYesNoConfirmationDialogTest() throws ExecutionException, InterruptedException %7B%0A        FutureTask%3CBoolean%3E yesTask = new FutureTask%3C%3E(() -%3E%0A                DialogMessage.showYesNoConfirmationDialog(%22Confirm%22, %22Confirm Header%22, %22Confirm Message%22, %22yEs%22, %22nO%22));%0A        Platform.runLater(yesTask);%0A        waitUntilNodeAppears(hasText(%22Confirm Header%22));%0A        assertNodeExists(hasText(%22Confirm Header%22));%0A        clickOn(%22yEs%22);%0A        assertEquals(true, yesTask.get());%0A%0A        FutureTask%3CBoolean%3E noTask = new FutureTask%3C%3E(() -%3E%0A                DialogMessage.showYesNoWarningDialog(%22Confirm%22, %22Confirm Header%22, %22Confirm Message%22, %22yEs%22, %22nO%22));%0A        Platform.runLater(noTask);%0A        waitUntilNodeAppears(hasText(%22Confirm Message%22));%0A        assertNodeExists(hasText(%22Confirm Message%22));%0A        clickOn(%22nO%22);%0A        assertEquals(false, noTask.get());%0A    %7D%0A%0A
     @Test%0A    pu

Add test for `DialogMessage.showYesNoConfirmationDialog`