SpecFlow :modify the report name generated using SpecFlow - specflow

Usually the SpecFlow report is generated using the projectName and name defined in your profile plus a time stamp: projectName_name_YYYY-MM-DDTHHMMSS
Is there any way I can modify this and give my custom report name?

add outputName="SpecRunReport.html" into settings tag within the default.srprofile file in your project.
you can also use custom output templates by using the code below instead
<Settings projectName="DemoSpecflow" projectId="{Project ID}"/>
<Report>
<Template name="CustomReportTemplate.cshtml"outputName="SpecRunReport.html"/>
</Report>

Related

Jmeter 3.0 can't generate the ANT HTML report

I am on the verge of pulling all my hair out, someone please help me..
I am using JMeter 3.0 and am trying to generate the dashboard report from my jtl files, but I get the error -
result.jtl' does not contain the field names header, ensure the jmeter.save.saveservice.* properties are the same as when the CSV file was created or the file may be read incorrectly
my user.properites file contains -
jmeter.save.saveservice.output_format=csv
jmeter.save.saveservice.bytes=true
jmeter.save.saveservice.label=true
jmeter.save.saveservice.latency=true
jmeter.save.saveservice.response_code=true
jmeter.save.saveservice.response_message=true
jmeter.save.saveservice.successful=true
jmeter.save.saveservice.thread_counts=true
jmeter.save.saveservice.thread_name=true
jmeter.save.saveservice.time=true
jmeter.save.saveservice.timestamp_format=ms
jmeter.save.saveservice.timestamp_format=yyyy-MM-dd HH:mm:ss
jmeter.save.saveservice.print_field_names=true
these values are the same in the jmeter.properties file as well, just to ensure I haven't lost anything...
I really can't work out why I can't get the jtl to include the headers, I have followed every guide I can find, and I seem to be doing it right..
Can someone point to me what I am missing, or include a zipped version of their jmeter with it all working that I can try and point my ant project to?
Hope someone can help.
Double check <jmeter> section of your build.xml file. Default JMeter Ant Task assumes XML out put format for .jtl result files so if you have the following line:
<property name="jmeter.save.saveservice.output_format" value="xml"/>
just comment it out or delete it and your issue should be resolved.
I don't think JMeter Ant Task respects overrides via user.properties file, it is better to use jmeterproperties attribute or explicitly specify the relevant configuration in the Ant build file like:
<target name="test">
<jmeter
jmeterhome="${jmeter.home}"
testplan ="${testpath}/${test}.jmx"
resultlog="${testpath}/${test}.jtl">
<property name="jmeter.save.saveservice.output_format" value="csv"/>
<property name="jmeter.save.saveservice.print_field_names" value="true"/>
<property name="jmeter.save.saveservice.timestamp_format" value="ms"/>
<!--etc.-->
</jmeter>
</target>
I would also recommend choosing one of jmeter.save.saveservice.timestamp_format properties (either ms or yyyy-MM-dd HH:mm:ss as it might cause problems with the dashboard generation), having duplicate property names with different values is not a very good practice.
See Five Ways To Launch a JMeter Test without Using the JMeter GUI article for more information on running JMeter tests via Ant task and other ways of kicking off a JMeter test
I had noticed before you posted, but it is correct, the XML type was hardcoded in the build.xml, now I have changed that, all is working :)

Grails default package name

I am new to Grails and I like it very much. I want to place my classes in packages like org.company.project.module.model. Its quite painful for to me to repeat create-domain-class <package>.<class_name>. Is there something like "package templates" or can I somehow "enter" (like grails cd org.comopany...) and then just write Class names (grails Person will be generated in ./ location)? Is that possible or should I use copy paste design pattern?
Thanks in advance for any help.
If I understood your question, you are looking for default package name for your domain classes. In your config.groovy file there is a line saying:
grails.project.groupId = appName
if you give it an appName, Grails will use that as the default package name when it generates the artifacts.
grails.project.groupId = 'com.example.yourpackagename'
If you now create a domain class by default it will locate it under com/example/yourpackagename.
UPDATE
It is not required to use Grails commands like create-domain-class or other commands to create artifacts. These are all just classes that you can manually create. Just create a file and duplicate it in the same package.
UPDATE
Grails interactive mode (when you type grails) for some of the commands by pressing tab it will type ahead the unique portion of the package name.
UPDATE for Grails 3.0
The setting has moved into conf/application.yml:
grails:
profile: web
codegen:
defaultPackage: com.example.yourpackagename

How can an ANT build file insert the version number in the generated Javadocs?

I use an ANT build file to build my project and also generate the JavaDocs with it. Therefore I use the "javadoc"-command from ANT. Until now I have the version number inserted directly in the .java-file with the "#version"-literal. So if I want to increase the version number I have to open every .java-file and change the number.
Is it possible to define the version number once in the ANT file and let ANT insert this version number into the JavaDocs itself? How can you do this?
Looking at the available options of the JavaDoc task I would use the Header atribute/element which allows to include HTML text defined in every generated file. The HTML text is defined in the the ANT task similar to the doctitle attribute:
<javadoc ...>
<header><![CDATA[<p>Version: ${myversion}</p>]]></header>
</javadoc>
http://ant.apache.org/manual/Tasks/javadoc.html

SONAR - How to exclude packages that is defined under "sonar.test"

I have a projects in JAVA that I analyze using sonar. Some of the java packages that I have are all under source folder. I also have some test file that I have under a different folders. Now, in Sonar, I organize my projects under a different structure, i.e. for a project "search", I only wants to include "search" package. These exclusion is quite easy to accomplished using sonar.exclusion properties. My question, though, is how about the test? how can I exclude some of the packages? Because from my testing, even though my source and test folder are using the same structure, the test packages are not automatically excluded when I specified "sonar.exclusions".
my folder structure:
/src/com/domain/
-- search/
-- utils/
-- pooling/
-- category/
/test/src/com/domain/
-- utils/
-- pooling/
Sonar properties:
<property name="sonar.sources" value="${path}/src" />
<property name="sonar.tests" value="${path}/test/src" />
<property name="sonar.exclusions" value="com/domain/utils/**/*,com/domain/pooling/**/*,com/domain/category/**/*" />
So, I am trying to only include the "search" package. The code above works in a way that it causes SONAR to only analyze my "search" package. This package can be seen in the SONAR "Components" tab. Unfortunately, in addition to the "search" component, I can also see the "util" and "pooling" components. I have done some testing and certain that these two components (utils and pooling) are the result of "sonar.tests" properties. Just a note though, even though "util" and "pooling" shows up in components, SONAR shows zero files under both of them. So going back to my question, is there anyway that I can do to exclude "util" and "pooling" from showing up under "Components"? Maybe using properties (i.e. sonar test exclusions)?
Btw, I am using SONAR 2.11 and is running under Red Hat linux. I'm using SONAR-TASK 1.2.
Any help is welcomed and appreciated! Thanks!
You can define exclusions in the Configurations for the project directly in sonar.
From the documentation:
Since version 3.3, it is also possible to:
Exclude tests file from being analyzed:
go to Configuration > Settings > Exclusions and set > the sonar.test.exclusions property
The trick is:
sonar.exclusions: excludes files from sources directory (i.e.sonar.sources), it has no effect on tests directory.
sonar.test.exclusions: excludes files from tests directory (i.e.sonar.tests), it has no effect on sources directory.
See https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus
And, Using sonar.test.exclusions with Sonarqube 6.3

ExcludeAttributes not working in NCover 1.5.8

I created a custom attribute called "CoverageExcludeAttribute", and placed it above the classes which I want to exclude from my code coverage analysis. But the exclusions doesn't work. The coverage report shows coverage for the Test dll along with all the referenced assemblies (which includes classes containing the exclusion attribute)
<UsingTask TaskName="NCoverExplorer.MSBuildTasks.NCover" AssemblyFile="$(Libraries)\NCoverExplorer.MSBuildTasks.dll"/>
<Target Name="NcoverCoverage">
<NCover ToolPath="C:\Program Files\TestDriven.NET 3\NCover\1.5.8"
CommandLineExe="D:\Xunit\xunit.console.exe"
CommandLineArgs="MyTestDll"
WorkingDirectory="MyWorkingDirectory"
excludeAttributes="CoverageExcludeAttribute"
LogFile="coverage.log"
/>
</Target>
Am I missing something?
Thanks.
Make sure that your attribute is defined in a global namespace or provide a full type name in excludeAttributes.
If you are using .NET Framework 4.0 you can use existing attribute
ExcludeFromCodeCoverageAttribute
From namespace:
System.Diagnostic.CodeAnalysis
That seems to be working fine for me when using NCover 1.5.8 at least when using NCoverExplorer. This attribute is picked up automatically.

Resources