You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,8 +97,8 @@ Leveraging it can mitigate writing a lot of code as we translate those manual st
97
97
98
98
____
99
99
100
-
* How _productive_ would it be, if you can plug your exported Postman collection template,
101
-
that you anyway would have created for your manual testing, and execute them through your JVM tests?
100
+
* How _productive_ would it be, if you could plug your exported Postman collection template,
101
+
that you anyway would have created for your manual testing and executed through your JVM tests?
102
102
103
103
* How about a Universal API automation tool that promotes low code and low-cognitive-complexity and strikes a balance between flexibility and ease of use?
104
104
@@ -185,8 +185,8 @@ such that you can seamlessly run more assertions on top of the run.
185
185
[source,kotlin,indent=0,options="nowrap"]
186
186
----
187
187
Rundown(
188
-
stepNameToReport: List<StepReport>,
189
-
environment: PostmanEnvironment)
188
+
val stepReports: List<StepReport>,
189
+
val mutableEnv: PostmanEnvironment<Any?>)
190
190
191
191
StepReport(
192
192
step: Step,
@@ -201,7 +201,7 @@ StepReport(
201
201
<2> Snapshot of Environment at the end of each step execution. It can be compared with previous or next step environment snapshots to see what changed in this step
202
202
203
203
[.lead]
204
-
`Rundown` has many convenience methods to ease applying further assertions on top of it.
204
+
`Rundown` has many convenient methods to ease applying further assertions on top of it.
205
205
206
206
TIP: Other simple examples to see in Action: link:{integrationtestdir}/com/salesforce/revoman/integration/pokemon/PokemonTest.java[PokemonTest.java]
This tool has particular emphasis on Debugging experience. Here is what a debugger view of a <<Rundown>> looks like:
331
+
This tool has a particular emphasis on the Debugging experience. Here is what a debugger view of a <<Rundown>> looks like:
332
332
333
333
image:rundown.png[Rundown of all steps]
334
334
@@ -338,7 +338,7 @@ image:rundown.png[Rundown of all steps]
338
338
image:step-report.png[Step Report]
339
339
340
340
[.lead]
341
-
Here are the environment *key-value* pairs accumulated along the entire execution and appended to the environment from file and dynamicEnvironment supplied:
341
+
Here are the environment *key-value* pairs accumulated along the entire execution and appended to the environment from the file and `dynamicEnvironment` supplied:
342
342
343
343
image:mutable-env.png[Mutable environment after the execution completion]
=== Type Safety with flexible JSON <- -> POJO marshalling/serialization and unmarshalling/deserialization
367
367
368
368
* ReṼoman internally uses a modern JSON library called https://github.com/square/moshi[**Moshi**]
369
-
* There may be a POJO that inherits or contains legacy types which are hard or impossible to serialize. ReṼoman lets you serialize such types through `globalSkipTypes`, where you can filter-out these legacy types from Marshalling/Unmarshalling, only focussing on fields that matter.
369
+
* There may be a POJO that inherits or contains legacy types that are hard or impossible to serialize. ReṼoman lets you serialize such types through `globalSkipTypes`, where you can filterout these legacy types from Marshalling/Unmarshalling, only focussing on fields that matter.
370
370
* The payload may not map to POJO, and you may need a custom types adapter for Marshalling/Unmarshalling. Moshi has it covered for you with its advanced adapter mechanism and ReṼoman accepts Moshi adapters via
371
371
** `requestConfig` — For types present as part of request payload for qualified Steps
372
372
** `responseConfig` — For types present as part of response payload for qualified Steps
@@ -432,15 +432,15 @@ You can plug in your java code
432
432
to create/generate values for environment variables
433
433
which can be populated and picked-up by subsequent steps.
434
434
For example, you may want some `xyzId` but you don't have a Postman collection to create it.
435
-
But instead, you have a Java utility to generate/create it.
435
+
Instead, you have a Java utility to generate/create it.
436
436
You can invoke the utility in a pre-hook of a step and set the value in `rundown.mutableEnv`,
437
437
so the later steps can pick up value for `+{{xyzId}}+` variable from the environment.
438
438
439
439
==== Response Validations
440
440
441
441
* Post-Hooks are the best place to validate response right after the step.
442
442
* If you have configured a strong type for your response through `responseConfig`, you can write type-safe validations by extracting your Strong type Object using `stepReport.responseInfo.get().<TypeT>getTypedTxnObj()` (if you have configured `responseConfig()` or `globalCustomTypeAdapters()`) or use `JsonPojoUtils.jsonToPojo(TypeT, stepReport.responseInfo.get().httpMsg.bodyString())` to convert it inline.
443
-
* If your response data structure is non-trivial and have requirements to execute validations with different strategies like `fail-fast` or `error-accumulation`, consider using a library like https://github.com/salesforce-misc/Vador[*Vador*]
443
+
* If your response data structure is non-trivial and has requirements to execute validations with different strategies like `fail-fast` or `error-accumulation`, consider using a library like https://github.com/salesforce-misc/Vador[*Vador*]
* `node_modules` adds a lot of files to checkin. You may replace them with a single distribution file
472
+
* `node_modules` adds a lot of files to check-in. You may replace them with a single distribution file
473
473
474
474
image::node_modules.png[]
475
475
@@ -481,7 +481,7 @@ CAUTION: The recommendation is not to add too much code in <<Pre-req and Post-re
481
481
[#_mutable_environment]
482
482
=== Mutable Environment
483
483
484
-
* Environment is the only mutable-shared state across step executions, which can be used for data-passing between consumer and the library.
484
+
* Environment is the only mutable-shared state across step executions, which can be used for datapassing between the consumer and the library.
485
485
* This can be mutated (set key-value pairs) through <<Pre-req and Post-res scripts>> (using `pm.environment.set()`) and <<#_pre_and_post_hooks,Pre-/Post-Hooks>> (using the reference `rundown.mutableEnv`) during execution.
486
486
487
487
==== Read Mutable Environment as Postman Environment JSON format
@@ -497,12 +497,12 @@ Each StepReport also has a `pmEnvSnapshot` to assert if a step has executed as e
497
497
=== Compose Modular Executions
498
498
499
499
* You don't have to squash all your steps into one mega collection. Instead, you can break them into easy-to-manage modular collections. `ReVoman.revUp()` accepts a list of collection paths through `templatePaths()`
500
-
* But that doesn't mean you have to execute all these templates in one-go. You can make multiple `ReVoman.revUp()` calls for different collection.
501
-
* If you wish to compose these executions, you can do so by adding the previous execution's `mutableEnv` to current execution using `dynamicEnvironment` parameter. This also comes in handy when you wish to execute a common step (e.g. `UserSetup`) inside a test setup method and use that environment for all the tests.
500
+
* But that doesn't mean you have to execute all these templates in one-go. You can make multiple `ReVoman.revUp()` calls for different collections.
501
+
* If you wish to compose these executions, you can do so by adding the previous execution's `mutableEnv` to the current execution using the `dynamicEnvironment` parameter. This also comes in handy when you wish to execute a common step (e.g. `UserSetup`) inside a Test setup method and use that environment for all the tests.
502
502
503
503
=== Custom Dynamic variables
504
504
505
-
If the in-built dynamic variables don't fit your need, you can plug your own dynamic variable generator
505
+
If the in-built dynamic variables don't fit your needs, you can plug your own dynamic variable generator
506
506
to be invoked to generate a value for your custom variable-key in the template at runtime.
507
507
508
508
== USP
@@ -535,8 +535,8 @@ The above test doesn't just have low code, but also low in Cognitive Complexity
535
535
536
536
== Perf
537
537
538
-
This entire execution of **~75 steps**, which includes **10 async steps**, took a mere *122 sec* on localhost.
539
-
This can be much better on auto-build environments.
538
+
This entire execution of **~75 steps**, including **10 async steps**, took a mere *122 sec* on localhost.
539
+
This can be much better in auto-build environments.
540
540
541
541
image:pq-revoman-test-time.png[Localhost Test time on FTest console for ~75 steps]
542
542
@@ -549,7 +549,7 @@ to how your server responds or your network speed.
549
549
The future looks bright with multiple impactful features in the pipeline:
550
550
551
551
* API metrics and Analytics
552
-
* *It's built with extensibility* in mind. It can easily be extended to support other template formats, e.g., Kaiju templates used for availability testing.
552
+
* *It's built with extensibility* in mind. It can easily be extended to support other template formats, such as Kaiju templates used for availability testing.
553
553
* In-built polling support for Async steps
554
554
* Payload generation
555
555
* Flow control through YAML config
@@ -569,13 +569,13 @@ The future looks bright with multiple impactful features in the pipeline:
569
569
=== Do I need to migrate all my existing TestUtils to Postman Collections?
570
570
571
571
You don't have to.
572
-
This is a JVMfirst tool,
572
+
This is a JVM-first tool,
573
573
and you can interlace your TestUtils through <<#_plug_in_your_java_code_in_between_postman_execution,Pre-/Post-Hooks>>
574
574
575
575
=== Why not use https://learning.postman.com/docs/collections/using-newman-cli/command-line-integration-with-newman[Newman] or https://learning.postman.com/docs/postman-cli/postman-cli-overview/#comparing-the-postman-cli-and-newman[Postman CLI]?
576
576
577
577
* ReṼoman may be similar to Newman or Postman CLI when it comes to executing a Postman collection, but the _similarities end there_.
578
-
* Newman or Postman CLI are built for node and cannot be executed within a JVM. Even if you are able to run with some hacky way, there is no easy way to assert results.
578
+
* Newman or Postman CLI are built for node and cannot be executed within a JVM. Even if you are able to run in some hacky way, there is no easy way to assert results.
579
579
* ReṼoman is JVM first that lets you configure a lot more, and gives you back a detailed report to assert in a typesafe way
0 commit comments