@Test public void testSwitchLanguage(){
applet.menuItem("options").click();
DialogFixture dialog = applet.dialog();
JTabbedPaneFixture tabs = new JTabbedPaneFixture(dialog.robot,(JTabbedPane)dialog.robot.finder().findByName("tabs"));
tabs.selectTab(1);
JComboBox combobox = (JComboBox)dialog.robot.finder().find(new NameMatcher("language"));
for(int i=0;i<combobox.getItemCount();i++){
if(((String)combobox.getItemAt(i)).equals("German")){
combobox.setSelectedIndex(i);
break;
}
}
JButtonFixture applybutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("apply",true)));
applybutton.click();
Assert.assertEquals("Neu", applet.menuItem("new").component().getText());
for(int i=0;i<combobox.getItemCount();i++){
if(((String)combobox.getItemAt(i)).equals("American English")){
combobox.setSelectedIndex(i);
System.out.println("set USA");
break;
}
}
JButtonFixture okbutton = new JButtonFixture(dialog.robot, (JButton)dialog.robot.finder().find(new NameMatcher("ok",true)));
okbutton.click();
Assert.assertFalse(dialog.component().isShowing());
Assert.assertEquals("New", applet.menuItem("new").component().getText()); // fails in test only?
}