Intellij plugin testing [message #1752960] |
Tue, 31 January 2017 06:22  |
Eclipse User |
|
|
|
Hi,
I am working on a plugin for Intellij IDE and have to automate the GUI tests by using Jubula.
Problem....
Need to get the selected text's properties (ex:color) in the source code editing area. When the source code editing area is selected from mapping mode most of the properties are shown, it also includes the "selected text" if any. But it shows the "selected text color" as null always.I need to get the color of the selected text.
Please provide a solution.
Intellij version : 2016.2.4
Jubula version : 8.4.1.123
|
|
|
Re: Intellij plugin testing [message #1753136 is a reply to message #1752960] |
Thu, 02 February 2017 02:34   |
Eclipse User |
|
|
|
Hi Lakshan,
unfortunately, we can not do anything against the empty property since this value is solely defined on the IntelliJ-side. However, you could try to add a class with a static method to your plugin which retrieves the value by then using ub_grc_invokeAndStore from our unbound modules in Jubula.
In your plugin define a class, wherein you define a static method with an Object argument and a String return value. Inside the method, parse the object to com.intellij.openapi.editor.impl.EditorImpl and call getSelectionModel().getTextAttributes().getForegroundColor() on the editor and then any method to convert it to a String e.g. getRGB() on the color. It might also be possible that getForegroundColor() is not exactly the color you are looking for so you should have a look at which method exactly retrieves the desired color. Then simply return this value.
In Jubula, use ub_grc_invokeAndStore and configure it according to our documentation. You do not have to enter any other arguments since the graphics component the action was mapped to, so in this case the editor, will be given as first argument to your method.
Best regards,
Kevin
|
|
|
|
Powered by
FUDForum. Page generated in 0.26185 seconds