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

[Support Required]: To implement custom display name generator using serenity and Junit 5 #2934

Open
bachhavdipak opened this issue Sep 25, 2022 · 5 comments

Comments

@bachhavdipak
Copy link
Contributor

bachhavdipak commented Sep 25, 2022

I am able to implement custom display names using serenity and JUnit 5. Output is also produced properly. I am currently stuck because there are two output JSON files created under target/site/serenity folder for the single test scenario and hence it's causing problems in the report. Can someone please help me to resolve this issue?

image

image

Kindly find the repo path for more details:
https://github.com/bachhavdipak/customDisplayName

JSON with the 3 tests step is expected and correct one :

{
  "name": "search by single keyword",
  "id": "starter.wikipedia.WhenSearchingForTerms:search by single keyword",
  "testCaseName": "starter.wikipedia.WhenSearchingForTerms",
  "testSteps": [
    {
      "number": 1,
      "description": "Navigate to the home page",
      "duration": 10347,
      "startTime": "2022-09-23T19:24:41.758+01:00[Europe/London]",
      "result": "SUCCESS",
      "precondition": false,
      "level": 0
    },
    {
      "number": 2,
      "description": "Search by keyword 'Everest'",
      "duration": 2333,
      "startTime": "2022-09-23T19:24:52.121+01:00[Europe/London]",
      "result": "SUCCESS",
      "precondition": false,
      "level": 0
    },
    {
      "number": 3,
      "description": "The first heading should be 'Mount Everest'",
      "duration": 601,
      "startTime": "2022-09-23T19:24:54.454+01:00[Europe/London]",
      "result": "SUCCESS",
      "precondition": false,
      "level": 0
    }
  ],
  "userStory": {
    "id": "starter.wikipedia.WhenSearchingForTerms",
    "storyName": "When searching for terms",
    "displayName": "When searching for terms",
    "storyClassName": "starter.wikipedia.WhenSearchingForTerms",
    "path": "wikipedia",
    "type": "story"
  },
  "featureTag": {
    "name": "Wikipedia/When searching for terms",
    "type": "story",
    "displayName": "Wikipedia/When searching for terms"
  },
  "title": "search by single keyword",
  "tags": [
    {
      "name": "Wikipedia/When searching for terms",
      "type": "story",
      "displayName": "Wikipedia/When searching for terms"
    }
  ],
  "startTime": "2022-09-23T19:24:41.617+01:00[Europe/London]",
  "duration": 13470,
  "projectKey": "",
  "isManualTestingUpToDate": false,
  "manual": false,
  "testSource": "JUnit",
  "order": 0,
  "result": "SUCCESS",
  "durationInSeconds": 13.47
}
@bachhavdipak
Copy link
Contributor Author

bachhavdipak commented Sep 26, 2022

Still facing the same issue

@bachhavdipak
Copy link
Contributor Author

bachhavdipak commented Sep 26, 2022

After investigation found that net.serenity-bdd:serenity-junit5:${serenityCoreVersion} still using junit 4.
I have tried to exclude junit package through it testImplementation ("net.serenity-bdd:serenity-junit5:${serenityCoreVersion}") { exclude group: 'junit', module: 'junit' } but again it's throwing Caused by: org.junit.platform.commons.JUnitException: TestEngine with ID 'junit-vintage' failed to discover tests error

@bachhavdipak
Copy link
Contributor Author

bachhavdipak commented Sep 26, 2022

I have checked serenity-junit5 module and found that still it's using the JUnit 4 dependency don't know why? also, its proves serenity still not fully supporting JUnit 5.
image

@wakaleo
Copy link
Member

wakaleo commented Dec 17, 2022

Serenity uses Maven not Gradle.

@bachhavdipak
Copy link
Contributor Author

bachhavdipak commented Dec 17, 2022

Does not matter. Currently serenity not supporting custom display names in junit5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants