use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.
the class TranslationsEditorTest method basics.
@Test
public void basics() {
Object expected = Arrays.asList("English (en)", "English (en) in United Kingdom (GB)", "Hebrew (iw)", "Tamil (ta)", "Chinese (zh) in China (CN)");
assertEquals(expected, myTranslationsEditor.locales());
assertEquals(Arrays.asList("action_settings", "app_name", "cancel", "hello_world"), myTranslationsEditor.keys());
// Cancel in zh-rCN
JTableCellFixture cancel = myTranslationsEditor.getTable().cell(TableCell.row(2).column(7));
assertEquals("取消", cancel.value());
assertEquals(-1, cancel.font().target().canDisplayUpTo("取消"));
}
use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.
the class ChooseSystemImageStepFixture method selectSystemImage.
@NotNull
public ChooseSystemImageStepFixture selectSystemImage(@NotNull String releaseName, @NotNull String apiLevel, @NotNull String abiType, @NotNull String targetName) {
final TableView systemImageList = robot().finder().findByType(target(), TableView.class, true);
JTableFixture systemImageListFixture = new JTableFixture(robot(), systemImageList);
JTableCellFixture cell = systemImageListFixture.cell(rowWithValue(releaseName, apiLevel, abiType, targetName).column(0));
cell.select();
return this;
}
use of org.fest.swing.fixture.JTableCellFixture in project intellij-community by JetBrains.
the class ConfigureProjectSubsetDialogFixture method selectModule.
@NotNull
public ConfigureProjectSubsetDialogFixture selectModule(@NotNull String moduleName, boolean selected) {
JTableCellFixture cell = myModulesTable.cell(moduleName);
myModulesTable.enterValue(row(cell.row()).column(0), String.valueOf(selected));
return this;
}
use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.
the class ModulesToImportDialogFixture method setSelected.
@NotNull
public ModulesToImportDialogFixture setSelected(@NotNull String moduleName, boolean selected) {
JTableFixture moduleTable = getModuleTable();
JTableCellFixture cell = moduleTable.cell(moduleName);
moduleTable.enterValue(TableCell.row(cell.row()).column(0), String.valueOf(selected));
return this;
}
use of org.fest.swing.fixture.JTableCellFixture in project android by JetBrains.
the class BuildVariantsToolWindowFixture method selectVariantForModule.
@NotNull
public BuildVariantsToolWindowFixture selectVariantForModule(@NotNull final String module, @NotNull String variant) {
activate();
Content[] contents = myToolWindow.getContentManager().getContents();
assertThat(contents.length).isAtLeast(1);
Content content = contents[0];
JTable variantsTable = myRobot.finder().findByType(content.getComponent(), JTable.class, true);
final String moduleColumnText = "Module: '" + module + "'";
JTableFixture table = new JTableFixture(myRobot, variantsTable);
JTableCellFixture moduleCell = table.cell((jTable, cellReader) -> {
int rowCount = jTable.getRowCount();
for (int i = 0; i < rowCount; i++) {
int moduleColumnIndex = 0;
String currentModule = cellReader.valueAt(jTable, i, moduleColumnIndex);
if (moduleColumnText.equals(currentModule)) {
return row(i).column(moduleColumnIndex);
}
}
throw new AssertionError("Failed to find module '" + module + "' in 'Build Variants' view");
});
TableCell variantCellCoordinates = row(moduleCell.row()).column(1);
String selectedVariant = table.valueAt(variantCellCoordinates);
if (!variant.equals(selectedVariant)) {
// Attempt to select variant if it is not already selected.
JTableCellFixture variantCell = table.cell(variantCellCoordinates);
variantCell.enterValue(variant);
myProjectFrame.waitForBuildToFinish(BuildMode.SOURCE_GEN);
}
return this;
}
Aggregations