jnhyperion / HyperRobotFrameworkPlugin

Robot Framework plugin for PyCharm.
34 stars 5 forks source link

[Pycharm] Resource with variables in path is not navigable on click #51

Open dprevost-LMI opened 1 year ago

dprevost-LMI commented 1 year ago

In my project, we are doing iOS and Android tests, so we include resources depending on which platform's device we are testing. To do so, when using the Resource to import a file, we use a platform variable.

However, even if I fixed the platform's value in the variables section, the plugin cannot import the Keywords included in the resource. So the navigation when clicking on the keyword from my test case does not work (i.e. Go To > Declaration or Usage).

Like shown below, if I use ./Resources/Android/Login.robot it works, but not with ./Resources/${platform}/Login.robot

*** Settings ***
Resource      ./Resources/${platform}/Login.robot
#Resource      ./Resources/Android/Login.robot

*** Variables ***
${platform} Android
jnhyperion commented 1 year ago

@dprevost-LMI thanks for your feedback.

If the variable is statically defined, perhaps it's possible to resolve the file path.

Will consider add this feature in the future.

dprevost-LMI commented 1 year ago

@dprevost-LMI thanks for your feedback.

If the variable is statically defined, perhaps it's possible to resolve the file path.

Will consider add this feature in the future.

FYI: It is always the same for my local usage, but it's dynamic for pipeline usage

apallier commented 1 month ago

Hi, is there a workaround to pass global variable values like the --variable option does?

jnhyperion commented 1 month ago

The variable is set in robot runtime, which means plugin will never know the exact resource path, what the plugin can do is to predict the variable based on your static code context. This could be complex and not implemented yet.