-
Notifications
You must be signed in to change notification settings - Fork 51
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
Implement multiple examples loading and generation in the Interactive Server. #1367
Conversation
- Fixes - bug with exactValue validation in interactive example tests. - Use the fileSource attribute in rows to match example file to scenario - Add tests to ensure canonical path is used for matching. - Update existing test for Feature.createContractTestFromExampleFile.
- Use AtomicInteger for unique example file names. - Include TestResult report in case of test failure with testLogs. - Ability to Load and display multiple existing examples. - Ability to Generate additional examples when necessary. - Update ExamplesCommandTest accordingly.
- Update CSS and JS files. - Remove chevronDown and dropdown functionality from drill-downs. - Add and implement Generate more buttons for multiple generations - Functions to dynamically update the examples table and recalculate the row-spans when adding new examples. - Use dynamic serial numbering no reliance on thymeleaf. - Modifications to how data is stored and accessed in JS. - Clean up TestInteractionsLog.combineLog for consistency.
- Group also by content-type when grouping endpoints. - Update updateSpans function in JS to also consider content-type. - Other CSS fixes.
* main: Loading config file from classpath Also in case of env property or classpath checking if the file exists before returning
- This change will be incorporated into a separate PR.
- Rename `atomicCounter` to `exampleFileNamePostFixCounter` to better describe the functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@@ -14,56 +16,81 @@ class ExamplesView { | |||
companion object { | |||
fun getEndpoints(feature: Feature, examplesDir: File): List<Endpoint> { | |||
val examples = examplesDir.getExamplesFromDir() | |||
return feature.scenarios.map { | |||
val example = getExistingExampleFile(it, examples) | |||
val scenarioExPairList = getScenarioExamplesPairs(feature.scenarios, examples) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please expand Ex
to Example
, will be easier to read
val example = getExistingExampleFile(it, examples) | ||
val scenarioExPairList = getScenarioExamplesPairs(feature.scenarios, examples) | ||
|
||
return scenarioExPairList.map { (scenario, ex) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, expand ex
to example
method = scenario.method, | ||
responseStatus = scenario.httpResponsePattern.status, | ||
contentType = scenario.httpRequestPattern.headersPattern.contentType, | ||
exampleFile = ex?.first, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we further explode ex
to exampleFile
and exampleMismatchReason
? so that we avoid using first
and second
) | ||
}.filterEndpoints().sortEndpoints() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason we stopped sorting endpoints? was this intentional?
What: Implement multiple examples loading and generation in the Interactive Server.
Load multiple examples and generate more examples in interactive examples UI.
Why:
Generate More
button when there are already existing examplesChecklist: