use of com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture in project android by JetBrains.
the class GradleRenameModuleTest method testRenameModuleAlsoChangeReferencesInBuildFile.
@Test
public void testRenameModuleAlsoChangeReferencesInBuildFile() throws IOException {
guiTest.importMultiModule();
ProjectViewFixture.PaneFixture paneFixture = guiTest.ideFrame().getProjectView().selectProjectPane();
paneFixture.selectByPath("MultiModule", "library");
invokeRefactor();
SelectRefactoringDialogFixture selectRefactoringDialog = SelectRefactoringDialogFixture.findByTitle(guiTest.robot());
selectRefactoringDialog.selectRenameModule();
selectRefactoringDialog.clickOk();
InputDialogFixture renameModuleDialog = InputDialogFixture.findByTitle(guiTest.robot(), "Rename Module");
renameModuleDialog.enterTextAndClickOk("newLibrary");
guiTest.waitForBackgroundTasks();
assertThat(guiTest.ideFrame().hasModule("newLibrary")).named("newLibrary module exists").isTrue();
// app module has two references to library module
GradleBuildModelFixture buildModel = guiTest.ideFrame().parseBuildFileForModule("app");
ExpectedModuleDependency expected = new ExpectedModuleDependency();
expected.configurationName = "debugCompile";
expected.path = ":newLibrary";
buildModel.requireDependency(expected);
expected.configurationName = "releaseCompile";
buildModel.requireDependency(expected);
}
use of com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture 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.InputDialogFixture 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();
}
use of com.android.tools.idea.tests.gui.framework.fixture.InputDialogFixture in project android by JetBrains.
the class GradleRenameModuleTest method testRenameModule.
@RunIn(TestGroup.UNRELIABLE)
@Test
public void testRenameModule() throws IOException {
guiTest.importSimpleApplication();
ProjectViewFixture.PaneFixture paneFixture = guiTest.ideFrame().getProjectView().selectProjectPane();
paneFixture.selectByPath("SimpleApplication", "app");
invokeRefactor();
SelectRefactoringDialogFixture selectRefactoringDialog = SelectRefactoringDialogFixture.findByTitle(guiTest.robot());
selectRefactoringDialog.selectRenameModule();
selectRefactoringDialog.clickOk();
InputDialogFixture renameModuleDialog = InputDialogFixture.findByTitle(guiTest.robot(), "Rename Module");
renameModuleDialog.enterTextAndClickOk("app2");
renameModuleDialog.waitUntilNotShowing();
guiTest.ideFrame().waitForGradleProjectSyncToStart().waitForGradleProjectSyncToFinish();
assertThat(guiTest.ideFrame().hasModule("app2")).named("app2 module exists").isTrue();
assertThat(guiTest.ideFrame().hasModule("app")).named("app module exists").isFalse();
}
Aggregations