Search in sources :

Example 6 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingSingleSelectList method setValue.

/**
     * Set SingleSelectList value
     *
     * @param value the value to set
     * @throws VerificationException if the element doesn't exist
     */
@Override
@PublicAtsApi
public void setValue(String value) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JListFixture) SwingElementLocator.findFixture(this)).selectItem(value);
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 7 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingSingleSelectList method clearSelection.

/**
     * Clears the selection
     *
     * @throws VerificationException if the element doesn't exist
     */
@PublicAtsApi
public void clearSelection() {
    new SwingElementState(this).waitToBecomeExisting();
    ((JListFixture) SwingElementLocator.findFixture(this)).clearSelection();
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 8 with JListFixture

use of org.fest.swing.fixture.JListFixture in project ats-framework by Axway.

the class SwingMultiSelectList method rightClick.

/**
     *
     * @param contextMenuItems context menu items to select
     */
@PublicAtsApi
public void rightClick(String... contextMenuItems) {
    new SwingElementState(this).waitToBecomeExisting();
    JListFixture listFixture = ((JListFixture) SwingElementLocator.findFixture(this));
    JPopupMenuFixture popUpMenu = listFixture.showPopupMenu();
    popUpMenu.menuItemWithPath(contextMenuItems).click();
}
Also used : JPopupMenuFixture(org.fest.swing.fixture.JPopupMenuFixture) JListFixture(org.fest.swing.fixture.JListFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Example 9 with JListFixture

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

the class AddGradleDependencyTest method assertIntentionNotIncluded.

private void assertIntentionNotIncluded(@NotNull EditorFixture editor, @NotNull String intention) {
    editor.invokeAction(SHOW_INTENTION_ACTIONS);
    Robot robot = guiTest.robot();
    JListFixture popup = new JListFixture(robot, waitForPopup(robot));
    String[] intentions = popup.contents();
    assertThat(intentions).asList().doesNotContain(intention);
}
Also used : JListFixture(org.fest.swing.fixture.JListFixture) Robot(org.fest.swing.core.Robot)

Example 10 with JListFixture

use of org.fest.swing.fixture.JListFixture 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

JListFixture (org.fest.swing.fixture.JListFixture)21 PublicAtsApi (com.axway.ats.common.PublicAtsApi)8 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)7 NotNull (org.jetbrains.annotations.NotNull)6 JBList (com.intellij.ui.components.JBList)4 ASGallery (com.android.tools.idea.ui.ASGallery)2 NlPaletteTreeGrid (com.android.tools.idea.uibuilder.palette.NlPaletteTreeGrid)2 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)2 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)2 TemplateEntry (com.android.tools.idea.npw.TemplateEntry)1 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 ElementNotFoundException (com.axway.ats.uiengine.exceptions.ElementNotFoundException)1 VerifyNotEqualityException (com.axway.ats.uiengine.exceptions.VerifyNotEqualityException)1 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 LookupElement (com.intellij.codeInsight.lookup.LookupElement)1 PopupFactoryImpl (com.intellij.ui.popup.PopupFactoryImpl)1 ListPopupModel (com.intellij.ui.popup.list.ListPopupModel)1