-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
[Serenity 3.2.4][Junit5]: Issue while generating output JSON When display name too long and contains special characters #2803
Comments
What is the issue? |
If you observed the above JSON file then JSON is not generated as per the display name provided in the test. @DisplayName("count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ % ^ & _ . % ^ & ( ) _ + * count can purchase some contact lenses then retrieve the order and perform store credential check") Expected JSON : "name":"count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ % ^ & _ . % ^ & ( ) _ + * count can purchase some contact lenses then retrieve the order and perform store credential check","id":"starter.wikipedia.WhenSearchingForTerms:count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ % ^ & _ . % ^ & ( ) _ + * count can purchase some contact lenses then retrieve the order and perform store credential check ","testCaseName":"starter.wikipedia.WhenSearchingForTerms","testSteps":.... Actual JSON : {"name":"count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ ","id":"starter.wikipedia.WhenSearchingForTerms:count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $...... Also, you can check the screenshot for your reference JSON file name should be as per the display name |
OK, I will take a look. The JSON file name is a normalised form, it is not intended for human consumtion (the uncompressed format is only intended for debugging purposes). |
Hi @wakaleo no I am not talking about the JSON file name. Please check expected results section. Serenity doesn't seem to support display name properly. Also I have observed that JSON generated does not contain display name which is major change in junit5. |
Also observed junit 4.xx is also part of the serenity-junit5 |
Any update on this why serenity junit 5 still referring junit 4 ? |
There are no direct dependencies on JUnit 4 in the compile-scope dependencies of serenity-junit5. |
But while producing results seems like its not using junit 5. I can see |
I raised this bug last year April 2022 but looks like its not resolved . I can still see this with serenityCoreVersion = 3.6.21 |
Here is an example of a Serenity BDD test that uses the DisplayNameGenerator: @ExtendWith(SerenityJUnit5Extension.class)
@DisplayNameGeneration(DisplayNameGenerator.ReplaceUnderscores.class)
public class JUnit5GeneratedExample {
@Test
void sample_test() {
}
@Nested
class Nested_Test_Cases {
@Test
void sample_nested_test() {
}
}
} |
There is no SLA on open source defects. If a bug or feature has value for your organisation, you can (a) wait for a volunteer to spend their personal time to implement it, (b) implement it yourself (or pay someone to implement it) and raise a pull request, or (c) purchase a commercial support package in order to see it implemented more quickly. If you would like to know about the third option, let me know and I can send you some details. |
Ahh i thought its based on open defects raised in the repo. |
I am facing an issue while generating output JSON under target/site/serenity with special char and also observed there is a character limit while passing data through @DisplayName.
Generated jsn file under target/site/serenity/
Output Json:
{"name":"count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ ","id":"starter.wikipedia.WhenSearchingForTerms:count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ ","testCaseName":"starter.wikipedia.WhenSearchingForTerms","testSteps":[{"number":1,"description":"Navigate to the home page","duration":13042,"startTime":"2022-04-28T21:26:08.661+01:00[Europe/London]","screenshots":[{"screenshot":"d766ead5fa01902c43be6987673597ff3933826d50b64c72d7bbd153ebd0b126.png","timeStamp":1651177581702,"screenshotName":"d766ead5fa01902c43be6987673597ff3933826d50b64c72d7bbd153ebd0b126.png"}],"result":"SUCCESS","precondition":false,"level":0},{"number":2,"description":"Search by keyword \u0027Everest\u0027","duration":3691,"startTime":"2022-04-28T21:26:21.712+01:00[Europe/London]","screenshots":[{"screenshot":"21c27021c7e1fbdb3dad65225523477df21af28f8b92b19bf45630dfb981cd21.png","timeStamp":1651177585403,"screenshotName":"21c27021c7e1fbdb3dad65225523477df21af28f8b92b19bf45630dfb981cd21.png"}],"result":"SUCCESS","precondition":false,"level":0},{"number":3,"description":"The first heading should be \u0027Mount Everest\u0027","duration":1628,"startTime":"2022-04-28T21:26:25.403+01:00[Europe/London]","screenshots":[{"screenshot":"21c27021c7e1fbdb3dad65225523477df21af28f8b92b19bf45630dfb981cd21.png","timeStamp":1651177585997,"screenshotName":"21c27021c7e1fbdb3dad65225523477df21af28f8b92b19bf45630dfb981cd21.png"}],"result":"SUCCESS","precondition":false,"level":0}],"userStory":{"id":"starter.wikipedia.WhenSearchingForTerms","storyName":"When searching for terms","displayName":"JUnit 5 Nested Example","storyClassName":"starter.wikipedia.WhenSearchingForTerms","path":"wikipedia","type":"story"},"featureTag":{"name":"Wikipedia/When searching for terms","type":"story","displayName":"Wikipedia/When searching for terms"},"title":"count can purchase some contact lenses then retrieve the order and perform store credential check ! $ $ [ ^ \u0026 _ . ]","tags":[{"name":"Wikipedia/When searching for terms","type":"story","displayName":"JUnit 5 Nested Example"},{"name":"Wikipedia","type":"feature","displayName":"Wikipedia"}],"startTime":"2022-04-28T21:26:07.484+01:00[Europe/London]","duration":19580,"projectKey":"","sessionId":"6ad0ed5814a5f65ad7d6fc10a2b68f6f","driver":"chrome","isManualTestingUpToDate":false,"qualifier":" ^ \u0026 _ . ","manual":false,"testSource":"JUnit5","result":"SUCCESS"}
The text was updated successfully, but these errors were encountered: