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.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -118,8 +118,8 @@ Here we have to create specific class for each API eg: [createUserStepDef.java](
118
118
* Add request url parameter from context - @GetUserAPI02 - Given request have context 'idValue' in request path '/users'
119
119
120
120
## Request specification step building logic:
121
-
* Created reqId in TestContext hence sharing is easy between steps. reqId will act as a scenario id key to build request specification map.
122
-
* Generate and put reqId in `@Given("start new scenario")` using `testContext.setReqId(testContext.generateReqId());`
121
+
* Created reqId in ScenarioContext hence sharing is easy between steps. reqId will act as a scenario id key to build request specification map.
122
+
* Generate and put reqId in `@Given("start new scenario")` using `scenarioContext.setReqId(scenarioContext.generateReqId());`
123
123
* What will happen during chaining the request?
124
124
* We are using `@Given("start new scenario")` when ever we start a scenario. When we are chaining two different APIs in a single scenario, We dont have to use `@Given("start new scenario")` twice i.e we can avoid generating new reqId. Eg: CreateUser02, CreateUser07. If we have duplicate steps in same scenario the latest step will override the value.
125
125
That is suppose of we have steps like below
@@ -299,19 +299,19 @@ We only have to create test in extend report in the scenario level configuration
299
299
For test step status management are using listener class named `com.utils.TestListener` which implements cucumber plugin `ConcurrentEventListener`. Using this plugin we are managing the status of the test cases by monitoring test steps. We are handling three main status **FAILED, PASSED, SKIPPED**. Since we have all the steps in `stepDef` package, we added request response and other related details to report through the same classes in the package.
300
300
301
301
# Context sharing
302
-
All the features which are common in scenario level like **responseContext, reqBodyContext, contextValues, requestBuilder, configuration and wiremock server** are done through `com.utils.TestContext`. i.e. During the execution if we want to share the data between steps or scenarios, we need to use TestContext.
303
-
*TestContext is marked with `@ScenarioScoped`, so the class will have separate copy of instance for each scenario
302
+
All the features which are common in scenario level like **responseContext, reqBodyContext, contextValues, requestBuilder, configuration and wiremock server** are done through `com.utils.ScenarioContext`. i.e. During the execution if we want to share the data between steps or scenarios, we need to use ScenarioContext.
303
+
*ScenarioContext is marked with `@ScenarioScoped`, so the class will have separate copy of instance for each scenario
304
304
* We are using google-guice for DI
305
305
306
306
307
307
# Other Features
308
308
* Added `google-juice` and `cucumber-juice` for managing the state of class object
309
309
* Added the `@ScenarioScoped`(the object of a class marked this annotation is only created for one scenario and destroyed after the use)
310
-
* Added functionality of TestContext to accommodate all the common function in a scenario perspective eg: contextValues
310
+
* Added functionality of ScenarioContext to accommodate all the common function in a scenario perspective eg: contextValues
311
311
* The output of the test execution like response body, status, DB values etc. can be logged in report for the later use, so
312
312
didn't create any other mechanism for that.
313
313
**RestAssuredLoggingFilter:** Adding rest assured logs to console including all the details of request and response.
314
-
**Configuration:** Configurations for the test suits are done through `com.utils.ConfigUtil` interface which extends `org.aeonbits.owner.Config`. Suit level configuration are done in `TestContext` class.
314
+
**Configuration:** Configurations for the test suits are done through `com.utils.ConfigUtil` interface which extends `org.aeonbits.owner.Config`. Suit level configuration are done in `ScenarioContext` class.
0 commit comments