I am writing test cases using SysTest framework. These tests are workflow related and hence cannot be written using the new framework that Microsoft is releasing soon.
The issue I am facing is that when I run the test that creates a document and submit to workflow, it is not getting picked up by workflow. I suspect that this is because the data is not committed. In SQL server I have to set transaction isolation level 'read uncommitted' to see this data.
Can someone please confirm whether this is expected? If yes, then any hack to get this working? We would actually prefer that the test cases that have been executed stay in the database in case end users wish to review the results.
What's the intent of the test (i.e. what are you testing)? Unit tests need to precise and very small and isolated. If you're submitting something to workflow then what are you asserting? That it was submitted?
If you're expecting a certain workflow outcome based on the test, clearly you need to also execute the workflow to process your code, so you can actually test the outcome.
I think reviewing those questions should answer and fix your test. That said, yes the data isolation is one thing - but also the tests can run in any which way including without batch server. If you depend on the batch server doing something then you have a dependency outside of your control.
The build automation - unfortunately - runs the tests while the AOS and the batch are running. But interestingly, neither is actually used by the framework and for performance and other reasons it probably should leave the AOS and batch server off until the tests are done.
We are writing scenario test cases for user acceptance testing. These are not unit tests. Yes, workflow is running and if I execute the scenario manually then purchase order workflow gets processed as expected.
We will worry about build automation once we figure out how to execute these workflow test cases. :(
Workflow is not getting processed in these test cases since the record is not committed. I know this since I do not see the record in SQL server until read isloation level is set to uncommitted. I am wondering if anyone can confirm this and if there is any hack to get around this issue.
For that type of scenario, you may want to consider moving away from SysTest and use the recently released Regression Suite Tool. This is automated end-to-end integrated testing through the browser.
Unfortunately regression test suite cannot handle workflow tests
Any of test tools come with mocking tool so I don't have to write data into the database?
Unfortunately, no. The kernel of the AOS that deals with database versus the abstraction of that in the X++ exposed APIs doesn't support it. I would love to see that feature built but this would be a considerable effort.
Actually, I am almost done with writing / hacking into that framework. I will publish the project in a day.
I'd love to see that!
wow! how do I add attachment to the thread? Looks like it is not allowed.
Let me host the workflow testing project somewhere and then I will add the link.
Business Applications communities