Skip to content

step_attributes_interface Class Reference

Bill Moore edited this page Sep 20, 2024 · 9 revisions

step_attributes_interface

Name Description
Class step_attributes_interface Interface for the step's run-time attributes object.
get_step() Gets a reference to the Gherkin step object.
get_current_scenario_sequence() Gets a reference to the current scenario context sequence.
get_current_rule_sequence() Gets a reference to the current rule context sequence.
get_current_feature_sequence() Gets a reference to the current feature context sequence.
get_current_test_sequence() Gets a reference to the test context sequence.
print_attributes() Prints the values of the attributes object.

Class step_attributes_interface

interface class step_attributes_interface;

Interface for the step's run-time attributes object.

When Bathtub runs the user's step definition, Bathtub provisions the step with a run-time step attributes object. The attributes object implements the methods in this step_attributes_interface interface class. The step definition can use its get_step_attributes() function to retrieve its attributes object and call these methods. However, all these methods are more conveniently accessed through the step definition's own step_definition_interface methods. The default step_definition_interface implementation delegates to the respective methods here in the step attributes object.

The run-time attributes are in contrast to the static step attributes, which are accessed through a different interface.

get_step()

pure virtual function gherkin_pkg::step get_step();

Gets a reference to the Gherkin step object.

Returns a reference to a gherkin_pkg::step object which contains the step text and any arguments parsed from the Gherkin feature file.

get_current_scenario_sequence()

pure virtual function scenario_sequence_interface get_current_scenario_sequence();

Gets a reference to the current scenario context sequence.

Returns a reference to the scenario-level context sequence, whose life spans the duration of the currently running Gherkin scenario. The scenario-level context holds a reference to the gherkin_pkg::scenario object representing the current scenario. All the context sequences have a set of UVM pools the step definitions can use to store, retrieve, and share data among themselves. If the scenario is part of a rule, the rule-level sequence is the scenario-level sequence's parent sequence. If there is no rule, the feature-level sequence is the scenario-level sequence's parent sequence. The scenario-level sequence is the parent of the step definition sequence.

get_current_rule_sequence()

pure virtual function rule_sequence_interface get_current_rule_sequence();

Gets a reference to the current rule context sequence.

Returns a reference to the rule-level context sequence, whose life spans the duration of the currently running Gherkin rule. If there is no rule, get_current_rule_sequence() returns null. The rule-level context holds a reference to the gherkin_pkg::rule object representing the current rule. All the context sequences have a set of UVM pools the step definitions can use to store, retrieve, and share data among themselves. The rule-level context has the third highest scope. The feature-level sequence is the rule-level sequence's parent sequence.

get_current_feature_sequence()

pure virtual function feature_sequence_interface get_current_feature_sequence();

Gets a reference to the current feature context sequence.

Returns a reference to the feature-level context sequence, whose life spans the duration of the currently running Gherkin feature. The feature-level context holds a reference to the gherkin_pkg::feature object representing the current feature file. All the context sequences have a set of UVM pools the step definitions can use to store, retrieve, and share data among themselves. The feature-level context has the second highest scope. The test-level sequence is the feature-level sequence's parent sequence.

get_current_test_sequence()

pure virtual function test_sequence_interface get_current_test_sequence();

Gets a reference to the test context sequence.

Returns a reference to the test-level context sequence, whose life spans the duration of the Bathtub test run. The test-level context holds a reference to the Bathtub object. All the context sequences have a set of UVM pools the step definitions can use to store, retrieve, and share data among themselves. The test-level context has the highest scope.

print_attributes()

pure virtual function void print_attributes(uvm_verbosity verbosity);

Prints the values of the attributes object.

Prints the values of the attributes object with the given verbosity. Prints with the default UVM report object, not Bathtub's dedicated report object.