Skip to main content
Tweeted twitter.com/StackSQA/status/1215830999243862017
changed 2e2 to e2e to better reflect end to end testing
Source Link
Lyndon Vrooman
  • 6.1k
  • 27
  • 52

I'm going to write API and 2e2e2e auto-tests, and planning this encountered the problem of how to load test data needed to execute test cases. I see 2 approaches:

  1. Use api to create necessary resources.The problem with this approach is that it might be very complicated to create some resources, we will duplicate some logic that exists in front-end. And when api changes, testing helpers need to be changed as well. And if we stored some stub json files with data, we need to go though all of them and make changes.

  2. Create data though UI and save mysql dump, then load for each test appropriate dump. Benefits of this approach is that in case of api change, we don't need to change anything, just run migrations. But if 2 persons were changing same test in their feature branches, and then merge, it will be hard(impossible?) to merge 2 mysql dump files.

Which one is better, is there other alternatives. Personally I tend to use second one, is there any severe downsides of it?

I'm going to write API and 2e2 auto-tests, and planning this encountered the problem of how to load test data needed to execute test cases. I see 2 approaches:

  1. Use api to create necessary resources.The problem with this approach is that it might be very complicated to create some resources, we will duplicate some logic that exists in front-end. And when api changes, testing helpers need to be changed as well. And if we stored some stub json files with data, we need to go though all of them and make changes.

  2. Create data though UI and save mysql dump, then load for each test appropriate dump. Benefits of this approach is that in case of api change, we don't need to change anything, just run migrations. But if 2 persons were changing same test in their feature branches, and then merge, it will be hard(impossible?) to merge 2 mysql dump files.

Which one is better, is there other alternatives. Personally I tend to use second one, is there any severe downsides of it?

I'm going to write API and e2e auto-tests, and planning this encountered the problem of how to load test data needed to execute test cases. I see 2 approaches:

  1. Use api to create necessary resources.The problem with this approach is that it might be very complicated to create some resources, we will duplicate some logic that exists in front-end. And when api changes, testing helpers need to be changed as well. And if we stored some stub json files with data, we need to go though all of them and make changes.

  2. Create data though UI and save mysql dump, then load for each test appropriate dump. Benefits of this approach is that in case of api change, we don't need to change anything, just run migrations. But if 2 persons were changing same test in their feature branches, and then merge, it will be hard(impossible?) to merge 2 mysql dump files.

Which one is better, is there other alternatives. Personally I tend to use second one, is there any severe downsides of it?

Source Link

Pros and cons of using database dump in autotesting?

I'm going to write API and 2e2 auto-tests, and planning this encountered the problem of how to load test data needed to execute test cases. I see 2 approaches:

  1. Use api to create necessary resources.The problem with this approach is that it might be very complicated to create some resources, we will duplicate some logic that exists in front-end. And when api changes, testing helpers need to be changed as well. And if we stored some stub json files with data, we need to go though all of them and make changes.

  2. Create data though UI and save mysql dump, then load for each test appropriate dump. Benefits of this approach is that in case of api change, we don't need to change anything, just run migrations. But if 2 persons were changing same test in their feature branches, and then merge, it will be hard(impossible?) to merge 2 mysql dump files.

Which one is better, is there other alternatives. Personally I tend to use second one, is there any severe downsides of it?