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();
}
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();
}
Aggregations