Description
Report from a user:
Our test suite is using Markdown specifications. For logging purposes, our tests are using the special variable #TEXT
to obtain the text of each row of a Concordion table. Prior to Concordion 3.0.0, individual cells in the row were delineated by \n
. With the updated Markdown parser in Concordion 3.0.0 this is no longer the case and the cells are only delineated by whitespace. This affects our ability to parse the contents of the row. What workarounds can we use to restore this behaviour so our logging works correctly?
See attached test case for an example. This can be applied to the cubano-demo project. With the latest cubano-concordion:1.0.2
package, the test fails with IndexOutOfBoundsException. Change back to the Concordion 2.2.0
version using the build.gradle
configuration below, and everything works fine.
TestMarkdownUpdates.java
package example.markdownparser;
import org.concordion.api.MultiValueResult;
import org.concordion.cubano.template.framework.CubanoDemoBrowserFixture;
import org.concordion.ext.storyboard.CardResult;
import org.concordion.ext.storyboard.StockCardImage;
public class TestMarkdownUpdates extends CubanoDemoBrowserFixture {
public MultiValueResult parse(String data) throws Exception {
System.out.println("-----------------");
System.out.println(data);
System.out.println("=-----------------=");
System.out.println(data.split("\\n")[2].trim());
System.out.println(data.split("\\n")[3].trim());
System.out.println(data.split("\\n")[4].trim());
MultiValueResult mvr = new MultiValueResult();
mvr.put("id", 1);
mvr.put("result", "Passed");
getStoryboard().addSectionContainer(String.format("'%s' is '%s'", data.split("\\n")[2].trim(), data.split("\\n")[3].trim()));
getStoryboard().addNotification("Hello", "Hello", StockCardImage.JSON, CardResult.SUCCESS);
return mvr;
}
}
TestMarkdownUpdates.md
# Heading
## [Test](-)
Test .....
| [note][][An Id][] | Outcome | Comment | [Results][] |
| ------------------------------ | -------------- | ---------------------------------------- | -------- |
| | Scenario1 | True | Passed |
| | Scenario2 | False | Passed |
| | Scenario3 | True | Passed |
| | Scenario4 | False | Passed |
[note]: - "#out = parse(#TEXT)"
[An Id]: - "c:echo=#out.id"
[Results]: - "?=#out.result"