on 2022 Oct 06 8:10 PM
Hi colleagues,
I am developing fiori elements with odata v4. The fiori tooling generator creates nice test pages and the sap-fe-mockserver is much better then the old mockserver.
However when it comes to karma testing (local and in pipeline). I am a little bit lost.
Using karma-ui5 causes some problems.
The ui5.configPath ui5-local.yaml is not loading/mounting the sap-ui-core and more correctly. Karma server uses ./base/webapp/resources while fiori-tools-proxy listens to ./resources. I could add ../../../../ to all references but this looks weird. See https://answers.sap.com/questions/13665378/ui5-karma-config-404-on-ui5-resource-load.html
Does someone has a working example that uses own yaml with fiori-tools-proxy and sap-fe-mockserver?
Greetings and thanks,
Daniel
Well, after a night of try & error I found a solution that works for me.
in karma.conf.js I set the configPath to my own yaml especially for karma setup. Additionally I tweak a little bit to get my stuff covered by coverage reporter.
The ui5-karma.yaml:
Here it seems to be very important to listen to /base/... . So I do not need to adjust all sapui5 core in the html's references to ../../../../. I can just keep it as it is.
Finally it seems that own shortened resource roots are causing trouble and I did not want to face it yet. So I took the same resource root alias as in the main application. Typically the generator create a opa templat with a shortened one.
This setup runs OPA and QUnit
It also runs locally and on jenkins. We are using our own jenkins pipeline and trigger karma with this step
https://www.project-piper.io/steps/karmaExecuteTests/
Greetings,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
10 | |
10 | |
10 | |
9 | |
8 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.