Search in sources :

Example 1 with FileChooserDialogFixture

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

the class ChooseGradleHomeDialogFixture method chooseGradleHome.

@NotNull
public ChooseGradleHomeDialogFixture chooseGradleHome(@NotNull File gradleHomePath) {
    FixedSizeButton browseButton = robot().finder().findByType(target(), FixedSizeButton.class, true);
    robot().click(browseButton);
    FileChooserDialogFixture fileChooserDialog = FileChooserDialogFixture.findDialog(robot(), new GenericTypeMatcher<JDialog>(JDialog.class) {

        @Override
        protected boolean isMatching(@NotNull JDialog dialog) {
            Collection<JLabel> descriptionLabels = robot().finder().findAll(dialog, JLabelMatcher.withText("Gradle home:"));
            return descriptionLabels.size() == 1;
        }
    });
    fileChooserDialog.select(findFileByIoFile(gradleHomePath, true));
    fileChooserDialog.clickOk();
    return this;
}
Also used : FileChooserDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.FileChooserDialogFixture) Collection(java.util.Collection) FixedSizeButton(com.intellij.openapi.ui.FixedSizeButton) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

FileChooserDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.FileChooserDialogFixture)1 FixedSizeButton (com.intellij.openapi.ui.FixedSizeButton)1 Collection (java.util.Collection)1 NotNull (org.jetbrains.annotations.NotNull)1