Search in sources :

Example 1 with AndroidThemePreviewPanelFixture

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

the class ThemeConfigurationTest method testThemesWithConfiguration.

/**
   * Tests that the theme editor deals well with themes defined only in certain configurations
   */
@Test
public void testThemesWithConfiguration() throws IOException {
    guiTest.importSimpleApplication();
    ThemeEditorFixture themeEditor = ThemeEditorGuiTestUtils.openThemeEditor(guiTest.ideFrame());
    JComboBoxFixture themesComboBox = themeEditor.getThemesComboBox();
    themesComboBox.selectItem("Create New Theme");
    NewStyleDialogFixture newStyleDialog = NewStyleDialogFixture.find(guiTest.robot());
    JComboBoxFixture parentComboBox = newStyleDialog.getParentComboBox();
    parentComboBox.selectItem("Show all themes");
    ThemeSelectionDialogFixture themeSelectionDialog = ThemeSelectionDialogFixture.find(guiTest.robot());
    final JTreeFixture categoriesTree = themeSelectionDialog.getCategoriesTree();
    JListFixture themeList = themeSelectionDialog.getThemeList();
    categoriesTree.clickPath("Material Dark");
    guiTest.robot().waitForIdle();
    themeList.clickItem("android:Theme.Material");
    themeSelectionDialog.clickOk();
    parentComboBox.requireSelection("android:Theme.Material");
    JTextComponentFixture newNameTextField = newStyleDialog.getNewNameTextField();
    newNameTextField.click();
    newNameTextField.deleteText();
    newNameTextField.enterText("MyMaterialTheme");
    newStyleDialog.clickOk();
    themeEditor.waitForThemeSelection("MyMaterialTheme");
    AndroidThemePreviewPanelFixture themePreviewPanel = themeEditor.getPreviewComponent().getThemePreviewPanel();
    themePreviewPanel.requirePreviewPanel();
    JButton apiButton = themeEditor.findToolbarButton("API Version in Editor");
    guiTest.robot().click(apiButton);
    clickPopupMenuItem("API 19", "19", apiButton, guiTest.robot());
    themePreviewPanel.requireErrorPanel();
    themesComboBox.selectItem("AppTheme");
    themePreviewPanel.requirePreviewPanel();
    themesComboBox.selectItem("MyMaterialTheme");
    themePreviewPanel.requireErrorPanel();
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ThemeSelectionDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture) NewStyleDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture) JListFixture(org.fest.swing.fixture.JListFixture) ThemeEditorFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture) JTextComponentFixture(org.fest.swing.fixture.JTextComponentFixture) AndroidThemePreviewPanelFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture) Test(org.junit.Test)

Aggregations

ThemeSelectionDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture)1 AndroidThemePreviewPanelFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture)1 NewStyleDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture)1 ThemeEditorFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture)1 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)1 JListFixture (org.fest.swing.fixture.JListFixture)1 JTextComponentFixture (org.fest.swing.fixture.JTextComponentFixture)1 JTreeFixture (org.fest.swing.fixture.JTreeFixture)1 Test (org.junit.Test)1