Search in sources :

Example 1 with DialogFixture

use of org.assertj.swing.fixture.DialogFixture in project jabref by JabRef.

the class GUITest method testDatabasePropertiesDialog.

@Test
public void testDatabasePropertiesDialog() throws IOException {
    newDatabase();
    mainFrame.menuItemWithPath("File", "Library properties").click();
    robot().waitForIdle();
    DialogFixture databasePropertiesDialog = findDialog(DatabasePropertiesDialog.class).withTimeout(10_000).using(robot());
    takeScreenshot(databasePropertiesDialog, "DatabasePropertiesDialog");
    databasePropertiesDialog.button(new GenericTypeMatcher<JButton>(JButton.class) {

        @Override
        protected boolean isMatching(@Nonnull JButton jButton) {
            return "OK".equals(jButton.getText());
        }
    }).click();
    closeDatabase();
    exitJabRef();
}
Also used : DialogFixture(org.assertj.swing.fixture.DialogFixture) Nonnull(org.assertj.swing.dependency.jsr305.Nonnull) JButton(javax.swing.JButton) GenericTypeMatcher(org.assertj.swing.core.GenericTypeMatcher) Test(org.junit.Test)

Example 2 with DialogFixture

use of org.assertj.swing.fixture.DialogFixture in project jabref by JabRef.

the class GUITest method testOpenAndSavePreferences.

@Test
public void testOpenAndSavePreferences() throws IOException {
    mainFrame.menuItemWithPath("Options", "Preferences").click();
    robot().waitForIdle();
    DialogFixture preferencesDialog = findDialog(PreferencesDialog.class).withTimeout(10_000).using(robot());
    takeScreenshot(preferencesDialog, "PreferencesDialog");
    preferencesDialog.button(new GenericTypeMatcher<JButton>(JButton.class) {

        @Override
        protected boolean isMatching(@Nonnull JButton jButton) {
            return "OK".equals(jButton.getText());
        }
    }).click();
    exitJabRef();
}
Also used : DialogFixture(org.assertj.swing.fixture.DialogFixture) Nonnull(org.assertj.swing.dependency.jsr305.Nonnull) JButton(javax.swing.JButton) GenericTypeMatcher(org.assertj.swing.core.GenericTypeMatcher) Test(org.junit.Test)

Aggregations

JButton (javax.swing.JButton)2 GenericTypeMatcher (org.assertj.swing.core.GenericTypeMatcher)2 Nonnull (org.assertj.swing.dependency.jsr305.Nonnull)2 DialogFixture (org.assertj.swing.fixture.DialogFixture)2 Test (org.junit.Test)2