Allure reporting: if suite name contains dot, suite name in reporting is truncated - suite

If suite name contains dot, suite name in reporting is truncated.
The XML seems to have proper name as below
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:test-suite xmlns:ns2="urn:model.allure.qatools.yandex.ru" start="1424101948829" stop="1424102027462" version="1.4.4">
<name>SampleSuite.xml</name>
<test-cases>
<test-case start="1424101949080" stop="1424101952336" status="passed">
....
...
But html report(generated using allure.bat generate allure-results -v 1.4.0) is truncated as below:

Looks like not a bug. There happens extracting simple class name out of fully qualified one. Usually suite names look like "my.company.SimpleTest". In that case current behavior is more preferred.

Related

How to get over this SXXP0003 parser error?

I have an XML document which prolog looks like this :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
...
This XML document is valid against the external DTD with the exact same prolog :
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE root [
...
]>
When I transform using Saxon (latest release):
$:/opt/tomcat/webapps/ROOT/$ java net.sf.saxon.Transform -s:pandora.xml -xsl:pandora.xsl -o:pandora.html
Error on line 1 column 53 of pandora.dtd:
SXXP0003 Error reported by XML parser: No more pseudo attributes are allowed.: No more
pseudo attributes are allowed.
org.xml.sax.SAXParseException; systemId: file:/opt/tomcat/webapps/ROOT/fred/pandora/dtd/pandora.dtd; lineNumber: 1; columnNumber: 53; No more pseudo attributes are allowed.
I am newbie and my research about this has only led to listing the pseudo-attributes in the order they actually are. If anybody have a clue there.
Edit
I have made other transformations using the same process with other projects without any problem. The only difference is in this problematic application, I make use of another namespace exsl to use a function not provided with version 1.0 (node-set). Everything else is similar.
For an external subset of the DTD the specification defines the format in https://www.w3.org/TR/xml/#NT-extSubset as
extSubset ::= TextDecl? extSubsetDecl
extSubsetDecl ::= ( markupdecl | conditionalSect | DeclSep)*
, for the "Text Declaration" in https://www.w3.org/TR/xml/#sec-TextDecl as TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>' so a standalone "pseudo" attribute is indeed not allowed there.
So make sure that your external DTD file does not repeat <!DOCTYPE root, it is just meant to contain declaration of markup, e.g. elements, attributes.
The error message you get comes anyway just from the XML parser and is not transformation/XSLT related.

SAXParseException when using restassured

I am trying to verify a XML response with rest-assured like this:
.then().body("some.xml.path", is("abc"));
However, what I get is a SAXParseException:
DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.]
Response starts like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cXML.org/schemas/cXML/1.2.021/cXML.dtd">
<cXML ...
Why am I getting this exception? What should I change?
I am using version 3.2.0 of rest-assured.
A similar question has been answered here. In short, the answer describes to use disableLoadingOfExternalDtd() to have RestAssured ignore the Document Type Definition in your XML.
Normally, the DTD would describe (using the external definition) the structural layout of the element defined as cXML.

Customize XML report files in Spock

I am new to Spock and need to figure out if I can customize the XML test report file generated by Spock. As far as I could figure out so far, I can enable generating JSON report file in which I would have access to all tests' start and end time.
I have integrated Spock with Jenkins and I am able to see the generated test reports after each build. I am wondering if there is a way by which I can customize this report to include start and end time?
Is there any way by which I can
include my own defined parameters into the test results
have Jenkins to show also my defined parameters in the report
Here is an example of what I want to have
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="SpecName" tests="12" skipped="0" failures="2" errors="0" timestamp="2018-16-15T09:12:59" hostname="DESKTOP-VANP1TU" time="0.864">
<properties/>
<testcase name="FeatureName" classname="SpecName" time="0.116" startTime="2018-16-15T09:12:59" endTime="2018-16-15T09:12:59"/>
.
.
.
</testsuite>
As you can see I have added two fields (StartTime and endTime) to the report.
the spock reports extension lets you define templates for your reports: https://github.com/renatoathaydes/spock-reports
with that at hand, you should also be able to define an XML template...

How to read xml attribute value on apache ant?

I have an xml like below.
<Students college="SGS">
<Student id="001" name="ABC"/>
<Student id="002" name="XYZ"/>
<Students/>
<Students college="SPM">
<Student id="001" name="PQR"/>
<Student id="002" name="LMN"/>
<Students/>
and I want name of the student of the SGS college whose id is 001 using apache ant.
So how can I get this without using extra jar like xmltask.jar etc
The simplest solution is to use XPath to get this information. In Ant there is no built-in task to fetch XML data using XPath expressions. You would need to use tasks provided in external libraries:
https://code.google.com/p/ant-xpath-task/wiki/Introduction
http://ant.apache.org/external.html

PartCover browser not opening code files

We're generating PartCover reports via the command line tool along with our CruiseControl.Net unit tests. This generates an xml file that displays the results nicely on the cruisecontrol dashboard. The xslt transforms that are included only show you the percentage of coverage in an individual class. We want to know exactly what lines are not being covered. The problem ist when we open the report in the PartCover browser and double click a method it doesn't show us our cs files. I know the PartCover browser is capable of showing you the files because of the following.
Here's a screenshot of PartCover browser with the lines of code showing: http://kjkpub.s3.amazonaws.com/blog/img/partcover-browse.png.
The information looks like it should be available to the browser because the report contains this:
<Method name="get_DeviceType" sig="Cathexis.IDBlue.DeviceType ()" bodysize="19" flags="0" iflags="0">
<pt visit="2" pos="0" len="1" fid="82" sl="35" sc="13" el="35" ec="14" />
<pt visit="2" pos="1" len="4" fid="82" sl="36" sc="17" el="36" ec="39" />
<pt visit="2" pos="5" len="2" fid="82" sl="37" sc="13" el="37" ec="14" />
</Method>
and this:
<File id="66" url="D:\sandbox\idblue\idblue\trunk\software\code\driver\dotnet\Common\AsyncEventQueue.cs" />
All I want to be able to do is view what lines of code are not being covered in my test cases without having to figure out what the xml above is trying to tell me.
Thanks to anyone in advance who replies.
I figured out why the cs files were not displaying. The paths were incorrect in the xml file because our test project was being built on a different machine than the one partcover was on. (partcover must generate the .cs file paths from pdb files maybe?) Once I search and replaced the file switching the base directory of our subversion location to the one on the other machine all was well.

Resources