0

Currently I have Behave tests that run in Selenium but pick which browser to test based on an Environment Variable. Is there any way to pass text from the command line to a .feature file?

Something like:

DRIVER=chrome behave /path/to/features -i test -D browser=chrome

And then in the test.feature file be able to do something like this:

Feature: Testing something in "{browser}"

  @browser
  Scenario: Something can do something in "{browser}"
    Given I am on "index"
    ...

This would prevent allure reports from considering these the same text or having to write the tests once for each browser. I did figure out how to do tags like this but it didn't cause allure to treat them any differently so the most recent browser is the only version of the test that shows up.

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
Cynic
  • 6,779
  • 2
  • 30
  • 49
  • Part of this is now possible if you use Scenario Outlines and Examples. See http://behave.readthedocs.io/en/latest/new_and_noteworthy_v1.2.5.html#name-may-contain-placeholders still can't find a way for Feature description.] – Cynic Mar 21 '18 at 17:54
  • Also noting it doesn't answer the general question but my example use case may solved by https://github.com/allure-framework/allure2/issues/130 when it gets released. – Cynic Jun 28 '18 at 21:57

0 Answers0