private void addProjectConfigurationInFirstProject() { final PMDProjectPropertyDialogBot dialog = JavaProjectClient.openPMDProjectPropertyDialog(PROJECT_NAME_1); assertTrue("PMD should be enabled", dialog.enablePMD().isChecked()); assertTrue( "The button to add a new configuration should be enabled when PMD is enabled", dialog.addConfiguration().isEnabled()); dialog.enablePMD().select(); dialog.addConfiguration().click(); final AddRuleSetConfigurationWizardBot wizard = AddRuleSetConfigurationWizardBot.getActive(); assertFalse( "The finish button should be disabled as long as the name is missing", wizard.finish().isEnabled()); wizard.project().click(); wizard.next().click(); assertFalse( "The finish button should be disabled as long as the name is missing", wizard.finish().isEnabled()); wizard.name().setText(PROJECT_CONFIGURATION_NAME); assertFalse( "The finish button should be disabled as long as the location is missing", wizard.finish().isEnabled()); final String projectRelativePath = PMD_XML.toString(); wizard.location().setText(projectRelativePath); wizard.bot().waitUntil(Conditions.tableHasRows(wizard.rules(), 2)); final String[] expectedNames = new String[] {"ExtendsObject", "BooleanInstantiation"}; final String[] actualNames = wizard.ruleNames(); assertArrayEquals("Rules of the PMD configuration", expectedNames, actualNames); assertTrue( "The finish button should be enabled if bot a name and a location with a valid configuration is available", wizard.finish().isEnabled()); wizard.finish().click(); wizard.bot().waitUntil(Conditions.shellCloses(wizard)); dialog.bot().waitUntil(Conditions.tableHasRows(dialog.configurations(), 3)); assertTrue( "The added configuration should be activated", dialog.configurations().getTableItem(2).isChecked()); assertEquals( "Name of the configuration", PROJECT_CONFIGURATION_NAME, dialog.configurations().cell(2, "Name")); assertEquals("Type of the configuration", "Project", dialog.configurations().cell(2, "Type")); assertEquals( "Location of the configuration", projectRelativePath, dialog.configurations().cell(2, "Location")); dialog.ok().click(); dialog.bot().waitUntil(Conditions.shellCloses(dialog)); }