N
N
NeonTH2020-06-04 19:45:55
Python
NeonTH, 2020-06-04 19:45:55

Python Behave + Selenium testing - skips features, scenario, steps. How to fix?

Hello, I am a beginner QA. I need help running a test on the behave framework. It looks like it only runs before_all (getting webdriver) and after_all (quiting webdriver) but skips all tests inside the step.py file

My .feature file is:

Feature: steps

Scenario: Creating and checking new task
 Given Create and check new task "http://link.com"


My step.py file:
@given(u'Create and check new task "{url}')
def step_impl(context, url):
    context.browser.driver1.find_element_by_id("add_new_todo").click()
    print('Adding new task')
    time.sleep(3)
    category_list = Select(context.browser.driver1.find_element_by_id("select_category"))
    category_list.select_by_index(1)
    print('Chosen category "Работа')
    time.sleep(2)
    context.browser.driver1.find_element_by_id("project_text").click()
    context.browser.driver1.find_element_by_id("project_text").send_keys("New task")
    print('Giving name to a new task')
    time.sleep(2)
    context.browser.driver1.find_element_by_id("submit_add_todo").click()
    time.sleep(3)


Output:
Feature: steps

  Scenario: Creating and checking new task

  Scenario: Creating an empty task

  Scenario: Creating new category

  Scenario: Validating checkbox

0 features passed, 0 failed, 1 skipped
0 scenarios passed, 0 failed, 4 skipped
0 steps passed, 0 failed, 4 skipped, 0 undefined
Took 0m0.000s

Process finished with exit code 0


Directory:
features\
features\feature_folder\steps.feature
features\steps\steps.py
features\driver\chromedriver.exe
features\environment.py
features\FrameworkRunner.py


How to fix it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question