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