Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nair-sumesh opened this issue Oct 11, 2023 · 9 comments
Closed

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

nair-sumesh opened this issue Oct 11, 2023 · 9 comments

Comments

@nair-sumesh
Copy link
Contributor

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.

  • wdi5/wdio-ui5-service-version: 2.0.2
  • UI5 version: [1.119.0]
  • wdio-version (output of wdio --version): 8.16.12
  • node-version (output of node --version): v18.16.1
  • OS:macOS 13.5.2
  • Browser + Version : Chrome version 117.0.5938.92
@vobu
Copy link
Contributor

vobu commented Oct 11, 2023

what you're asking in the subject of this is in

const timeout = waitForUI5Timeout + 1000

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

there is no timeout option in the browser.asControl-selector:

export interface wdi5Selector {

@nair-sumesh
Copy link
Contributor Author

nair-sumesh commented Oct 11, 2023

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
Copy link
Contributor Author

nair-sumesh commented Oct 11, 2023

TEMPORARY SOLUTION

const ui5Service = new _ui5Service()

const ui5Service = new _ui5Service(undefined,undefined,{wdi5:{waitForUI5Timeout:270000}});

@vobu
Copy link
Contributor

vobu commented Oct 12, 2023

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
Copy link
Contributor Author

nair-sumesh commented Oct 12, 2023

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?

Copy link

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

@github-actions github-actions bot added the stale label Nov 12, 2023
@vobu vobu removed the stale label Nov 13, 2023
@vobu
Copy link
Contributor

vobu commented Dec 13, 2023

fixed with #552

@vobu vobu closed this as completed Dec 13, 2023
@paritagandhi
Copy link

paritagandhi commented May 27, 2024

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
Copy link
Contributor

vobu commented May 27, 2024

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

  • browser.options
  • and as a last resort: global.__wdi5Config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants