Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
getToken() has been restructured in this way:
role parameter has a default value. (default is: "admin")
All invocation, except one in common-step.ts, call this function with role = "admin"; so this value gets default value in parameter's function.
token generation has moved from
BeforeAll()
features/common-steps.ts to utils/commons.ts; token generation is inside local functiongetToken()
and not in global cucumber context. Token generation is called only the first time getToken() is called.Now the getToken() invocation is simplified:
const token = await getToken(tenantType); // default role = "admin"
const token await getToken(tenantType, role);
I run all test after modification:
Only 7 has failed, for this reason:
Remarks:
getToken() is executed many times as N workers in parallel execution, same behavior then BeforeAll()
Some references about parallelization: