ATF - Is there a way to change the rollback execution in ATF when executing test suites?

RodolfoRR
Tera Contributor

I think the work that ATF rollback does is excellent, so it doesn't end up polluting the database with so many requests. However, as the same thing happens when a test is finished, I cannot take this current state to validate or continue with another test.

One of the premises of testing is that it must carry out one validation at a time, executing an action in isolation. However, if you want to create a test to validate a response after updating a record, see that in the same test I will have to create the record, update the record and check if another record was created in another table, through the previous update action.

The test at the ATF had to be created with three distinct steps. The ideal would be to have a test to create, another to update and a third to check whether the record was created or even changed according to the previous action. It's just an example, but for a particular situation I had to create a test aggregating 8 possible tests that should be isolated to validate the complete flow.

Either it would be done this way or I would have to create several records in the tables, one for each test situation that I want to validate, but then I lose the advantages of rollback.

Would it be possible to define that the rollback execution will be carried out when the tests for a suite are finished?

If you run the test, yes, ok, the rollback could be performed when it finishes, but when running the suite, the rollback will be executed when all the tests in the suite finish.

Regards,
Rodolfo Rocha

1 ACCEPTED SOLUTION

Maik Skoddow
Tera Patron
Tera Patron

Hi @RodolfoRR 

per definition (and related to ServiceNow) tests have to be independent and atomic. So it is not good test design to build on dependencies between tests.

But apart from that: There is absolute no way to change the rollback behavior in ServiceNow.

Maik

View solution in original post

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @RodolfoRR 

per definition (and related to ServiceNow) tests have to be independent and atomic. So it is not good test design to build on dependencies between tests.

But apart from that: There is absolute no way to change the rollback behavior in ServiceNow.

Maik

RodolfoRR
Tera Contributor

It's a shame not to be able to change the behavior as it would help a lot in creating more accurate tests, but thank you very much for the information.

Regards,
Rodolfo Rocha

Karla Chorny
Tera Expert

Came here hoping for a different answer. 😞 Seems like SN could add a 'Rollback after all tests complete' that, if unchecked (by default), all tests would roll back after each test is completed. But, if checked, records would remain intact until the last test completed. This would save SO MANY duplicated test steps.