behave-classy : undefined step references

Hi, I'm using PyCharm 2018.3.2 (professional edition), running python 3.6, and have just installed behave-classy that provides a class-based API for behave step implementations.

While I'm now able to define and run class-based steps thru Behave, my Pycharm feature-file indicates that the steps are undefined.  So, I lose the ability to quickly navigate from the feature step to the method step (via Control-B).  Again, the feature scenarios will run fine.

Here's an example of one of the step methods ...

from behave_classy import step_impl_base

# create a base class that will contain the step definitions in its own local registry.
Base = step_impl_base()

class PlanningMaestro(Base):

@Base.given('I get an initial token')
def get_token(self):
# Send an initial GET request to the server to return an XSRF token we'll need to pass with our next/login request.
response = self.context.the_session.get(str(api_tools.build_url(self.context)))
api_validation.check_response_status(response, 200)
self.context.auth_header['X-XSRF-TOKEN'] = self.context.the_session.cookies['XSRF-TOKEN']
self.context.base_header['X-XSRF-TOKEN'] = self.context.the_session.cookies['XSRF-TOKEN']
...

Here's part of the feature file...
Feature: Profile Management

Background: Setup for each scenario test
Given I load data for adminuser01 from file User_Data.csv
And I get an initial token
And I log on as an admin user
And I get my personal profile information

Scenario Outline: Data-source files can be imported into a new profile
Given I load <profile_test_id> from file Profile_Tests.csv
And I load data for timedim from file Dimension_Time.csv
---
The feature file indicates that the above steps are undefined references.

Is there a way I can get Pycharm to identify these steps?

Thank you

 

1 comment
Comment actions Permalink

Hi,

The issue is probably related to using `behave_classy`, which according to my information we do not support, contrary to `behave`. So resolution errors are probably expected. 

I would suggest to report this to our issue tracker: https://youtrack.jetbrains.com/issues/PY

... providing description, steps to reproduce the issue, minimal working code snippets, and your behave run configuration.

Refer to the following article if you're not familiar with YouTrack:
https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications

0

Please sign in to leave a comment.