{"action":"opened","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1007","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1007/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1007/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1007/events","html_url":"https://github.com/webdriverio/webdriverio/issues/1007","id":125832736,"number":1007,"title":"Something like \"wait\" option to limit number of custom commands","user":{"login":"monolithed","id":803674,"avatar_url":"https://avatars.githubusercontent.com/u/803674?v=3","gravatar_id":"","url":"https://api.github.com/users/monolithed","html_url":"https://github.com/monolithed","followers_url":"https://api.github.com/users/monolithed/followers","following_url":"https://api.github.com/users/monolithed/following{/other_user}","gists_url":"https://api.github.com/users/monolithed/gists{/gist_id}","starred_url":"https://api.github.com/users/monolithed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monolithed/subscriptions","organizations_url":"https://api.github.com/users/monolithed/orgs","repos_url":"https://api.github.com/users/monolithed/repos","events_url":"https://api.github.com/users/monolithed/events{/privacy}","received_events_url":"https://api.github.com/users/monolithed/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-10T17:10:56Z","updated_at":"2016-01-10T17:10:56Z","closed_at":null,"body":"In my typical single-page application I don't like to use `waitForExist` everywhere.\r\nAnd I think we should discuss what we can do.\r\n\r\n### Classic way\r\n\r\n```js\r\nlet button = '.button';\r\n\r\nyield browser\r\n\t.url('/user')\r\n\t.waitForExist(button)\r\n\t.click(button);\r\n        ...\r\n```\r\n\r\n### Alternative way\r\n\r\n```js\r\nyield browser\r\n\t.url('/user')\r\n\t.tap('.button');\r\n        ...\r\n```\r\n\r\n```js\r\nbrowser.addCommand('tap', function (selector) {\r\n\treturn this.waitForExist(...arguments).click(selector);\r\n});\r\n```\r\n\r\nOr it can be a wrapper around `url` like:\r\n\r\n```js\r\nyield browser\r\n\t.open('/user')\r\n\t.click('.button');\r\n        ...\r\n```\r\n\r\n```js\r\nbrowser.addCommand('open', function (url, ...options) {\r\n\treturn this.url(url).waitForExist('.GLOBAL_INDICATOR', ...options);\r\n});\r\n```\r\n\r\nI think it would be a useful feature, but I don't know to implement it. \r\nThere'a a couple of questions:\r\n— How to configure?\r\n— How to implement?\r\n— What about performance?\r\n\r\n\r\nConfig?\r\n\r\n```\r\n{\r\n    wait () {\r\n            return this.waitForExist('.foo');\r\n    }\r\n}\r\n```\r\n\r\nI don't think so, because of context\r\nAny ideas?\r\n\r\n\r\n"}}