wesovilabs / orion

A next-generation testing tool. Orion provides a powerful DSL to write and automate your acceptance tests
http://www.wesovilabs.com/orion
MIT License
48 stars 6 forks source link

run scenarios with a tag #5

Closed ivancorrales closed 3 years ago

ivancorrales commented 3 years ago

Add a new flag named tags to the command run. This flag will be used to determine which scenarios must be executed.

For example, given the below input file

scenario "basic usage" {
  tags= ["sum","maths"]
  given "a couple of numbers" {
    set a {
      value = 1
    }
    set b {
      value = 2
    }
  }
  when "input values are sum" {
    set c {
      value = a + b
    }
  }
  then "the result of variable c is correct" {
    assert {
      assertion = c == 3
    }
  }
}

scenario "basic usage" {
  tags= ["sub", "maths"]
  given "a couple of numbers" {
    set a {
      value = 1
    }
    set b {
      value = 2
    }
  }
  when "do subtraction with the numbers" {
    set c {
      value = a - b
    }
  }
  then "the result of variable c is correct" {
    assert {
      assertion = c == -1
    }
  }
}

the below command should work, and only scenarios with provided tags should be executed.

orion  run --input feature.hcl --tags sum 
orion  run --input feature.hcl --tags sub
orion  run --input feature.hcl --tags maths 
orion  run --input feature.hcl --tags sum,sub
ivancorrales commented 3 years ago

Done by @cdmatta