use of org.assertj.swing.fixture.JTableFixture in project jabref by JabRef.
the class ParameterizedDialogNewEntryTest method cancelAddingEntryPlainTextOfGivenType.
@Test
public void cancelAddingEntryPlainTextOfGivenType() {
mainFrame.menuItemWithPath("File", "New " + databaseMode + " database").click();
JTableFixture entryTable = mainFrame.table();
entryTable.requireRowCount(0);
mainFrame.menuItemWithPath("BibTeX", "New entry from plain text...").click();
selectEntryType();
GenericTypeMatcher<JDialog> matcher2 = plainTextMatcher();
findDialog(matcher2).withTimeout(10_000).using(robot()).button(new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@Nonnull JButton jButton) {
return "Cancel".equals(jButton.getText());
}
}).click();
entryTable.requireRowCount(0);
}
use of org.assertj.swing.fixture.JTableFixture in project jabref by JabRef.
the class ParameterizedMenuNewEntryTest method addEntryOfGivenType.
// Not working on Travis
@Test
public void addEntryOfGivenType() {
mainFrame.menuItemWithPath("File", "New " + databaseMode + " database").click();
JTableFixture entryTable = mainFrame.table();
entryTable.requireRowCount(0);
mainFrame.menuItemWithPath("BibTeX", "New entry by type...", StringUtil.capitalizeFirst(entryType)).click();
entryTable.requireRowCount(1);
}
use of org.assertj.swing.fixture.JTableFixture in project jabref by JabRef.
the class UndoTest method undoCutOfMultipleEntries.
@Test
public void undoCutOfMultipleEntries() {
importBibIntoNewDatabase(getAbsolutePath("testbib/testjabref.bib"));
JTableFixture entryTable = mainFrame.table();
assertTrue("The database must have at least 2 entries for the test to begin!", entryTable.rowCount() >= 2);
entryTable.selectRows(0, 1);
entryTable.requireSelectedRows(0, 1);
int oldRowCount = entryTable.rowCount();
mainFrame.menuItemWithPath("Edit", "Cut").click();
mainFrame.menuItemWithPath("Edit", "Undo").click();
entryTable.requireRowCount(oldRowCount);
closeDatabase();
exitJabRef();
}
use of org.assertj.swing.fixture.JTableFixture in project jabref by JabRef.
the class UndoTest method undoRedoUpdatedCorrectly.
@Test
public void undoRedoUpdatedCorrectly() {
newDatabase();
assertFalse(mainFrame.menuItemWithPath("Edit", "Undo").isEnabled());
assertFalse(mainFrame.menuItemWithPath("Edit", "Redo").isEnabled());
JTableFixture entryTable = mainFrame.table();
mainFrame.menuItemWithPath("BibTeX", "New entry...").click();
findDialog(EntryTypeDialog.class).withTimeout(10_000).using(robot()).button(new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@Nonnull JButton jButton) {
return "Book".equals(jButton.getText());
}
}).click();
assertTrue(mainFrame.menuItemWithPath("Edit", "Undo").isEnabled());
assertFalse(mainFrame.menuItemWithPath("Edit", "Redo").isEnabled());
entryTable.requireRowCount(1);
mainFrame.menuItemWithPath("Edit", "Undo").click();
assertFalse(mainFrame.menuItemWithPath("Edit", "Undo").isEnabled());
assertTrue(mainFrame.menuItemWithPath("Edit", "Redo").isEnabled());
entryTable.requireRowCount(0);
closeDatabase();
exitJabRef();
}
use of org.assertj.swing.fixture.JTableFixture in project jabref by JabRef.
the class IdFetcherDialogTest method insertEmptySearchID.
@Test
public void insertEmptySearchID() {
mainFrame.menuItemWithPath("File", "New " + databaseMode + " database").click();
JTableFixture entryTable = mainFrame.table();
entryTable.requireRowCount(0);
mainFrame.menuItemWithPath("BibTeX", "New entry...").click();
GenericTypeMatcher<JDialog> matcher = new GenericTypeMatcher<JDialog>(JDialog.class) {
@Override
protected boolean isMatching(JDialog dialog) {
return "Select entry type".equals(dialog.getTitle());
}
};
findDialog(matcher).withTimeout(10_000).using(robot()).button(new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@Nonnull JButton jButton) {
return "Generate".equals(jButton.getText());
}
}).click();
GenericTypeMatcher<JDialog> matcherEmptyDialog = new GenericTypeMatcher<JDialog>(JDialog.class) {
@Override
protected boolean isMatching(JDialog dialog) {
return "Empty search ID".equals(dialog.getTitle());
}
};
findDialog(matcherEmptyDialog).withTimeout(10_000).using(robot()).button(new GenericTypeMatcher<JButton>(JButton.class) {
@Override
protected boolean isMatching(@Nonnull JButton jButton) {
return "OK".equals(jButton.getText());
}
}).click();
entryTable.requireRowCount(0);
}
Aggregations