Error:
TypeError: step_impl() missing 1 required positional argument: 'context'
Code:
@when('the user clicks on "Login"')
def step_impl(self,context):
"""
:type context: behave.runner.Context
"""
homePage.loginButton(self)
Error:
TypeError: step_impl() missing 1 required positional argument: 'context'
Code:
@when('the user clicks on "Login"')
def step_impl(self,context):
"""
:type context: behave.runner.Context
"""
homePage.loginButton(self)
The first argument for the step_impl
function is context
, not self
, hence your error. If you're interested, you can learn a little about positional
and keyword
arguments here.
That is,
@when('the user clicks on "Login"')
def step_impl(context):
"""
:type context: behave.runner.Context
"""
homePage.loginButton(self) # This line of code will break