@JayantS8 We can certainly target minimum set of test data. They however bump into the same issue occasionally. Test cases for report definition runs in one env ok but fails in another env. This is automated using Deployment Manager and hampering their deployment process. Client is looking for any best practice to streamline RD unit testing that would work commonly across different environments.
@delir Thanks for the input. I just tried, and from Tracer i see that it is creating a temp work object in clipboard (but not committed to db). Then the report definition (tested rule) will be executed but this runs against the work objects in database and puts the result in pyReportContentPage, which gets validated in the assertions. From this observation, the temp work object did not serve the purpose. Am i missing anything here or appreciate any other feedback.
@Will Cho Actually, i removed the cleanup checkbox and see the work object created in DB. RD processed the new work object and ran thru an assertion. I’ll circle back to client if this is viable for them.
@Will Cho Today i noticed that selecting the default cleanup checkbox actually properly removes the WO created in Setup. I suggest to validate this cleanup part when anyone tries this. The bottom line is that ‘Create work object’ in Setup is a valid option to unit test report definition or any test case that needs to query in database.