Class: QaServer::Scenarios

Inherits:
Object
  • Object
show all
Defined in:
app/models/qa_server/scenarios.rb

Constant Summary collapse

AUTHORITY_SCENARIO =
'authority'
TERM_SCENARIOS =
'term'
SEARCH_SCENARIOS =
'search'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authority:, authority_name:, scenarios_config:) ⇒ Scenarios

Returns a new instance of Scenarios.

Parameters:

  • authority (Qa::Authorities::LinkedData::GenericAuthority)

    the instance of the QA authority

  • authoity_name (String)

    the name of the authority the scenario tests (e.g. “agrovoc_direct”)

  • scenarios_config (Hash)

    configurations from the yml file for all scenarios for an authority



27
28
29
30
31
32
33
# File 'app/models/qa_server/scenarios.rb', line 27

def initialize(authority:, authority_name:, scenarios_config:)
  @authority = authority
  @authority_name = authority_name
  @scenarios_config = scenarios_config
  parse_term_scenarios
  parse_search_scenarios
end

Instance Attribute Details

#authorityQa::Authorities::LinkedData::GenericAuthority (readonly)

Returns authority instance the scenarios run against.

Returns:

  • (Qa::Authorities::LinkedData::GenericAuthority)

    authority instance the scenarios run against



10
11
12
# File 'app/models/qa_server/scenarios.rb', line 10

def authority
  @authority
end

#authority_nameString (readonly)

Returns name of the authority the scenarios run against (e.g. ‘agrovoc_direct’).

Returns:

  • (String)

    name of the authority the scenarios run against (e.g. ‘agrovoc_direct’)



13
14
15
# File 'app/models/qa_server/scenarios.rb', line 13

def authority_name
  @authority_name
end

#search_scenariosArray<SearchScenario> (readonly)

Returns the search scenarios to run against the authority.

Returns:

  • (Array<SearchScenario>)

    the search scenarios to run against the authority



19
20
21
# File 'app/models/qa_server/scenarios.rb', line 19

def search_scenarios
  @search_scenarios
end

#term_scenariosArray<TermScenario> (readonly)

Returns the term scenarios to run against the authority.

Returns:

  • (Array<TermScenario>)

    the term scenarios to run against the authority



16
17
18
# File 'app/models/qa_server/scenarios.rb', line 16

def term_scenarios
  @term_scenarios
end