cancel
Showing results for 
Search instead for 
Did you mean: 

Unit test of FPM applications?

Former Member
0 Kudos

Is there any way to implement/execute some kind of unit tests for floorplan manager applications? I would like to write some automatically reproducible tests but cannot find any solution/framework for it.

Thomas

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Thomas,

I think we can do unit tests with FPM Feeder Class using ABAP Unit Wizard

Using the ABAP Unit Wizard - Test and Analysis Tools in ABAP - SAP Library

Also, you may want to take a look at this ABAP mocking framework by Uwe Kunath

uweku/mockA · GitHub

Hope it helps. Cheers!

Former Member
0 Kudos

Hi Nguyen,

I don't think this will work the way I thought about. What I want is not to run tests on the functionality behind the GUI, for which I can use ABAP Unit tests. I would like to verify that the GUI/application behaves to the user always as expected. For example, in my FPM applications I have a complex logic which UIBB elements are presented to the user according to the data the user has supplied. So I need some functionality to fake user input in some way (press a button, input to some text field, etc.) and to check how the GUI/screen behaves.

Thomas

former_member182680
Active Participant
0 Kudos

Dear Thomas,

Nguyen is right. Either you mock the behavior directly in the UI (then no ABAP Unit is needed). Or you are using GUIBBs with feeder classes and use ABAP Unit which requires you to call methods like FLUSH or PROCESS_EVENT in the ABAP unit test manually.

I tried it myself and it works pretty straight forward. All you would have to to is to

  • resolve all dependencies like the instance of IF_FPM in the INITIALIZE method.
  • A new feeder's subclass will be subject to the unit test.
  • Override INITIALIZE there and replace all dependencies by mocked instances
  • call the UIBB's methods like the FPM would do it: INITIALIZE, FLUSH, PROCESS_EVENT etc.
  • when needed, also mock parameter input like events (CL_FPM_EVENT)
  • carry out verifications against the mocked dependencies (e.g. if various methods like RAISE_EVENT or OPEN_DIALOG_BOX in IF_FPM have been called or not, or of certain wire objects have been passed)

Regards,

Uwe