testplan.testing.bdd package

Module contents

Submodules

testplan.testing.bdd.bdd_tools module

class testplan.testing.bdd.bdd_tools.BDDTestSuiteFactory(features_path, resolver=<testplan.testing.bdd.bdd_tools.NoopContextResolver object>, default_parser=<class 'testplan.testing.bdd.parsers.RegExParser'>, feature_linked_steps=False, common_step_dirs=None)[source]

Bases: object

Factory class which can create TestSuits from a directory of feature files

Parameters:
  • features_path – is the path to the directory containing the feature and step definition
  • resolver – context resolver can be used to refer context values from steps
  • default_parser – the default parser used in step matching default use regex
  • feature_linked_steps – assumes per feature step definition files
  • common_step_dirs – list of paths to common step files
create_suites()[source]

This is the factory function when can be used tyo obtain Multitest compatible TestSuites

Returns:a list of suites inherited from GherkinTestSuiteBase.
class testplan.testing.bdd.bdd_tools.ContextResolver(start_tag='{{', end_tag='}}')[source]

Bases: object

regexp
resolve(context, text)[source]
class testplan.testing.bdd.bdd_tools.NoopContextResolver[source]

Bases: object

resolve(context, resolvable)[source]
testplan.testing.bdd.bdd_tools.create_linked_registry(feature, default_parser_class)[source]

testplan.testing.bdd.parsers module

class testplan.testing.bdd.parsers.Parser[source]

Bases: object

bind(func, mathc)[source]
match(sentence)[source]
class testplan.testing.bdd.parsers.RegExParser(expression)[source]

Bases: testplan.testing.bdd.parsers.Parser

Parser implementation, matching regex on step sentences

bind(func, match)[source]
match(sentence)[source]
class testplan.testing.bdd.parsers.SimpleParser(format_string)[source]

Bases: testplan.testing.bdd.parsers.Parser

Parser implementation, using parse library to simplify match strings

bind(func, match)[source]
match(sentence)[source]

testplan.testing.bdd.step_registry module

testplan.testing.bdd.step_registry.And(sentence_or_parser)

Step Decorator

Parameters:sentence – The regexp it matches
Returns:
testplan.testing.bdd.step_registry.But(sentence_or_parser)

Step Decorator

Parameters:sentence – The regexp it matches
Returns:
testplan.testing.bdd.step_registry.Given(sentence_or_parser)

Step Decorator

Parameters:sentence – The regexp it matches
Returns:
class testplan.testing.bdd.step_registry.StepRegistry[source]

Bases: object

actual_parser
count = 0
get(sentence)[source]
classmethod get_load_steps_path_stack() → Deque[str][source]
classmethod get_target_registry() → testplan.testing.bdd.step_registry.StepRegistry[source]
classmethod import_step_base() → str[source]
load_steps(definition_file, step_parser_class)[source]
local = <_thread._local object>
register(sentence_or_parser, func)[source]
testplan.testing.bdd.step_registry.Then(sentence_or_parser)

Step Decorator

Parameters:sentence – The regexp it matches
Returns:
testplan.testing.bdd.step_registry.When(sentence_or_parser)

Step Decorator

Parameters:sentence – The regexp it matches
Returns:
testplan.testing.bdd.step_registry.import_step_base(path)[source]
testplan.testing.bdd.step_registry.import_steps(relative_path)[source]
testplan.testing.bdd.step_registry.set_actual_parser(parser)[source]
testplan.testing.bdd.step_registry.step(sentence_or_parser)[source]

Step Decorator

Parameters:sentence – The regexp it matches
Returns: