mirror of
https://github.com/abap2UI5/abap2UI5.git
synced 2025-04-30 18:46:18 +08:00

* update * new binding * update * new binding * abaplint * updates * update binding * Update abaplint.jsonc * Update abaplint.jsonc * update * Update abaplint.jsonc * Update abaplint.jsonc * Update abaplint.jsonc * update * update binding * abaplint fixes * abaplint fixes * added unit tests * abaplint fixes * added unit tests * Update abaplint.jsonc * more unit tests * more unit tests * Update src/00/z2ui5_cl_fw_utility.clas.abap Co-authored-by: Lars Hvam <larshp@hotmail.com> * Update src/00/z2ui5_cl_fw_utility.clas.abap Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com> * update unit tests * update * refactoring binding main * abaplint fixes * exception renamind and bind_local * Delete z2ui5_cl_fw_error.clas.abap * Delete z2ui5_cl_fw_handler.clas.testclasses.abap * Delete z2ui5_cl_fw_error.clas.xml * update refactoring * refactoring binding * update * update binding * refactoring and unit tests * abaplint fixes * unit test cx_fw_error * abaplint fixes * abaplint fixes * refactoring * Update abaplint.jsonc * update * updates * refactoring and more unit tests * abaplint fixes * downport readiness * downport readiness * unit test one time binding * update versions * refactor bind method * update unit test order * unit test order * unit test order * unit test order * unit test order * unit test order * unit test order * update version * fix one way binding * refactoring json to any * bugfix dissolve object ref * update xml_view->get and unit test naming * cleanup unit tests * add check binding with dereferenced data * nested models fixes * update xml view with refactored method names * error handling, exception texts * fix xml transformation bug * add more exceptions * refactoring char to string * unit test * unit tests * unit tests order * unit test order * unit test order * unit test order * update handling generic data references * adjust binding, no more auto local binding * update binding * abapgit small diffs * update unit tests * update unit tests * update unit tests * unit tests * abaplint fixes --------- Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: abaplint[bot] <24845621+abaplint[bot]@users.noreply.github.com>
155 lines
5.7 KiB
ABAP
155 lines
5.7 KiB
ABAP
CLASS z2ui5_cl_fw_integration_test DEFINITION
|
|
PUBLIC
|
|
FINAL
|
|
CREATE PUBLIC.
|
|
|
|
PUBLIC SECTION.
|
|
INTERFACES z2ui5_if_app.
|
|
|
|
DATA product TYPE string.
|
|
DATA quantity TYPE string.
|
|
DATA check_initialized TYPE abap_bool.
|
|
|
|
CLASS-DATA sv_state TYPE string.
|
|
PROTECTED SECTION.
|
|
PRIVATE SECTION.
|
|
ENDCLASS.
|
|
|
|
|
|
|
|
CLASS Z2UI5_CL_FW_INTEGRATION_TEST IMPLEMENTATION.
|
|
|
|
|
|
METHOD z2ui5_if_app~main.
|
|
|
|
IF check_initialized = abap_false.
|
|
check_initialized = abap_true.
|
|
product = 'tomato'.
|
|
quantity = '500'.
|
|
ENDIF.
|
|
|
|
CASE client->get( )-event.
|
|
WHEN 'BUTTON_POST'.
|
|
client->message_toast_display( |{ product } { quantity } - send to the server| ).
|
|
WHEN 'BACK'.
|
|
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app_stack ) ).
|
|
ENDCASE.
|
|
|
|
IF sv_state = 'TEST_MESSAGE_BOX'.
|
|
client->message_box_display( 'test message box' ).
|
|
ENDIF.
|
|
|
|
IF sv_state = 'TEST_MESSAGE_TOAST'.
|
|
client->message_toast_display( 'test message toast' ).
|
|
ENDIF.
|
|
|
|
CASE sv_state.
|
|
|
|
WHEN `ERROR`.
|
|
DATA(lv_test) = 1 / 0 ##NEEDED.
|
|
|
|
WHEN 'TEST_ONE_WAY'.
|
|
client->view_display( z2ui5_cl_xml_view=>factory( client )->shell(
|
|
)->page( title = 'abap2UI5 - First Example'
|
|
navbuttonpress = client->_event( 'BACK' )
|
|
shownavbutton = abap_true
|
|
)->simple_form( title = 'Form Title'
|
|
editable = abap_true
|
|
)->content( 'form'
|
|
)->title( 'Input'
|
|
)->label( 'quantity'
|
|
)->input( client->_bind( quantity )
|
|
)->label( 'product'
|
|
)->input( value = product
|
|
enabled = abap_false
|
|
)->button( text = 'post'
|
|
press = client->_event( 'BUTTON_POST' )
|
|
)->get_root( )->xml_get( ) ).
|
|
|
|
WHEN 'TEST_POPUP'.
|
|
|
|
client->popup_display( z2ui5_cl_xml_view=>factory( client
|
|
)->dialog( title = 'abap2UI5 - First Example'
|
|
)->simple_form( title = 'Form Title'
|
|
editable = abap_true
|
|
)->content( 'form'
|
|
)->title( 'Input'
|
|
)->label( 'quantity'
|
|
)->input( client->_bind_edit( quantity )
|
|
)->label( 'product'
|
|
)->input( value = product
|
|
enabled = abap_false
|
|
)->button( text = 'post'
|
|
press = client->_event( 'BUTTON_POST' )
|
|
)->get_root( )->xml_get( ) ).
|
|
|
|
WHEN 'TEST_TIMER'.
|
|
client->timer_set( event_finished = 'TIMER_FINISHED'
|
|
interval_ms = `500` ).
|
|
|
|
client->view_display( z2ui5_cl_xml_view=>factory( client )->shell(
|
|
)->page( title = 'abap2UI5 - First Example'
|
|
navbuttonpress = client->_event( 'BACK' )
|
|
shownavbutton = abap_true
|
|
)->simple_form( title = 'Form Title'
|
|
editable = abap_true
|
|
)->content( 'form'
|
|
)->title( 'Input'
|
|
)->label( 'quantity'
|
|
)->input( client->_bind( quantity )
|
|
)->label( 'product'
|
|
)->input( value = product
|
|
enabled = abap_false
|
|
)->button( text = 'post'
|
|
press = client->_event( 'BUTTON_POST' )
|
|
)->get_root( )->xml_get( ) ).
|
|
|
|
WHEN OTHERS.
|
|
client->view_display( z2ui5_cl_xml_view=>factory( client )->shell(
|
|
)->page( title = 'abap2UI5 - First Example'
|
|
navbuttonpress = client->_event( 'BACK' )
|
|
shownavbutton = abap_true
|
|
)->simple_form( title = 'Form Title'
|
|
editable = abap_true
|
|
)->content( 'form'
|
|
)->title( 'Input'
|
|
)->label( 'quantity'
|
|
)->input( client->_bind_edit( quantity )
|
|
)->label( 'product'
|
|
)->input( value = product
|
|
enabled = abap_false
|
|
)->button( text = 'post'
|
|
press = client->_event( 'BUTTON_POST' )
|
|
)->get_root( )->xml_get( ) ).
|
|
|
|
ENDCASE.
|
|
|
|
IF sv_state = 'TEST_SCROLL_CURSOR'.
|
|
|
|
client->view_display( `test` ).
|
|
client->cursor_set( id = 'id_text2'
|
|
cursorpos = '5'
|
|
selectionstart = '5'
|
|
selectionend = '10' ).
|
|
|
|
client->scroll_position_set( VALUE #( v = '99999'
|
|
( n = 'id_page' )
|
|
( n = 'id_text3' ) ) ).
|
|
|
|
ENDIF.
|
|
|
|
IF sv_state = 'TEST_NAVIGATE'.
|
|
DATA(lo_app) = NEW z2ui5_cl_fw_integration_test( ).
|
|
sv_state = 'LEAVE_APP'.
|
|
client->nav_app_call( lo_app ).
|
|
RETURN.
|
|
ENDIF.
|
|
|
|
IF sv_state = 'LEAVE_APP'.
|
|
CLEAR sv_state.
|
|
client->nav_app_leave( client->get_app( client->get( )-s_draft-id_prev_app ) ).
|
|
ENDIF.
|
|
|
|
ENDMETHOD.
|
|
ENDCLASS.
|