{"action":"created","issue":{"url":"https://api.github.com/repos/xolvio/chimp/issues/481","repository_url":"https://api.github.com/repos/xolvio/chimp","labels_url":"https://api.github.com/repos/xolvio/chimp/issues/481/labels{/name}","comments_url":"https://api.github.com/repos/xolvio/chimp/issues/481/comments","events_url":"https://api.github.com/repos/xolvio/chimp/issues/481/events","html_url":"https://github.com/xolvio/chimp/issues/481","id":179039321,"number":481,"title":"browser.url() and browser.getUrl() returns promise in synchronous mode","user":{"login":"sergeyt","id":190322,"avatar_url":"https://avatars.githubusercontent.com/u/190322?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyt","html_url":"https://github.com/sergeyt","followers_url":"https://api.github.com/users/sergeyt/followers","following_url":"https://api.github.com/users/sergeyt/following{/other_user}","gists_url":"https://api.github.com/users/sergeyt/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyt/subscriptions","organizations_url":"https://api.github.com/users/sergeyt/orgs","repos_url":"https://api.github.com/users/sergeyt/repos","events_url":"https://api.github.com/users/sergeyt/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-24T16:44:30Z","updated_at":"2016-09-24T18:10:28Z","closed_at":null,"body":"# The problem\r\n\r\nbrowser.url() returns promise while I expect to get string synchronously. Calling browser.url(\"https://localhost:8000/\") works synchronously. I think this is not consistent behavior. Maybe the problem is that these methods are not wrapped correctly in https://github.com/xolvio/sync-webdriverio.\r\n\r\n# Environment\r\n\r\n* chimp version: 0.41.1\r\n* WebdriverIO version: 4.2.16\r\n* Node.js version: 6.5.0\r\n\r\nsee https://github.com/webdriverio/webdriverio/issues/1610\r\n"},"comment":{"url":"https://api.github.com/repos/xolvio/chimp/issues/comments/249379092","html_url":"https://github.com/xolvio/chimp/issues/481#issuecomment-249379092","issue_url":"https://api.github.com/repos/xolvio/chimp/issues/481","id":249379092,"user":{"login":"sergeyt","id":190322,"avatar_url":"https://avatars.githubusercontent.com/u/190322?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyt","html_url":"https://github.com/sergeyt","followers_url":"https://api.github.com/users/sergeyt/followers","following_url":"https://api.github.com/users/sergeyt/following{/other_user}","gists_url":"https://api.github.com/users/sergeyt/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyt/subscriptions","organizations_url":"https://api.github.com/users/sergeyt/orgs","repos_url":"https://api.github.com/users/sergeyt/repos","events_url":"https://api.github.com/users/sergeyt/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyt/received_events","type":"User","site_admin":false},"created_at":"2016-09-24T18:10:28Z","updated_at":"2016-09-24T18:10:28Z","body":"Found a workaround, code:\r\n\r\n```js\r\nlet hacked = false;\r\n\r\n// hacky way to get current url\r\nexport function getUrl() {\r\n  if (!hacked) {\r\n    browser.addCommand(\"getUrlAndTitle\", function () {\r\n      return {\r\n        url: this.getUrl(),\r\n        title: this.getTitle(),\r\n      };\r\n    });\r\n    hacked = true;\r\n  }\r\n  const result = (browser as any).getUrlAndTitle();\r\n  return result.url;\r\n}\r\n```\r\n"}}
{"actor":{"display_login":"sergeyt"}}