use of com.android.tools.idea.tests.gui.framework.fixture.SlideFixture in project android by JetBrains.
the class ChooseResourceDialogTest method testColorPickerAlpha.
/**
* Test that the alpha slider and the textfield are hidden when we are not in ARGB.
*/
@Test
public void testColorPickerAlpha() throws IOException {
guiTest.importSimpleApplication();
ThemeEditorFixture themeEditor = ThemeEditorGuiTestUtils.openThemeEditor(guiTest.ideFrame());
ThemeEditorTableFixture themeEditorTable = themeEditor.getPropertiesTable();
TableCell cell = row(1).column(0);
JTableCellFixture colorCell = themeEditorTable.cell(cell);
ResourceComponentFixture resourceComponent = new ResourceComponentFixture(guiTest.robot(), (ResourceComponent) colorCell.editor());
colorCell.startEditing();
resourceComponent.getSwatchButton().click();
ChooseResourceDialogFixture dialog = ChooseResourceDialogFixture.find(guiTest.robot());
ColorPickerFixture colorPicker = dialog.getColorPicker();
Color color = new Color(200, 0, 0, 200);
colorPicker.setFormat("ARGB");
colorPicker.setColorWithIntegers(color);
JTextComponentFixture alphaLabel = colorPicker.getLabel("A:");
SlideFixture alphaSlide = colorPicker.getAlphaSlide();
alphaLabel.requireVisible();
alphaSlide.requireVisible();
colorPicker.setFormat("RGB");
alphaLabel.requireNotVisible();
alphaSlide.requireNotVisible();
colorPicker.setFormat("HSB");
alphaLabel.requireNotVisible();
alphaSlide.requireNotVisible();
dialog.clickOK();
colorCell.stopEditing();
}
Aggregations