ui5-community / wdi5

official UI5 end-to-end test framework for UI5 web-apps. wdi5 = Webdriver.IO + UI5 Test API
https://ui5-community.github.io/wdi5/
Apache License 2.0
102 stars 43 forks source link

Running wdi5 on local webserver (not ui5 serve) #450

Closed henloh closed 1 year ago

henloh commented 1 year ago

Describe the bug When running the wdi5 command against a local webserver that is not from ui5 serve the ui5 app is not loading at all.

To Reproduce Run the ui5 app using a local webserver like express and try to execute your test.

Expected behavior The apps load fine in any browser, any version but as seen in the network tab the webdriver "gives up too early" and the site just isnt loading fully.

Logs/Console Output [0-0] [wdi5] call of _getControl() failed because of: Error: No DOM element found using the control selector {"controlType":"sap.m.Page","id":"pHome","viewName":"[VIEWNAME]"} [0-0] [wdi5] error retrieving control: pHomemyAppsMontagePrio.view.Homesap.m.Page [0-0] TypeError in "Page status.check pagetitle"

Waterfall on ui5 serve image

Waterfall on any other webserver image

Runtime Env (please complete the following information): devDependencies: "@openui5/ts-types-esm": "latest", "@sap-ux/ui5-middleware-fe-mockserver": "^2.1.74", "@sapui5/ts-types-esm": "latest", "@types/mocha": "^10.0.1", "@ui5/cli": "^3.0.0", "@wdio/cli": "^7.30.1", "@wdio/local-runner": "^7.30.1", "@wdio/mocha-framework": "^7.26.0", "@wdio/spec-reporter": "^7.29.1", "chromedriver": "latest", "marky": "^1.2.5", "ts-node": "^10.9.1", "typescript": "^5.0.3", "wdio-chromedriver-service": "^7.3.2", "wdio-ui5-service": "latest"

Additional context When running the test with the same app on ui5 serve everything executes fine.

Is there a way i can use any local webserver?

vobu commented 1 year ago

we're explicitly testing wdi5 with a regular webserver other than ui5 serve: https://github.com/ui5-community/wdi5/blob/f45a5b67415caab902de3883fedc132908c9b7bc/examples/ui5-js-app/package.json#L16

my guess is that you're bootstrapping your app via the local npm modules src="resources/sap-ui-core.js", so only the ui5 tooling can resolve that depency. when you change the bootstrap to the CDN (src="https://ui5.sap.com/resources/sap-ui-core.js"), any webserver will be able to deliver your app.

henloh commented 1 year ago

thank you for the quick response. sadly none of it was the problem. the basic_auth isnt working but that has to be an error of the server becasue i set the env variables and the wdi5:authentication. sorry for the expense

kind regards

vobu commented 1 year ago

right on. happy easter! 🐰