Skip to content

Commit 7e07a1b

Browse files
updated read me for for testContext->scenarioContext
1 parent bc6666a commit 7e07a1b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ Here we have to create specific class for each API eg: [createUserStepDef.java](
118118
* Add request url parameter from context - @GetUserAPI02 - Given request have context 'idValue' in request path '/users'
119119

120120
## 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());`
123123
* What will happen during chaining the request?
124124
* 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.
125125
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
299299
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.
300300

301301
# 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
304304
* We are using google-guice for DI
305305

306306

307307
# Other Features
308308
* Added `google-juice` and `cucumber-juice` for managing the state of class object
309309
* 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
311311
* The output of the test execution like response body, status, DB values etc. can be logged in report for the later use, so
312312
didn't create any other mechanism for that.
313313
**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.
315315

316316
# Why and why not
317317
* RestAsssured

0 commit comments

Comments
 (0)