Search in sources :

Example 1 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class ThemeEditorTableFixture method getComboBoxContentsAt.

@NotNull
public List<String> getComboBoxContentsAt(@NotNull final TableCell cell) {
    return GuiQuery.getNonNull(() -> {
        Component renderer = rendererComponentAt(cell);
        checkState(renderer instanceof JComponent, "not a %s: %s", JComponent.class.getSimpleName(), renderer);
        JComboBoxFixture comboBox = new JComboBoxFixture(robot(), robot().finder().findByType((JComponent) renderer, JComboBox.class));
        return ImmutableList.copyOf(comboBox.contents());
    });
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) Component(java.awt.Component) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class ThemeEditorTableFixture method getComboBoxSelectionAt.

@NotNull
public String getComboBoxSelectionAt(@NotNull final TableCell cell) {
    return GuiQuery.getNonNull(() -> {
        Component renderer = rendererComponentAt(cell);
        checkState(renderer instanceof JComponent, "not a %s: %s", JComponent.class.getSimpleName(), renderer);
        JComboBoxFixture comboBox = new JComboBoxFixture(robot(), robot().finder().findByType((JComponent) renderer, JComboBox.class));
        return comboBox.selectedItem();
    });
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) ResourceComponent(com.android.tools.idea.editors.theme.ui.ResourceComponent) Component(java.awt.Component) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class ConfigureAvdOptionsStepFixture method setFrontCamera.

@NotNull
public ConfigureAvdOptionsStepFixture setFrontCamera(@NotNull String selection) {
    JComboBoxFixture frontCameraFixture = findComboBoxWithLabel("Front:");
    frontCameraFixture.selectItem(selection);
    return this;
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class BuildVariantsToolWindowFixture method getTestArtifactComboBox.

@NotNull
private JComboBoxFixture getTestArtifactComboBox() {
    activate();
    Content[] contents = myToolWindow.getContentManager().getContents();
    assertThat(contents.length).isAtLeast(1);
    Content content = contents[0];
    JComboBox comboBox = myRobot.finder().findByType(content.getComponent(), JComboBox.class, true);
    return new JComboBoxFixture(myRobot, comboBox);
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) Content(com.intellij.ui.content.Content) NotNull(org.jetbrains.annotations.NotNull)

Example 5 with JComboBoxFixture

use of org.fest.swing.fixture.JComboBoxFixture in project android by JetBrains.

the class MultiModuleThemeEditorTest method testModuleWithoutThemes.

@Test
public void testModuleWithoutThemes() throws IOException {
    guiTest.importProjectAndWaitForProjectSyncToFinish("MultiAndroidModule");
    final ThemeEditorFixture themeEditor = ThemeEditorGuiTestUtils.openThemeEditor(guiTest.ideFrame());
    final JComboBoxFixture modulesComboBox = themeEditor.getModulesComboBox();
    modulesComboBox.selectItem("app");
    themeEditor.getThemesComboBox().selectItem("AppTheme");
    themeEditor.waitForThemeSelection("AppTheme");
    modulesComboBox.selectItem("nothemeslibrary");
    guiTest.robot().waitForIdle();
    final LogModel logModel = EventLog.getLogModel(guiTest.ideFrame().getProject());
    for (Notification notification : logModel.getNotifications()) {
        assertThat(notification.getType()).isNotEqualTo(NotificationType.ERROR);
    }
}
Also used : JComboBoxFixture(org.fest.swing.fixture.JComboBoxFixture) LogModel(com.intellij.notification.LogModel) ThemeEditorFixture(com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture) Notification(com.intellij.notification.Notification) Test(org.junit.Test)

Aggregations

JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)17 Test (org.junit.Test)8 NotNull (org.jetbrains.annotations.NotNull)7 JTabbedPaneFixture (org.fest.swing.fixture.JTabbedPaneFixture)5 ThemeEditorFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.ThemeEditorFixture)4 Component (java.awt.Component)4 File (java.io.File)4 JTextComponentFixture (org.fest.swing.fixture.JTextComponentFixture)4 JListFixture (org.fest.swing.fixture.JListFixture)3 ResourceComponent (com.android.tools.idea.editors.theme.ui.ResourceComponent)2 NewStyleDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.NewStyleDialogFixture)2 JButtonFixture (org.fest.swing.fixture.JButtonFixture)2 JCheckBoxFixture (org.fest.swing.fixture.JCheckBoxFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 JTableFixture (org.fest.swing.fixture.JTableFixture)2 ThemeSelectionDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.ThemeSelectionDialogFixture)1 AndroidThemePreviewPanelFixture (com.android.tools.idea.tests.gui.framework.fixture.theme.AndroidThemePreviewPanelFixture)1 PublicAtsApi (com.axway.ats.common.PublicAtsApi)1 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 UiElementException (com.axway.ats.uiengine.exceptions.UiElementException)1