concordion / concordion-excel-extension

Allows Concordion specifications to be in Excel format rather than HTML
Other
9 stars 12 forks source link

concordion:example #10

Open cobour opened 7 years ago

cobour commented 7 years ago

Hi, since Concordion introduced the "example" command on tables in 2.1.0 I tried to use it with this excel-extension. In my Excel-File I have a column named "Testcase-Nr" which i want to use as the text for the JUnit-View. My Excel-comment on this column looks like this:

concordion:set="#testcaseNr"
concordion:example
(table)concordion:execute="#...[snip]...

The tests run fine, but the rows are not reported as single tests. The excel file is reported as a test as a whole as before. Did I make a mistake? Or is this not supported yet?

Regards Frank

robmoffat commented 7 years ago

I think I know he problem here- when the excel extension converts the commands, it attaches one to each HTML element (a limit imposed by concordion, and also because HTML only allows one atttribute with a given name).

When the (table) prefix is given, it attaches that command to the enclosing table tag, but the other two commands would get attached to the same element, and it's possible that only the latter one gets retained.

To fix this you could try adding (tr) in front of "concordion:example", but it might be better to just move that command outside of the table completely, as probably you want to have each table being one example? If so, just put it in the cell above the table.

Hope that helps,

Rob

On 18 Apr 2017, at 07:20, cobour notifications@github.com wrote:

Hi, since Concordion introduced the "example" command on tables in 2.1.0 I tried to use it with this excel-extension. In my Excel-File I have a column named "Testcase-Nr" which i want to use as the text for the JUnit-View. My Excel-comment on this column looks like this:

concordion:set="#testcaseNr" concordion:example (table)concordion:execute="#...[snip]... The tests run fine, but the rows are not reported as single tests. The excel file is reported as a test as a whole as before. Did I make a mistake? Or is this not supported yet?

Regards Frank

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

cobour commented 7 years ago

Thanks for the quick reply. I want to achieve that each row of the excel table is shown as a single testcase in the JUnit view (of eclipse). I thought this could be achieved by using "concordion: example" in the table header according to the docs here: http://concordion.org/instrumenting/java/markdown/#run-each-row-as-an-example

robmoffat commented 7 years ago

Did you try putting (tr) immediately in front of concordion:example?

On 18 Apr 2017, at 11:54, cobour notifications@github.com wrote:

Thanks for the quick reply. I want to achieve that each row of the excel table is shown as a single testcase in the JUnit view (of eclipse). I thought this could be achieved by using "concordion: example" in the table header according to the docs here: http://concordion.org/instrumenting/java/markdown/#run-each-row-as-an-example

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

cobour commented 7 years ago

Hi, sorry, I didn't write that. Yes, I tried, it did not help. Regards Frank

robmoffat commented 7 years ago

I think Steven Goris found a solution to this problem: https://github.com/concordion/concordion-excel-extension/issues/11

GoGoris commented 7 years ago

(div)concordion:example="test1" works for running the table as an example. I didn't test putting it on a row, however according to the spec it should be on the th-tag instead of the row. I would try putting (th) in front of the concordion:example tag on the column header.

If it does not work, I would check the html of the report using F12 in chrome.

cobour commented 7 years ago

I tried putting (th)(div)concordion:example (even without the (div)), but no difference. Thanks anyway for the hint.

vgheo commented 4 years ago

Not sure if this is still a problem, though I have a suggestion as to how to determine the correct instrumentation for placing attributes on parent tags.

You can look at the html generated from the excel ( the input html, not the report one) by adding this to the fixture

@ConcordionOptions(copySourceHtmlToDir="target")

Starting with 2.1.3, this html also includes traceability attributes to the original location in excel.