#Share Data across testing case

4 messages · Page 1 of 1 (latest)

split void
#

Hi,

I'm currently dealing with an issue that isn't particularly critical. To illustrate, consider this scenario: I have a user with basic information, and I need to use this user data in numerous test cases, such as those related to authentication, feature CRUD operations, and more.

Is it a common practice to share data across tests using a function that generates this data, as opposed to repeatedly recreating it within each individual test file?

spare glen
#

Sharing it isn't a bad approach, it's actually somewhat common.

I use an e2e tool called pactum that even allows you to set up a store for data, so it can be re-used it later requests

rain swallow
keen tree
#

I guess pact.io, msw or just a mock/fixture of json would do also. But I also guess that his works. What may be a bit out of the scope would be, if the execution of one test would be necessary for another test to run correctly