From edfbfab6cefe5f38f5b990cd51650dff0c7877d4 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Tue, 8 Apr 2025 15:57:59 +0200 Subject: [PATCH] web test: move files and fixes (#7195) --- deps/cl_package_factory.clas.abap | 8 +-- package.json | 6 +- test/gitea/docker-compose.yml | 2 - test/gitea/package.json | 4 +- .../zcl_abapgit_html_viewer_web.clas.abap | 0 .../zcl_abapgit_html_viewer_web.clas.xml | 0 test/src/{ => web}/zcl_abapgit_web.clas.abap | 13 ++++- test/src/{ => web}/zcl_abapgit_web.clas.xml | 0 .../src/web/zcl_abapgit_web_cts_api.clas.abap | 51 +++++++++++++++++ test/src/web/zcl_abapgit_web_cts_api.clas.xml | 16 ++++++ .../web/zcl_abapgit_web_environment.clas.abap | 57 +++++++++++++++++++ .../web/zcl_abapgit_web_environment.clas.xml | 16 ++++++ .../web/zcl_abapgit_web_inject_fm.clas.abap | 33 +++++++++++ .../web/zcl_abapgit_web_inject_fm.clas.xml | 16 ++++++ .../{ => web}/zcl_abapgit_web_sicf.clas.abap | 0 .../zif_abapgit_web_request.intf.abap | 0 .../zif_abapgit_web_request.intf.xml | 0 .../zif_abapgit_web_response.intf.abap | 0 .../zif_abapgit_web_response.intf.xml | 0 19 files changed, 210 insertions(+), 12 deletions(-) rename test/src/{ => web}/zcl_abapgit_html_viewer_web.clas.abap (100%) rename test/src/{ => web}/zcl_abapgit_html_viewer_web.clas.xml (100%) rename test/src/{ => web}/zcl_abapgit_web.clas.abap (92%) rename test/src/{ => web}/zcl_abapgit_web.clas.xml (100%) create mode 100644 test/src/web/zcl_abapgit_web_cts_api.clas.abap create mode 100644 test/src/web/zcl_abapgit_web_cts_api.clas.xml create mode 100644 test/src/web/zcl_abapgit_web_environment.clas.abap create mode 100644 test/src/web/zcl_abapgit_web_environment.clas.xml create mode 100644 test/src/web/zcl_abapgit_web_inject_fm.clas.abap create mode 100644 test/src/web/zcl_abapgit_web_inject_fm.clas.xml rename test/src/{ => web}/zcl_abapgit_web_sicf.clas.abap (100%) rename test/src/{ => web}/zif_abapgit_web_request.intf.abap (100%) rename test/src/{ => web}/zif_abapgit_web_request.intf.xml (100%) rename test/src/{ => web}/zif_abapgit_web_response.intf.abap (100%) rename test/src/{ => web}/zif_abapgit_web_response.intf.xml (100%) diff --git a/deps/cl_package_factory.clas.abap b/deps/cl_package_factory.clas.abap index 416a7ef2a..6670242d3 100644 --- a/deps/cl_package_factory.clas.abap +++ b/deps/cl_package_factory.clas.abap @@ -2,10 +2,10 @@ CLASS cl_package_factory DEFINITION PUBLIC. PUBLIC SECTION. CLASS-METHODS load_package IMPORTING - i_package_name TYPE devclass + i_package_name TYPE devclass VALUE(i_force_reload) TYPE abap_bool OPTIONAL EXPORTING - VALUE(e_package) TYPE REF TO if_package + VALUE(e_package) TYPE REF TO if_package EXCEPTIONS object_not_existing unexpected_error @@ -19,9 +19,9 @@ CLASS cl_package_factory DEFINITION PUBLIC. !i_suppress_dialog TYPE abap_bool DEFAULT abap_false !i_suppress_access_permission TYPE abap_bool DEFAULT abap_false EXPORTING - VALUE(e_package) TYPE REF TO if_package + VALUE(e_package) TYPE REF TO if_package CHANGING - c_package_data TYPE any. + c_package_data TYPE any. ENDCLASS. CLASS cl_package_factory IMPLEMENTATION. diff --git a/package.json b/package.json index 99386c0b1..aaa6b91cb 100644 --- a/package.json +++ b/package.json @@ -25,12 +25,12 @@ "devDependencies": { "@abaplint/cli": "^2.113.108", "@abaplint/database-sqlite": "^2.10.24", - "@abaplint/runtime": "^2.10.35", + "@abaplint/runtime": "^2.10.38", "express": "^4.21.2", - "@abaplint/transpiler-cli": "^2.10.35", + "@abaplint/transpiler-cli": "^2.10.38", "globals": "^16.0.0", "abapmerge": "^0.16.6", "c8": "^10.1.3", - "eslint": "^9.23.0" + "eslint": "^9.24.0" } } diff --git a/test/gitea/docker-compose.yml b/test/gitea/docker-compose.yml index af0cc399c..3f30193a9 100644 --- a/test/gitea/docker-compose.yml +++ b/test/gitea/docker-compose.yml @@ -1,5 +1,3 @@ -version: "2" - services: gitea: image: gitea/gitea:1.20.5-rootless diff --git a/test/gitea/package.json b/test/gitea/package.json index 947cde501..1749bf644 100644 --- a/test/gitea/package.json +++ b/test/gitea/package.json @@ -11,7 +11,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.45.3", - "@types/node": "^22.0.2" + "@playwright/test": "^1.51.1", + "@types/node": "^22.14.0" } } diff --git a/test/src/zcl_abapgit_html_viewer_web.clas.abap b/test/src/web/zcl_abapgit_html_viewer_web.clas.abap similarity index 100% rename from test/src/zcl_abapgit_html_viewer_web.clas.abap rename to test/src/web/zcl_abapgit_html_viewer_web.clas.abap diff --git a/test/src/zcl_abapgit_html_viewer_web.clas.xml b/test/src/web/zcl_abapgit_html_viewer_web.clas.xml similarity index 100% rename from test/src/zcl_abapgit_html_viewer_web.clas.xml rename to test/src/web/zcl_abapgit_html_viewer_web.clas.xml diff --git a/test/src/zcl_abapgit_web.clas.abap b/test/src/web/zcl_abapgit_web.clas.abap similarity index 92% rename from test/src/zcl_abapgit_web.clas.abap rename to test/src/web/zcl_abapgit_web.clas.abap index af3906830..7a812e40d 100644 --- a/test/src/zcl_abapgit_web.clas.abap +++ b/test/src/web/zcl_abapgit_web.clas.abap @@ -73,13 +73,24 @@ CLASS zcl_abapgit_web IMPLEMENTATION. METHOD initialize. + DATA lo_environment TYPE REF TO zcl_abapgit_web_environment. + DATA lo_cts_api TYPE REF TO zcl_abapgit_web_cts_api. + + zcl_abapgit_web_inject_fm=>inject( ). + + CREATE OBJECT lo_environment. + zcl_abapgit_injector=>set_environment( lo_environment ). + + CREATE OBJECT lo_cts_api. + zcl_abapgit_injector=>set_cts_api( lo_cts_api ). + CREATE OBJECT go_viewer EXPORTING ii_request = gi_request ii_response = gi_response. - zcl_abapgit_ui_core_injector=>set_html_viewer( go_viewer ). + go_gui = zcl_abapgit_ui_factory=>get_gui( ). ENDMETHOD. diff --git a/test/src/zcl_abapgit_web.clas.xml b/test/src/web/zcl_abapgit_web.clas.xml similarity index 100% rename from test/src/zcl_abapgit_web.clas.xml rename to test/src/web/zcl_abapgit_web.clas.xml diff --git a/test/src/web/zcl_abapgit_web_cts_api.clas.abap b/test/src/web/zcl_abapgit_web_cts_api.clas.abap new file mode 100644 index 000000000..5c524360b --- /dev/null +++ b/test/src/web/zcl_abapgit_web_cts_api.clas.abap @@ -0,0 +1,51 @@ +CLASS zcl_abapgit_web_cts_api DEFINITION PUBLIC. + PUBLIC SECTION. + INTERFACES: + zif_abapgit_cts_api. +ENDCLASS. + +CLASS zcl_abapgit_web_cts_api IMPLEMENTATION. + METHOD zif_abapgit_cts_api~confirm_transport_messages. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~create_transport_entries. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~get_r3tr_obj_for_limu_obj. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~get_transports_for_list. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~get_transport_for_object. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~insert_transport_object. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~is_chrec_possible_for_package. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~list_open_requests_by_user. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~list_r3tr_by_request. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~read. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~read_description. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~read_user. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~validate_transport_request. + RETURN. " todo, implement method + ENDMETHOD. + METHOD zif_abapgit_cts_api~change_transport_type. + RETURN. " todo, implement method + ENDMETHOD. + +ENDCLASS. diff --git a/test/src/web/zcl_abapgit_web_cts_api.clas.xml b/test/src/web/zcl_abapgit_web_cts_api.clas.xml new file mode 100644 index 000000000..118f6249b --- /dev/null +++ b/test/src/web/zcl_abapgit_web_cts_api.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_ABAPGIT_WEB_CTS_API + E + ZCL_ABAPGIT_WEB_CTS_API + 1 + X + X + X + + + + \ No newline at end of file diff --git a/test/src/web/zcl_abapgit_web_environment.clas.abap b/test/src/web/zcl_abapgit_web_environment.clas.abap new file mode 100644 index 000000000..d7d203d6e --- /dev/null +++ b/test/src/web/zcl_abapgit_web_environment.clas.abap @@ -0,0 +1,57 @@ +CLASS zcl_abapgit_web_environment DEFINITION PUBLIC. + PUBLIC SECTION. + INTERFACES zif_abapgit_environment. +ENDCLASS. + +CLASS zcl_abapgit_web_environment IMPLEMENTATION. + + METHOD zif_abapgit_environment~compare_with_inactive. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~init_parallel_processing. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~check_parallel_processing. +* the group doesnt exist + rv_checked = abap_false. + ENDMETHOD. + + METHOD zif_abapgit_environment~get_available_user_sessions. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~get_basis_release. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_merged. + rv_result = abap_false. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_repo_object_changes_allowed. + rv_result = abap_true. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_restart_required. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_sap_cloud_platform. + rv_result = abap_false. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_sap_object_allowed. + rv_allowed = abap_false. + ENDMETHOD. + + METHOD zif_abapgit_environment~get_system_language_filter. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + + METHOD zif_abapgit_environment~is_variant_maintenance. + ASSERT 1 = 'decoupled'. + ENDMETHOD. + +ENDCLASS. diff --git a/test/src/web/zcl_abapgit_web_environment.clas.xml b/test/src/web/zcl_abapgit_web_environment.clas.xml new file mode 100644 index 000000000..456606660 --- /dev/null +++ b/test/src/web/zcl_abapgit_web_environment.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_ABAPGIT_WEB_ENVIRONMENT + E + ZCL_ABAPGIT_WEB_ENVIRONMENT + 1 + X + X + X + + + + \ No newline at end of file diff --git a/test/src/web/zcl_abapgit_web_inject_fm.clas.abap b/test/src/web/zcl_abapgit_web_inject_fm.clas.abap new file mode 100644 index 000000000..60767a6f2 --- /dev/null +++ b/test/src/web/zcl_abapgit_web_inject_fm.clas.abap @@ -0,0 +1,33 @@ +CLASS zcl_abapgit_web_inject_fm DEFINITION PUBLIC. + PUBLIC SECTION. + INTERFACES if_ftd_invocation_answer. + CLASS-METHODS inject. +ENDCLASS. + +CLASS zcl_abapgit_web_inject_fm IMPLEMENTATION. + METHOD if_ftd_invocation_answer~answer. + RETURN. + ENDMETHOD. + + METHOD inject. + + DATA lt_deps TYPE if_function_test_environment=>tt_function_dependencies. + DATA lv_dep LIKE LINE OF lt_deps. + DATA li_env TYPE REF TO if_function_test_environment. + DATA lo_handler TYPE REF TO zcl_abapgit_web_inject_fm. + + + INSERT 'ENQUEUE_EZABAPGIT' INTO TABLE lt_deps. + INSERT 'DEQUEUE_EZABAPGIT' INTO TABLE lt_deps. + INSERT 'SAPGUI_PROGRESS_INDICATOR' INTO TABLE lt_deps. + INSERT 'TR_OBJECT_TABLE' INTO TABLE lt_deps. + li_env = cl_function_test_environment=>create( lt_deps ). + + CREATE OBJECT lo_handler. + LOOP AT lt_deps INTO lv_dep. + li_env->get_double( lv_dep )->configure_call( )->ignore_all_parameters( )->then_answer( lo_handler ). + ENDLOOP. + + ENDMETHOD. + +ENDCLASS. diff --git a/test/src/web/zcl_abapgit_web_inject_fm.clas.xml b/test/src/web/zcl_abapgit_web_inject_fm.clas.xml new file mode 100644 index 000000000..0a80e7d3b --- /dev/null +++ b/test/src/web/zcl_abapgit_web_inject_fm.clas.xml @@ -0,0 +1,16 @@ + + + + + + ZCL_ABAPGIT_WEB_INJECT_FM + E + ZCL_ABAPGIT_WEB_INJECT_FM + 1 + X + X + X + + + + \ No newline at end of file diff --git a/test/src/zcl_abapgit_web_sicf.clas.abap b/test/src/web/zcl_abapgit_web_sicf.clas.abap similarity index 100% rename from test/src/zcl_abapgit_web_sicf.clas.abap rename to test/src/web/zcl_abapgit_web_sicf.clas.abap diff --git a/test/src/zif_abapgit_web_request.intf.abap b/test/src/web/zif_abapgit_web_request.intf.abap similarity index 100% rename from test/src/zif_abapgit_web_request.intf.abap rename to test/src/web/zif_abapgit_web_request.intf.abap diff --git a/test/src/zif_abapgit_web_request.intf.xml b/test/src/web/zif_abapgit_web_request.intf.xml similarity index 100% rename from test/src/zif_abapgit_web_request.intf.xml rename to test/src/web/zif_abapgit_web_request.intf.xml diff --git a/test/src/zif_abapgit_web_response.intf.abap b/test/src/web/zif_abapgit_web_response.intf.abap similarity index 100% rename from test/src/zif_abapgit_web_response.intf.abap rename to test/src/web/zif_abapgit_web_response.intf.abap diff --git a/test/src/zif_abapgit_web_response.intf.xml b/test/src/web/zif_abapgit_web_response.intf.xml similarity index 100% rename from test/src/zif_abapgit_web_response.intf.xml rename to test/src/web/zif_abapgit_web_response.intf.xml