Search in sources :

Example 1 with MessagesFixture

use of com.android.tools.idea.tests.gui.framework.fixture.MessagesFixture in project android by JetBrains.

the class GradleRenameModuleTest method testCannotRenameRootModule.

@Test
public void testCannotRenameRootModule() throws IOException {
    guiTest.importSimpleApplication();
    ProjectViewFixture.PaneFixture paneFixture = guiTest.ideFrame().getProjectView().selectProjectPane();
    paneFixture.selectByPath("SimpleApplication");
    invokeRefactor();
    InputDialogFixture renameModuleDialog = InputDialogFixture.findByTitle(guiTest.robot(), "Rename Module");
    renameModuleDialog.enterTextAndClickOk("SimpleApplication2");
    MessagesFixture errorMessage = MessagesFixture.findByTitle(guiTest.robot(), "Rename Module");
    errorMessage.requireMessageContains("Can't rename root module");
    errorMessage.clickOk();
}
Also used : InputDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture) ProjectViewFixture(com.android.tools.idea.tests.gui.framework.fixture.ProjectViewFixture) MessagesFixture(com.android.tools.idea.tests.gui.framework.fixture.MessagesFixture) Test(org.junit.Test)

Example 2 with MessagesFixture

use of com.android.tools.idea.tests.gui.framework.fixture.MessagesFixture in project android by JetBrains.

the class GradleRenameModuleTest method testCannotRenameToExistingFile.

@Test
public void testCannotRenameToExistingFile() throws IOException {
    guiTest.importMultiModule();
    ProjectViewFixture.PaneFixture paneFixture = guiTest.ideFrame().getProjectView().selectProjectPane();
    paneFixture.selectByPath("MultiModule", "app");
    invokeRefactor();
    SelectRefactoringDialogFixture selectRefactoringDialog = SelectRefactoringDialogFixture.findByTitle(guiTest.robot());
    selectRefactoringDialog.selectRenameModule();
    selectRefactoringDialog.clickOk();
    InputDialogFixture renameModuleDialog = InputDialogFixture.findByTitle(guiTest.robot(), "Rename Module");
    renameModuleDialog.enterTextAndClickOk("library2");
    MessagesFixture errorMessage = MessagesFixture.findByTitle(guiTest.robot(), "Rename Module");
    errorMessage.requireMessageContains("Module named 'library2' already exist");
    errorMessage.clickOk();
    // In this case, the rename dialog will let you choose another name, click cancel to close the dialog
    renameModuleDialog.clickCancel();
}
Also used : InputDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture) SelectRefactoringDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.SelectRefactoringDialogFixture) ProjectViewFixture(com.android.tools.idea.tests.gui.framework.fixture.ProjectViewFixture) MessagesFixture(com.android.tools.idea.tests.gui.framework.fixture.MessagesFixture) Test(org.junit.Test)

Aggregations

InputDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture)2 MessagesFixture (com.android.tools.idea.tests.gui.framework.fixture.MessagesFixture)2 ProjectViewFixture (com.android.tools.idea.tests.gui.framework.fixture.ProjectViewFixture)2 Test (org.junit.Test)2 SelectRefactoringDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.SelectRefactoringDialogFixture)1