简体   繁体   中英

How to inherit step definitions between steps files, Python Selenium Behave

The below picture is representative of my steps folder.

文件组织

Here, when i run my feature file for "childsteps.py", i need it to execute the steps in "parentsteps.py" first then execute the steps in "childsteps.py".

How do i achieve this?, How do i Import those step definitions?

I first thought i should put the step definitions of each file in class and import that class, but I am unable to deduce how I would do this. Please assist.

In your childsteps.py:

from parentsteps import *

Then you can call your steps like that

credentials()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM