I generated this xml after running protractor tests.
<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="Spring Webapp Homepage" errors="0" tests="3" failures="0" time="1.508" timestamp="2014-02-14T15:23:27">
<testcase classname="Spring Webapp Homepage" name="should get title" time="1.309"></testcase>
<testcase classname="Spring Webapp Homepage" name="Test Header" time="0.098"></testcase>
<testcase classname="Spring Webapp Homepage" name="Test Simple Button" time="0.101"></testcase>
</testsuite>
</testsuites>
There is an option to output the tests to XML output
onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('jasmine-results/xmloutput', true, true));
}
Is there a way to visualize these reports in the browser that would present them more elegantly than raw XML?
Is there a way to visualize these reports in the browser that would present them more elegantly than raw XML?
Actually there is nosetest-xunit-xslt.
Note xsltproc comes installed by default on Mac OSX Mavericks.
Take a look at how the results look like
Update: I'm using a custom reporter that automates the html conversion
require('./jasmine.single_file_junit_reporter.js');
var junitPath = path.join('junitXMLReport/', '0001');
jasmine.getEnv().addReporter(new jasmine.singleFileJUnitXmlReporter(
junitPath, true, true, './nosetests.xslt')
);
You can use a xUnit html parser to convert your XML files to HTML ones : have a look here http://www.youtube.com/watch?v=hzGG32kz9nc
Then you can integrate you teansformation into your build file
Related
Say I have this xml code and I want to display it on my page:
<?xml version=\"1.0\" encoding=\"UTF-8\" ?> <rss version=\"2.0\">
<channel>
<title>W3Schools Home Page</title>
<link>https://www.w3schools.com</link>
<description>Free web building tutorials</description>
<item>
<title>RSS
Tutorial</title>
<link>https://www.w3schools.com/xml/xml_rss.asp</link>
<description>New RSS tutorial on W3Schools</description> </item> </channel> </rss>
I tried doing this, but the output is not what I want:
<div dangerouslySetInnerHTML={{ __html: this.state.body }} />
The output is like this:
https://www.w3schools.com Free web building tutorials https://www.w3schools.com/xml/xml_rss.asp New RSS tutorial on W3Schools
Which is not what I want. I want it to display the rss feed on my page without redirecting me, how can I do that? (Btw, the body is reading perfectly fine, so the problem is not from the body)
If you want to show the XML source code, then just output it as you would any other text:
<div>
{ this.state.body }
</div>
If you want to do sensible formatting, then you'll need to actually parse the XML and extract the data you care about from it. (There are JavaScript RSS parsers out there, you might want to look on NPM for a library you can use to do the heavy lifting for you).
Suppose I want to render javascript from an external file inline into my layout file for performance reasons.
If I use the following Razor code
<script>
#RenderPage("~/Content/my.js")
</script>
results in
Server Error in '/' Application.
The following file could not be
rendered because its extension ".js" might not be supported:
"~/Content/my.js".
If I merely rename my javascript file to my.js.cshtml
<script>
#RenderPage("~/Content/my.js.cshtml")
</script>
The peasants rejoice.
The question:
Is there any simple way for me to prevent RenderPage from nagging such that I can tell it that the .js extension is fine?
With some feedback from #choudeshell one potential solution is:
<compilation debug="true" targetFramework="4.5">
<buildProviders>
<remove extension=".js"/>
<add extension=".js" type="System.Web.WebPages.Razor.RazorBuildProvider,
System.Web.WebPages.Razor"/>
</buildProviders>
</compilation>
What type of side effects would there be from removing whatever the default is for .js, any?
Which directory should I use to place test.html to access it via the browser by using the following url:
http://mysharepointservername.com/test.html ?
If I place the file to C:\inetpub\wwwroot\wss\VirtualDirectories\80 , I get 404 not found error.
Is there another directory I should use to place test.html?
Thank you in advance
You can create a module in sharepoint and place test.html under that module.
And in elements.xml write:
Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="CustomPage" Url="">
<File Url="CustomPage\test.html" Name="test.html" Type="Ghostable" />
</Module>
</Elements>
And deploy this module using feature.
In this way you can access the page with http://mysharepointservername.com/test.html
I need to show a PDF file with data, this data is a XFDF file. So the process works in my machine I open the XFDF and automatically the PDF appears with a data.
The problem is when I make this process in a web environment, the HTML page does not show anything.
I have 2 files: the PDF is TestForm1.pdf and the XFDF is TestForm1.xfdf.
I can embed an empty PDF, and it works:
<object type="application/pdf" data="TestForm1.pdf" width="300" height="200"></object>
But following (with the XFDF) does not work:
<object type="application/vnd.adobe.xfdf" data="TestForm1.xfdf" width="300" height="200"></object>
The code of my XFDF file is:
<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<f href="TestForm1.pdf"/>
<fields>
<field name="Name_UeSd4O*CXTlIKGfP8CI1Lg">
<value>Aaron</value>
</field>
</fields>
<ids original="F76AE09E68036941A6318DF3754A9CD1" modified="4FB18F258D7B8F4699CCCF49538E852F"/>
</xfdf>
Please I need help or guide about this issue.
Regards.
Been a while since you posted. Sorry to revive. Been working on this same issue.
Solve the problem by changing the href path in your XFDF file to the full server path that the pdf is located in. i.e. "http://google.com/my.pdf
I have job that runs an executable which yields a JUnit report.
This report is parsed by Hudson (the 'Publish JUnit test result report' option is checked),
and each testcase is shown as a link.
What I would like to do is to show an HTML page, when a user clicks a link.
For example, this is the JUnit report that Hudson parses
<?xml version="1.0" encoding="utf-8"?>
<testsuite name="Root" package="RunnerRoot" errors="0" failures="3" tests="5" time="20.2">
<testcase classname="Runner" name="Test1" time="3.2283228" />
<testcase classname="Runner" name="Test2" time="2.9512951">
<failure> Error Running the test </failure>
</testcase>
Hudson creates two links called Test1 and Test2, and I want to show
a customized content from an HTML file upon clicking a link.
Thank you
As far as I am aware there is no way to alter the Test Results page, although you might be able to achieve this by writing a plugin. However, there is a plugin that allows you to publish your own html report for a job - https://wiki.jenkins-ci.org/display/JENKINS/HTML+Publisher+Plugin. This will appear as a link in the left panel rather than replace the Test Result page, but it is probably the closest to what you want.