SBX - Search With Button

SBX - Forum Post Title

SysTest / SysTestCase framework

Dynamics 365 for Finance and Operations Forum

Harry (Harshawardhan) Deshpande asked a question on 8 Oct 2018 5:12 PM

Question Status

Verified

hi

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.

 

regards

harry

Reply
Joris de Gruyter responded on 8 Oct 2018 5:58 PM
My Badges
Verified Answer

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.

Reply
Harry (Harshawardhan) Deshpande responded on 8 Oct 2018 6:06 PM

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.

Reply
Joris de Gruyter responded on 9 Oct 2018 1:11 PM
My Badges
Suggested Answer

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.

See

docs.microsoft.com/.../using-task-guides-and-bpm-to-create-user-acceptance-tests

www.microsoft.com/.../details.aspx

Reply
Harry (Harshawardhan) Deshpande responded on 9 Oct 2018 1:18 PM

Unfortunately regression test suite cannot handle workflow tests

Reply
shinystar111 responded on 11 Oct 2018 1:26 PM
My Badges

Any of test tools come with mocking tool so I don't have to write data into the database?

Reply
Joris de Gruyter responded on 12 Oct 2018 2:22 PM
My Badges
Suggested Answer

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.

Reply
Harry (Harshawardhan) Deshpande responded on 12 Oct 2018 2:25 PM

Actually, I am almost done with writing / hacking into that framework. I will publish the project in a day.

Reply
Joris de Gruyter responded on 12 Oct 2018 2:49 PM
My Badges

I'd love to see that!

Reply
Harry (Harshawardhan) Deshpande responded on 13 Oct 2018 4:31 PM

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.

Reply
Joris de Gruyter responded on 8 Oct 2018 5:58 PM
My Badges
Verified Answer

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.

Reply
Joris de Gruyter responded on 9 Oct 2018 1:11 PM
My Badges
Suggested Answer

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.

See

docs.microsoft.com/.../using-task-guides-and-bpm-to-create-user-acceptance-tests

www.microsoft.com/.../details.aspx

Reply
Joris de Gruyter responded on 12 Oct 2018 2:22 PM
My Badges
Suggested Answer

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.

Reply

SBX - Two Col Forum

SBX - Migrated JS