open-ux-tools icon indicating copy to clipboard operation
open-ux-tools copied to clipboard

Feat(preview middleware) generate testsuite for all configured test frameworks

Open heimwege opened this issue 3 months ago • 2 comments

In case at least one test framework has been configured via test configuration option the framework Testsuite can be used to generate a qunit testsuite (data-sap-ui-testsuite) that includes all configured test frameworks as separate test pages. A test runner (e.g. karma or ui5-test-runner) can use this testsuite to run all the tests.

defaults:

  • path: '/test/testsuite.qunit.html'
  • init: '/test/testsuite.qunit.js'

note:

  • configuration option pattern is n.a. as all configured test frameworks will be taken into account

sample:

server:
  customMiddleware:
  - name: preview-middleware
    afterMiddleware: compression
    configuration:
      test:
        - framework: QUnit
        - framework: OPA5
        - framework: Testsuite

This will create /test/testsuite.qunit.html that includes a script tag to /test/testsuite.qunit.js that adds a test page for the qunit as well as opa5 tests to the testsuite.

Note to future me: This might one day collide with resources/sap/ui/test/starter/createSuite.js (sample see https://github.com/SAP/openui5/blob/master/src/sap.f/test/sap/f/qunit/testsuite.qunit.html; details see https://github.com/SAP/ui5-typescript/issues/310) but for now it works pretty well and is also in sync with the openui5 tutorial

heimwege avatar Apr 02 '24 09:04 heimwege