首页 > 解决方案 > 是否可以从机器人框架关键字转到 python 方法定义?

问题描述

我想使用键盘快捷键从机器人框架文件中使用 python 方法。那可能吗?

机器人框架关键字:

Check something
    Given I have my scenario configured
    When I configure something
    Then Something else happens

Library  myClass.py

myClass.py 上的 Python 方法:

from robot.api.deco import keyword

class myClass(object):
    @keyword('I configure something')
    def i_configure_something(self):
        self.configure()

我会用 Gherkin 解释我想要什么:P

Given I am using VS Code to edit my files
When I highlight the keyword "I configure something"
And I press F12
Then I want it to open my python file and go directly to the method definition.

标签: pythonvisual-studio-coderobotframework

解决方案


我使用 Pycharm 超过 2 年,我使用插件:

  • 机器人框架支持
  • IntelliBot @SeleniumLibrary 已修补(也可以使用 selenium 关键字......因为我们从 Selenium2Library 更改为 SeleniumLibrary)

推荐阅读