Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tm-dev] TextCanvas in automatic testing - a method to read the content is missing

Hello list!

o.e.tm.terminal has become *the* text interface in several other
Eclipse projects, e.g.
 - Docker containers' terminal in Linuxtools
 - Debugger Console view in CDT
therefore its accessibility in automatic testing is more and
more important. Testing frameworks (for example SWTBot or Red
Deer) need to locate widgets and perform some actions on them.
In case of o.e.tm.terminal, these tasks roughly translate to:

 1. locating instances of TextCanvas
 2. typing some text
 3. reading the content

There's no major obstacle in achieving 1 and 2. However, 3 isn't
that easy; at least I cannot see a public method in TextCanvas
that would provide that. For now, I'm using a "clipboard"
workaround:

  textCanvas.selectAll();
  content = textCanvas.getSelectionText();

which sort of works but is obviously bad and inherently fragile.

I already filed this as a RFE [1] but then it came to me that
bringing the issue to the mailing list (and adding some
background) could be a good idea...

Best regards
Vaclav

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=517358


Back to the top