0

I am working on a Selenium Python project where I need to run test cases to share insights to my team members. The issue is that I want to use this command:

behave -f allure_behave.formatter:AllureFormatter -o allure/results ./features

to execute 1 specific feature file like the one below:

createrequest.feature

Feature: Creation of top up requests


  Background: Access to EZ-Link's Utility Top Up Menu
    Given the user access EZ-Link's Portal
    When he enter login information
    Then he should be able to login to Utility Top Up navigation menu


  Scenario: Create top up request for new card
    Given the user click on create top up (new card) request navigation menu
    When he enter job order number and top up amount in the request page
    And check the total top-up amount
    Then the successful submission response is displayed once request is submitted for new card
    And status should display "Pending" once he key in the new card job order number in the View Top Up Request page


  Scenario: Create top up request for existing card
    Given the user click on create top up (existing card) request navigation menu
    When he enter job order number in the request page
    And check the total topup amount
    Then the successful submission response is displayed once request is submitted for existing card
    And status should display "Pending" once he key in the existing card job order number in the View Top Up Request page>

May I know how to run this specific feature file using the aforementioned behave command in Pycharm?

piet.t
  • 11,718
  • 21
  • 43
  • 52
TechGeek49
  • 476
  • 1
  • 7
  • 24

1 Answers1

1

I have already figured out the solution. If you want to run a specific feature file using allure command, you can try this:

behave -f allure_behave.formatter:AllureFormatter -o allure/results ./features/createrequest.feature

For my case, the feature file I wanna run is createrequest.feature thus I just add it in the command. Before the command is being used, please create directory for your allure report. Make sure your directory is like this:

Project name
|
|---allure
|     |---results(sub-directory of allure folder)
|     |---reports(sub-directory of allure folder)    
|
|---features
|     |
|     |---steps(sub-directory of features folder)
|     |
|     feature files

This is what I believe the recommended practice for creating directories akin to Python BDD using behave. Hope this answers your question.

For more info: How to Allure-behave generate report from test cases. Allure generated only one report from one test case

TechGeek49
  • 476
  • 1
  • 7
  • 24