Open techcobweb opened 1 month ago
Just run this locally (while sat in hospital) and was able to get it to work. My feature file looks like this
Feature: GherkinLog
Scenario: Log Example Statement
THEN Write to log "This is a log statement <Item>"
Scenario: Log Statement Test
THEN Write to log "This is a second scenario <Value>"
Examples:
| Item | Value |
| password | data |
| password2 | data2 |
examining the difference between the reported feature file
So the main issue here is that the user is using Scenario Outline:
and not Scenario:
. We don't support that currently. Although we can update the code that will be in the next release - changing scenario as outlined above should be an acceptable workaround
Pull request here: https://github.com/galasa-dev/framework/pull/544
Scenario Outline:
Scenario:
should not contain an Examples:
section and vice versaThis story is turning out to be harder to implement than expected.
@hobbit1983 I tried the feature text you added above.
I got this in the trace:
----------------------- ****************************************************************************************************
----------------------- *** Start of test method GherkinLog#Log Example Statement
----------------------- ****************************************************************************************************
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.798 INFO d.g.f.s.l.g.GherkinMethod - Executing Statement: THEN Write to log "This is a log statement <Item>"
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.798 INFO d.g.c.m.i.g.CoreStatementOwner - This is a log statement password
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.804 INFO d.g.f.s.l.g.GherkinMethod - Ending
----------------------- ****************************************************************************************************
----------------------- *** Passed - Test method GherkinLog#Log Example Statement
----------------------- ****************************************************************************************************
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.805 INFO d.g.f.s.l.g.GherkinMethod - Starting
----------------------- ****************************************************************************************************
----------------------- *** Start of test method GherkinLog#Log Statement Test
----------------------- ****************************************************************************************************
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.805 INFO d.g.f.s.l.g.GherkinMethod - Executing Statement: THEN Write to log "This is a second scenario <Value>"
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.805 INFO d.g.c.m.i.g.CoreStatementOwner - This is a second scenario data
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.805 INFO d.g.f.s.l.g.GherkinMethod - Ending
----------------------- ****************************************************************************************************
----------------------- *** Passed - Test method GherkinLog#Log Statement Test
----------------------- ****************************************************************************************************
2024/05/28 17:24:42 JVM output: (runid:L1) : 28/05/2024 17:24:42.805 INFO d.g.f.s.l.g.GherkinTest - Ending
----------------------- ****************************************************************************************************
----------------------- *** Passed - Test class GherkinLog
----------------------- ****************************************************************************************************
i.e: The <Item>
and <Value>
parts of the feature are kind of being substituted, but there are several problems with this:
I think this is the syntax we need to support (in BNF):
1a. <feature> := FEATURE_START <scenarioPartList> END_OF_FILE
2b. <scenarioPartList> := null
2c. | <ScenarioPart> <scenarioPartList>
3a. <scenarioPart> := <scenarioOutline>
3b. | <scenario>
4a. <scenario> := SCENARIO_START <stepList>
5a. <scenarioOutline> := SCENARIO_OUTLINE_START <stepList> EXAMPLES_START <dataTable>
6a. <stepList> := null
6b. | STEP <stepList>
7a. <dataTable> := <dataHeaderLine> <dataValuesLineList>
8a. <dataHeaderLine> := DATA_LINE
9a. <dataValuesLineList> := DATA_LINE
9b. | DATA_LINE <dataValuesLineList>
Bug
When I run the following scerario I get a null pointer exception.
Run log looks like this: