Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am unable to add custom fields to Serenity Reports (using the latest version) #1454

Closed
EshaDoda opened this issue Nov 15, 2018 · 7 comments

Comments

@EshaDoda
Copy link

Hi,

I am trying to add Custom Fields to Serenity report mentioned in this link: https://serenity-bdd.github.io/theserenitybook/latest/extended-reports.html

serenity version: 2.0.17.

Tried by adding ApplicationVersion information in serenity properties file in this format
"report.customfields.ApplicationVersion = 1.2.3"

Also, tried using below command, but in vain
mvn serenity:aggregate -DHOST=$HOST -Dreport.customfields.ApplicationVersion=1.2.4

Please find below the details:

org.springframework.boot
spring-boot-starter-parent
2.0.5.RELEASE

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <serenity.version>2.0.17</serenity.version>
    <selenium.version>3.12.0</selenium.version>
    <serenity.testlink.integration.version>3.4.0</serenity.testlink.integration.version>
</properties>

    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-cucumber</artifactId>
        <version>1.9.20</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-rest-assured</artifactId>
        <version>2.0.17</version>
    </dependency>
    <dependency>
        <groupId>net.serenity-bdd</groupId>
        <artifactId>serenity-spring</artifactId>
        <version>2.0.17</version>
        <scope>test</scope>

Let me know if any other information is required.

@mmwinther
Copy link

@EshaDoda did you find a resolution to this? I haven't been able to get it working on the HTML reports using Serenity version 2.0.40 and serenity-gradle-plugin 2.0.40

@wakaleo I could only find use of CustomReportFields in the EmailReporter class. Are these custom fields not implemented for the HTML reports?

@mmwinther
Copy link

Update: this works for the "emailable" report, and seems like it's only been implemented for that. This feature would be very useful for the aggregate report as well.

@ssmuthukumaran
Copy link

This feature will be very helpful, if we have it in HTML reports too.

@rrodriguez2019
Copy link

My company is using these generated HTML aggregate reports to display automation results across the organization, but the lack of any custom fields in these reports adds a lot of confusion since there is no context to which branch/build/test suite a report is correlated with. If we had these fields it would make Serenity much more useful for our needs.

We've invested a considerable amount of effort into adopting this framework and it would be nice if this feature were seriously contemplated for near-future updates.

@wakaleo
Copy link
Member

wakaleo commented May 27, 2019

Would you be able to take a look and provide a PR? Or, if your company finds value in this feature and in Serenity in general, have you considered raising a support ticket or getting commercial support?

@wilmargutierrez
Copy link

Hello there,

any news on this ticket? I'm facing a similar problem and I'm not sure if I should raise a new ticket. My problem is:

  1. My custom fields (and any changes or additions) show up in Serenity Summary Report ONLY after deleting the entire IntelliJ cache.
  2. After doing so, the custom fields show up with the placeholders instead of the real values.

As you can see on the screenshot, some custom fields are taken directly from the serenity.conf; some others come from the system properties (which are initialized by for instance, gradle tasks.)

I also tried passing them as command line arguments. Still no change on the report.

if I change, say, the field version in my serenity.conf, that change won't be reflected in the report unless I delete the IntelliJ cache.

Currently using:
Serenity version 2.0.84 for all dependencies
Gradle version 5.4.1

image

image

Any help will be highly appreciated and happy to add additional information.

Thank you very much.

@wilmargutierrez
Copy link

wilmargutierrez commented Apr 27, 2021

This has been working stable for me, but a lot has changed since I posted my question (see above):

  • I'm currently using Serenity version 2.3.13
  • I switched from serenity.conf back to serenity.properties, which I had to do to fix a different problem.
  • The custom fields values will be added to the report as long as their values are passed in the command line (my initial expectation was that Serenity would take the default values of each custom field that I have entered in the serenity.properties file, but I guess I was wrong). Otherwise the will appear as seen on my screenshot (see above).
  • It works for both reports: full version & summary (one-page) version.

To me this is a closed topic. Thanks a lot and keep up the great work!

@wakaleo wakaleo closed this as completed Feb 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants