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

TypeError: browser.asControl is not a function #632

Open woshihehao opened 4 weeks ago

woshihehao commented 4 weeks ago

I am trying out wdi5 and it works fine on my local system but when I execute the tests in AZure pipeline, I get the below error: image I have added below in wdi.conf.js:

image

I am using pageObjects, and I use below way to get UI5 controls:

image

In pipeline console log, I also see below error for every control: TypeError: browser.asControl is not a function. In package.json, I have below devdependencies among others:

image

All works fine locally but in AZure pipeline wdi5 tests break. Could colleagues help here?

woshihehao commented 4 weeks ago

Here is my wdi5 test repo: https://github.tools.sap/SelfBilling/e2e-tests-webdriverio Is there a website for raising WDI5 issues within SAP? Such as 'https://github.tools.sap/deploy-with-confidence/issues'.

Siolto commented 2 weeks ago

Hi @woshihehao,

it looks like you are using saucelabs in your pipeline and you have a dedicated saucelabs.conf.js. Do you have configured wdi5 there as well?

Also have a look at the documentation and code snippets of wdi5. You are using a combination of deprecated configuration url and unnecessary operations:

*** unnecessary operation ***
const tile = await browser.asControl({...})
const tileElement = await tile.getWebElement()
await tileElement.click

*** wdi5 native press ***
await browser.asControl({...}).press()