Skip to main content
deleted 9 characters in body
Source Link
alecxe
  • 11.4k
  • 11
  • 51
  • 107

So i've ran into a bit of a problem, I have a set of automated tests created for a site, were looking into really moving towards a CI based system for testing (Running the test suite after pushing features/etc...)

However in this site and a lot of my automated tests involve creating records in the database (through the site). Which is fine and everything, I mean these are features I WANT to exercise.

However....I can't just keep running the tests on the same database, the test data would just keep filling up! I could Delete the records from the database using the Websites ability to delete things, but that's insanely brittle and relies me going to an exact "Delete" button on a list to do that....seems like a poor idea. Plus if that automated test doesn't work, we get extra data...not good.

So how do I get around this?

Most of our sites are rails sites, i've looked into using Factories, but that doesn't really seem like it replicates doing a true integration test. So I could just recreate a database and reseed with test data before every automation suite run, or is this bad practice?

How do I get a good system running for test data in this scenario + moving forward?

Thanks!

So i've ran into a bit of a problem, I have a set of automated tests created for a site, were looking into really moving towards a CI based system for testing (Running the test suite after pushing features/etc...)

However in this site and a lot of my automated tests involve creating records in the database (through the site). Which is fine and everything, I mean these are features I WANT to exercise.

However....I can't just keep running the tests on the same database, the test data would just keep filling up! I could Delete the records from the database using the Websites ability to delete things, but that's insanely brittle and relies me going to an exact "Delete" button on a list to do that....seems like a poor idea. Plus if that automated test doesn't work, we get extra data...not good.

So how do I get around this?

Most of our sites are rails sites, i've looked into using Factories, but that doesn't really seem like it replicates doing a true integration test. So I could just recreate a database and reseed with test data before every automation suite run, or is this bad practice?

How do I get a good system running for test data in this scenario + moving forward?

Thanks!

So i've ran into a bit of a problem, I have a set of automated tests created for a site, were looking into really moving towards a CI based system for testing (Running the test suite after pushing features/etc...)

However in this site and a lot of my automated tests involve creating records in the database (through the site). Which is fine and everything, I mean these are features I WANT to exercise.

However....I can't just keep running the tests on the same database, the test data would just keep filling up! I could Delete the records from the database using the Websites ability to delete things, but that's insanely brittle and relies me going to an exact "Delete" button on a list to do that....seems like a poor idea. Plus if that automated test doesn't work, we get extra data...not good.

So how do I get around this?

Most of our sites are rails sites, i've looked into using Factories, but that doesn't really seem like it replicates doing a true integration test. So I could just recreate a database and reseed with test data before every automation suite run, or is this bad practice?

How do I get a good system running for test data in this scenario + moving forward?

edited tags
Link
Michael Durrant
  • 25.2k
  • 3
  • 41
  • 113
Source Link
Mercfh
  • 1.7k
  • 2
  • 14
  • 28

Preparing test data for Automated Testing

So i've ran into a bit of a problem, I have a set of automated tests created for a site, were looking into really moving towards a CI based system for testing (Running the test suite after pushing features/etc...)

However in this site and a lot of my automated tests involve creating records in the database (through the site). Which is fine and everything, I mean these are features I WANT to exercise.

However....I can't just keep running the tests on the same database, the test data would just keep filling up! I could Delete the records from the database using the Websites ability to delete things, but that's insanely brittle and relies me going to an exact "Delete" button on a list to do that....seems like a poor idea. Plus if that automated test doesn't work, we get extra data...not good.

So how do I get around this?

Most of our sites are rails sites, i've looked into using Factories, but that doesn't really seem like it replicates doing a true integration test. So I could just recreate a database and reseed with test data before every automation suite run, or is this bad practice?

How do I get a good system running for test data in this scenario + moving forward?

Thanks!