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