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

Adding a global default timeout for all wait functions. #82

Closed
wants to merge 1 commit into from

Conversation

mengchen2
Copy link

@mengchen2 mengchen2 commented Nov 15, 2018

This PR is Addressing Issue #81.
Adding nemo.view.defaultTimeout as a new name space for Nemo-view.

Usage:
Add global waitTimeout on config.json:

  "plugins": {
    "view": {
      "module": "nemo-view",
      "arguments": [ "path:../../node_modules/gctnightswatchnodeweb/locator", 30000]
    },

If no timeout value provided to the plugin arguments, Nemo-view will use the fallback timeout, which is 5000. Just like before

  "plugins": {
    "view": {
      "module": "nemo-view",
      "arguments": [ "path:../../node_modules/gctnightswatchnodeweb/locator"]
    },

Another way to use it, set timeout for the case:
nemo.view.defaultTimeout = 60000;

Copy link
Member

@grawk grawk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please don't add another property to nemo.view (see more detailed comment)
  2. would need to add this new argument to the README
  3. please add a CHANGELOG entry

var callback = util.once(_callback);

//add view namespace
nemo.view = {};
nemo.view.defaultTimeout = defaultTimeout;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, please pass the defaultTimeout as a parameter to the view class. Adding it to the nemo.view namespace may potentially collide with a user defined view.

@grawk
Copy link
Member

grawk commented Nov 15, 2018

Thanks @mengchen2 .. I had started working on this over the weekend but it's only a local working copy. It differs from yours in terms of passing the timeout value as a parameter to the "locreator" class. I would recommend that approach.

@grawk grawk closed this Nov 11, 2021
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

Successfully merging this pull request may close these issues.

2 participants