Search in sources :

Example 1 with JTreeFixture

use of org.fest.swing.fixture.JTreeFixture in project intellij-community by JetBrains.

the class RunConfigurationsDialogFixture method getTreeFixture.

public JTreeFixture getTreeFixture() {
    Tree tree = robot().finder().findByType(target(), Tree.class, true);
    JTreeFixture fixture = new JTreeFixture(robot(), tree);
    fixture.replaceCellReader(new RunConfigurationsJTreeCellReader());
    return fixture;
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) Tree(com.intellij.ui.treeStructure.Tree)

Example 2 with JTreeFixture

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

the class IdeSettingsDialogFixture method selectSdkPage.

@NotNull
public IdeSettingsDialogFixture selectSdkPage() {
    JPanel optionsEditor = field("myEditor").ofType(JPanel.class).in(getDialogWrapper()).get();
    List<JComponent> trees = findComponentsOfType(optionsEditor, "com.intellij.openapi.options.newEditor.SettingsTreeView");
    JComponent tree = Iterables.getOnlyElement(trees);
    JTree jTree = field("myTree").ofType(JTree.class).in(tree).get();
    JTreeFixture jTreeFixture = new JTreeFixture(robot(), jTree);
    jTreeFixture.replaceCellReader(TREE_NODE_CELL_READER);
    // It takes a few seconds to load the whole tree.
    Wait.seconds(5).expecting("The desired path is loaded").until(() -> {
        try {
            jTreeFixture.selectPath("Appearance & Behavior/System Settings/Android SDK");
            return true;
        } catch (LocationUnavailableException e) {
            return false;
        }
    });
    return this;
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) LocationUnavailableException(org.fest.swing.exception.LocationUnavailableException) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with JTreeFixture

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

the class ProjectViewFixture method showPropertiesForLibrary.

@NotNull
public LibraryPropertiesDialogFixture showPropertiesForLibrary(@NotNull String libraryName) {
    selectProjectPane();
    new JTreeFixture(myRobot, GuiTests.waitUntilShowing(myRobot, Matchers.byType(ProjectViewTree.class))).clickPath("External Libraries/" + libraryName, MouseButton.RIGHT_BUTTON);
    new JMenuItemFixture(myRobot, GuiTests.waitUntilShowing(myRobot, Matchers.byText(JMenuItem.class, "Library Properties..."))).click();
    return LibraryPropertiesDialogFixture.find(myRobot, libraryName, myProject);
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) ProjectViewTree(com.intellij.ide.projectView.impl.ProjectViewTree) JMenuItemFixture(org.fest.swing.fixture.JMenuItemFixture) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with JTreeFixture

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

Example 5 with JTreeFixture

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

the class SwingTree method select.

/**
 * Select tree element by index
 *
 * @param rowIndex tree element index to select
 * @throws VerificationException if the tree element doesn't exist
 */
@Override
@PublicAtsApi
public void select(int rowIndex) {
    new SwingElementState(this).waitToBecomeExisting();
    ((JTreeFixture) SwingElementLocator.findFixture(this)).selectRow(rowIndex);
}
Also used : JTreeFixture(org.fest.swing.fixture.JTreeFixture) SwingElementState(com.axway.ats.uiengine.utilities.swing.SwingElementState) PublicAtsApi(com.axway.ats.common.PublicAtsApi)

Aggregations

JTreeFixture (org.fest.swing.fixture.JTreeFixture)20 PublicAtsApi (com.axway.ats.common.PublicAtsApi)8 SwingElementState (com.axway.ats.uiengine.utilities.swing.SwingElementState)8 Test (org.junit.Test)5 JPopupMenuFixture (org.fest.swing.fixture.JPopupMenuFixture)4 NotNull (org.jetbrains.annotations.NotNull)4 EditorFixture (com.android.tools.idea.tests.gui.framework.fixture.EditorFixture)3 IdeFrameFixture (com.android.tools.idea.tests.gui.framework.fixture.IdeFrameFixture)3 MergedManifestFixture (com.android.tools.idea.tests.gui.framework.fixture.MergedManifestFixture)3 ImmutableList (com.google.common.collect.ImmutableList)2 JComboBoxFixture (org.fest.swing.fixture.JComboBoxFixture)2 JListFixture (org.fest.swing.fixture.JListFixture)2 JMenuItemFixture (org.fest.swing.fixture.JMenuItemFixture)2 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 SwingDriverInternal (com.axway.ats.uiengine.internal.driver.SwingDriverInternal)1 ProjectViewTree (com.intellij.ide.projectView.impl.ProjectViewTree)1