|
20 | 20 |
|
21 | 21 | from test.tck import tck_util |
22 | 22 |
|
| 23 | +failing_features = {} |
| 24 | + |
23 | 25 |
|
24 | 26 | def before_all(context): |
25 | 27 | context.config.setup_logging() |
26 | 28 |
|
27 | 29 |
|
28 | 30 | def before_feature(context, feature): |
29 | 31 | # Workaround. Behave has a different way of tagging than cucumber |
30 | | - if "reset_database" in feature.tags: |
31 | | - for scenario in feature.scenarios: |
32 | | - scenario.tags.append("reset_database") |
| 32 | + for scenario in feature.scenarios: |
| 33 | + scenario.tags += feature.tags |
33 | 34 |
|
34 | 35 |
|
35 | 36 | def before_scenario(context, scenario): |
36 | 37 | if "reset_database" in scenario.tags: |
37 | 38 | tck_util.send_string("MATCH (n) DETACH DELETE n") |
| 39 | + if "equality_test" in scenario.tags: |
| 40 | + context.values = {} |
| 41 | + |
| 42 | + |
| 43 | +def after_feature(context, feature): |
| 44 | + failed_scenarios = [] |
| 45 | + for scenario in feature.scenarios: |
| 46 | + if scenario.status != "passed": |
| 47 | + failed_scenarios.append(scenario.name) |
| 48 | + if len(failed_scenarios) > 0: |
| 49 | + failing_features[feature.name] = failed_scenarios |
| 50 | + |
| 51 | + |
| 52 | +def after_all(context): |
| 53 | + if len(failing_features) != 0: |
| 54 | + print("Following Features failed in TCK:") |
| 55 | + for feature, list_of_scenarios in failing_features.items(): |
| 56 | + print("Feature: %s" %feature) |
| 57 | + for scenario in list_of_scenarios: |
| 58 | + print("Failing scenario: %s" % scenario) |
| 59 | + raise Exception("TCK FAILED!") |
| 60 | + |
0 commit comments