package guitests;

import static junit.framework.TestCase.assertTrue;

import java.io.IOException;

import org.junit.Test;

import guitests.guihandles.AlertDialogHandle;
import seedu.address.commons.events.storage.DataSavingExceptionEvent;

public class ErrorDialogGuiTest extends AddressBookGuiTest {

    private static final String ERROR_DIALOG_STAGE_TITLE = "File Op Error";

    @Test
    public void showErrorDialogs() throws InterruptedException {
        raise(new DataSavingExceptionEvent(new IOException("Stub")));

        guiRobot.waitForEvent(() -> guiRobot.isWindowShown(ERROR_DIALOG_STAGE_TITLE));
        AlertDialogHandle alertDialog = new AlertDialogHandle(ERROR_DIALOG_STAGE_TITLE);
        assertTrue(alertDialog.isMatching("Could not save data", "Could not save data to file" + ":\n"
                                                                         + "java.io.IOException: Stub"));

    }

}

@@ -62,16 +62,251 @@
 ertTrue;
+%0Aimport static seedu.address.ui.UiManager.FILE_OPS_ERROR_DIALOG_CONTENT_MESSAGE;%0Aimport static seedu.address.ui.UiManager.FILE_OPS_ERROR_DIALOG_HEADER_MESSAGE;%0Aimport static seedu.address.ui.UiManager.FILE_OPS_ERROR_DIALOG_STAGE_TITLE;
 %0A%0Aimport
@@ -535,85 +535,8 @@
  %7B%0A%0A
-    private static final String ERROR_DIALOG_STAGE_TITLE = %22File Op Error%22;%0A%0A
     
@@ -736,16 +736,25 @@
 owShown(
+FILE_OPS_
 ERROR_DI
@@ -835,16 +835,25 @@
 gHandle(
+FILE_OPS_
 ERROR_DI
@@ -917,141 +917,107 @@
 ing(
-%22Could not save data%22, %22Could not save data to file%22 + %22:%5Cn%22%0A                                                                        
+FILE_OPS_ERROR_DIALOG_HEADER_MESSAGE,%0A                FILE_OPS_ERROR_DIALOG_CONTENT_MESSAGE + %22:%5Cn%22
  + %22

Use string constants in UiManager