intellibot
intellibot copied to clipboard
Support for resolving paths that are given as Robot variables
Hi,
It would be great if plugin could resolve paths to resources that are given as Robot variable. For instance: Now plugin is working good once we put the absolute path to resource eg.
Resources /home/test/lib/keywords.robot
Keywords resolving works in such case.
Once I put some Robot variable in variables section for instance in the same testfile eg.
${RESOURCE} /home/test/lib/
And then:
Resource ${RESOURCE}keywords.robot
Keywords resolving doesn't work in such case. There is message from PyCharm: "Import file not found"
+1 None of current Robot plugins currently support this. Even if all the plugin did was to read in a robotvariables.py file it would be great.
I'm having the same problem. I'm trying to use the built in global robot framework variable ${EXECDIR}, like this: Resource ${EXECDIR}/Sites/Resources/CST.robot
The execution of the scripts works without errors, but every line in my test cases section says "Keyword definition not found" and all are underlined with red, so I've lost the ability to use ctrl + click to navigation through the scripts.
The only way to make the red lines go away is to change the resources so that they use the full execution path: Resource C:/dev/scripts/robotfw/Sites/Resources/CST.robot
This work around isn't great because everyone on the team seems to be using a different execution path. It would be nice if we could use the global execution directory variable ${EXECDIR} that comes with robot framework.
+1 I think almost everyone uses a variable to point to resource location or at least to some part of that path, thus keyword navigation becomes impossible for anyone that applies this good practice.
In case anyone is interested, I made some modifications to the plugin code to partly do what is being discussed here. More specifically, in the case of the example above, when a variable named ${RESOURCE} is encountered in a path the new code will substitute the content of a environment variable named ROBOT_RESOURCE. This is a quick fix that makes intellibot much more useful in our setup, where we have a lot of files with a few variable of the same name with the same value. So if you have lots of variables, or variables with the same name having different values in different files then this won't do much for you.
It involved changes in only one file. If someone wants it I can share the resulting jar as well as the modified source file.
If you want to make a pull request I would be happy to take and build off of it. I recently added some of the built in vars and I imagine that can help there too.
I'll test your latest. It's likely that all the functionality I added is already there. If not then I'll make the pull request.
So I did add a good deal of resolution for variables. I think getting to the context though is something yet to be added. For example resource ${CUR_DIR}/a/sample.robot
will still have issues because CUR_DIR has no context to /user/you/project/src
(yet).
How do I install this latest version ? I downloaded the ZIP file, installed the plugin but upon restarting IntelliJ 15.0.3 Coomunity Ed., I got:
"Cannot load project: com.intellij.ide.plugins.PluginManager$StartupAbortedException: com.intellij.diagnostic.PluginException: com.millennialmedia.intellibot.psi.RobotPsiManager PluginClassLoader[com.millennialmedia.intellibot, 0.9.143.381] [Plugin: com.millennialmedia.intellibot]"
What am I missing ?
The latest artifact that I have generated is the jar file in the master branch (https://github.com/millennialmedia/intellibot/raw/master/intellibot.jar). If you build it yourself you have to make sure that that python.jar is of scope provided in the module dependency settings. Then when you build the plugin you should get a jar artifact as opposed to a zip. I do not know what zip you mean otherwise.
Same issue here. We defined the same keywords in different PO models for different targets and have a variable for pointing to the right resource directory. So we could really use the support for variables in resource path.
(I tried the master jar build, it does not support it).
I would do the PR if that can help, but I have no idea where to start.
(I use it in PyCharm 2016.1.4, if that's of any use)
Is there any current workaround for this addition?
I am having the same issues. Is there an update for this? work around or solution? Thanks
+1 I'm working on a project that uses a ${root_directory} variable in all its files to provide an absolute path. When calling pybot, we use -v to define the root_directory variable. Is there any way to add variables to Intellibot like the -v for pybot?
+1 same issue for ${EXECDIR}. Would love to see this resolved.
+1
+1
+1
I think I've found a workaround / solution folks @lmc182 Resources /models/google_search/HomePage.robot ##doesn't resolve Resources models/google_search/HomePage.robot ##resolves perfectly.
I am having a similar issue...any solution for this??