Author: vpakan(a)redhat.com
Date: 2012-07-26 05:42:59 -0400 (Thu, 26 Jul 2012)
New Revision: 42737
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
Log:
Improve finding of editor containing opened file when using method openFile().
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java
===================================================================
---
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2012-07-26
09:30:27 UTC (rev 42736)
+++
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/view/ExplorerBase.java 2012-07-26
09:42:59 UTC (rev 42737)
@@ -122,7 +122,14 @@
}
item.select().doubleClick();
log.info("File Opened:" + builder.toString());
- SWTBotEditor editor = bot.activeEditor();
+ SWTBotEditor editor = null;
+ // Try to find editor containing opened file
+ try{
+ editor = bot.editorByTitle(path[path.length - 1]);
+ } catch (WidgetNotFoundException wnfe){
+ // in case name of opened file is different then editor title of editor containing
opened file
+ editor = bot.activeEditor();
+ }
return editor;
}
/**
Show replies by date