Class: SuitesResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/berl/suites_resolver.rb

Overview

Service to resolve suites

Class Method Summary collapse

Class Method Details

.resolve_suitesObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/berl/suites_resolver.rb', line 5

def self.resolve_suites
  suites_path = ENV['PARALLELE_SCENARIOS_PATH']

  files = Dir.glob("#{Dir.pwd}/#{suites_path}/**/*.{yml,yaml}")
  suites = []

  files.each do |path|
    content = IO.read(path)
    match = content.match(/\s+((api|ui|domain)[^:]+)/)
    suite = match.to_s.strip

    suites.push(suite) if suite.length.positive?
  end

  suites
end