Search in sources :

Example 11 with ThemeEditorFixture

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

the class NewStyleDialogGuiTest method testCreateNewThemeSelection.

/**
   * When "Create New Theme" is selected, opened dialog contains theme that was edited
   * as a parent.
   *
   * Is a regression test for http://b.android.com/180575
   */
@Test
public void testCreateNewThemeSelection() throws IOException {
    guiTest.importSimpleApplication();
    final ThemeEditorFixture themeEditor = ThemeEditorGuiTestUtils.openThemeEditor(guiTest.ideFrame());
    final JComboBoxFixture themesComboBox = themeEditor.getThemesComboBox();
    themesComboBox.selectItem("Theme.AppCompat.Light.NoActionBar");
    themesComboBox.selectItem("Create New Theme");
    final NewStyleDialogFixture newStyleDialog1 = NewStyleDialogFixture.find(guiTest.robot());
    assertEquals("Theme.AppCompat.Light.NoActionBar", newStyleDialog1.getParentComboBox().selectedItem());
    newStyleDialog1.clickCancel();
    themeEditor.waitForThemeSelection("Theme.AppCompat.Light.NoActionBar");
    themesComboBox.selectItem("Theme.AppCompat.NoActionBar");
    themesComboBox.selectItem("Create New Theme");
    final NewStyleDialogFixture newStyleDialog2 = NewStyleDialogFixture.find(guiTest.robot());
    assertEquals("Theme.AppCompat.NoActionBar", newStyleDialog2.getParentComboBox().selectedItem());
    newStyleDialog2.clickCancel();
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) NewStyleDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture) ThemeEditorFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture) Test(org.junit.Test)

Aggregations

ThemeEditorFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture)11 Test (org.junit.Test)10 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)4 ThemeSelectionDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture)3 NewStyleDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture)3 EditorFixture (com.android.tools.idea.tests.gui.framework.fixture.EditorFixture)2 Ignore (org.junit.Ignore)2 IdeFrameFixture (com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture)1 RenameRefactoringDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.RenameRefactoringDialogFixture)1 AndroidThemePreviewPanelFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture)1 ThemeEditorTableFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorTableFixture)1 LogModel (com.intellij.notification.LogModel)1 Notification (com.intellij.notification.Notification)1 TableCell (org.fest.swing.data.TableCell)1 JListFixture (org.fest.swing.fixture.JListFixture)1 JTextComponentFixture (org.fest.swing.fixture.JTextComponentFixture)1 JTreeFixture (org.fest.swing.fixture.JTreeFixture)1 NotNull (org.jetbrains.annotations.NotNull)1