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

Q: Where does 'browser script timeout set to 16000' comes from #551

Closed nair-sumesh closed 10 months ago

nair-sumesh commented 1 year ago

Describe the bug How to overwrite the timeout in wdi5.

I tried several ways like below

browser.asControl({
      selector: {
        id: "",
      },
      timeout: 90000,
      forceSelect: true,
    });

in config as

  wdi5: {
   ....
    waitForUI5Timeout: 270000
  },
...
  waitforTimeout: 270000,
...
  cucumberOpts: {
 ...
    // <number> timeout for step definitions
    timeout: process.env.DEBUG === 'true' ? 999999 : 270000,

  },

Expected behavior Should be able to set timeout out from the config file.

vobu commented 1 year ago

what you're asking in the subject of this is in https://github.com/ui5-community/wdi5/blob/9d6cff1af0a922eca5c1ef01ab4a197a5de58808/src/lib/wdi5-bridge.ts#L123

so wdi5.waitForUI5Timeout and wdio's script timeout are aligned.

there is no timeout option in the browser.asControl-selector: https://github.com/ui5-community/wdi5/blob/9d6cff1af0a922eca5c1ef01ab4a197a5de58808/src/types/wdi5.types.ts#L186

nair-sumesh commented 1 year ago

as per the calculation for

const timeout = waitForUI5Timeout + 1000 

the timeout should be 271000. However, I see the console log with timeout set to 16000.

The issue is in the code below image

The config.wdi5 is undefined at runtime. And hence, it always default the value with 15000.

This needs to be fixed.

nair-sumesh commented 1 year ago

TEMPORARY SOLUTION

https://github.com/ui5-community/wdi5/blob/9d6cff1af0a922eca5c1ef01ab4a197a5de58808/examples/ui5-js-app/webapp/test/e2e/ui5-late.test.js#L3-L4

const ui5Service = new _ui5Service(undefined,undefined,{wdi5:{waitForUI5Timeout:270000}});
vobu commented 1 year ago

ahhh, this means that programmatic instantiation of the ui5 service (aka wdi5 core) doesn't pull any existing config per default! we could change this and make the constructor pull the config that was provided for starting wdi5 when late-injected. Think this makes sense and you wanna give it a shot, @nair-sumesh 😸 ?

nair-sumesh commented 1 year ago

While I debugged , I couldn't find the config data. The browserInstance does have few config properties but not the specific wdi5 one.

Is the config already being persisted in any global variable?

github-actions[bot] commented 11 months ago

hey 👋 - silence for 30 days 🤐 ... anybody? 😀

vobu commented 10 months ago

fixed with https://github.com/ui5-community/wdi5/pull/552

paritagandhi commented 4 months ago

I am migrating from WDI5 1-> 2 . How can I now access waitforTimeout? Previously, I used browser.config.waitforTimeout and now it just says TypeError: Cannot read properties of undefined (reading 'waitforTimeout')

vobu commented 4 months ago

here's the migration guide: https://ui5-community.github.io/wdi5/#/migration?id=from-1-to-2 this is where all the config lives: https://ui5-community.github.io/wdi5/#/configuration and programmatically, there's