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

Invalid error thrown by browser.goTo #148

Closed nair-sumesh closed 2 years ago

nair-sumesh commented 2 years ago

Describe the bug browser.goTo does not navigate to Shell-home

To Reproduce async iNavigateToHomePage() { await browser.goTo({ sHash: '#Shell-home' }); }

Expected behavior Supposed to Navigate to the shell home (Fiori launchpad page)

Logs/Console Output

[0-0] Error in "test.I reopen app"
Error: Invalid URL: #Shell-home
    at validateUrl (C:\Users\nnnnnn\git\wdi5-testing\node_modules\webdriverio\build\utils\index.js:378:45)
    at Browser.url (C:\Users\nnnnnn\git\wdi5-testing\node_modules\webdriverio\build\commands\browser\url.js:47:52)
    at Browser.wrapCommandFn (C:\Users\nnnnnn\git\wdi5-testing\node_modules\@wdio\utils\build\shim.js:137:38)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at Browser.<anonymous> (C:\Users\nnnnnn\git\wdi5-testing\node_modules\wdio-ui5-service\src\lib\wdioUi5-index.js:483:17)
    at Browser.wrapCommandFn (C:\Users\nnnnnn\git\wdi5-testing\node_modules\@wdio\utils\build\shim.js:137:29)

Runtime Env (please complete the following information):

vobu commented 2 years ago

the command itself is syntactically correct (browser.goTo({ sHash: '#Shell-home' })) might be a problem with your configuration. can you share your wdio.config.(j|t)s-file please? "baseUrl" and the "wdi5" should be sufficient.

nair-sumesh commented 2 years ago
  wdi5: {
    screenshotPath: path.join('wdio-ui5-service', 'test', 'report', 'screenshots'),
    logLevel: 'verbose', // error | verbose | silent
    platform: 'browser', // electron, browser, android, ios
    url: '',
    skipInjectUI5OnStart: true,
    deviceType: 'web',
    waitForUI5Timeout: 15000
  },

...
baseUrl :''

Later in the before() method, I call await browser.url(sURL); where sURL is dynamically generated.

vobu commented 2 years ago

oi, the empty baseUrl is most likely the culprit. Try providing that, please