{"action":"created","issue":{"url":"https://api.github.com/repos/sclevine/agouti/issues/107","repository_url":"https://api.github.com/repos/sclevine/agouti","labels_url":"https://api.github.com/repos/sclevine/agouti/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/sclevine/agouti/issues/107/comments","events_url":"https://api.github.com/repos/sclevine/agouti/issues/107/events","html_url":"https://github.com/sclevine/agouti/pull/107","id":234967477,"number":107,"title":"Add ChromeOptions to allow passing args to Chrome through ChromeDriver","user":{"login":"folbricht","id":3505107,"avatar_url":"https://avatars1.githubusercontent.com/u/3505107?v=3","gravatar_id":"","url":"https://api.github.com/users/folbricht","html_url":"https://github.com/folbricht","followers_url":"https://api.github.com/users/folbricht/followers","following_url":"https://api.github.com/users/folbricht/following{/other_user}","gists_url":"https://api.github.com/users/folbricht/gists{/gist_id}","starred_url":"https://api.github.com/users/folbricht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folbricht/subscriptions","organizations_url":"https://api.github.com/users/folbricht/orgs","repos_url":"https://api.github.com/users/folbricht/repos","events_url":"https://api.github.com/users/folbricht/events{/privacy}","received_events_url":"https://api.github.com/users/folbricht/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-10T00:44:17Z","updated_at":"2017-06-15T02:58:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sclevine/agouti/pulls/107","html_url":"https://github.com/sclevine/agouti/pull/107","diff_url":"https://github.com/sclevine/agouti/pull/107.diff","patch_url":"https://github.com/sclevine/agouti/pull/107.patch"},"body":"ChromeOptions can be used to pass additional options to Chrome. In the example below the new `--headless` option. See https://sites.google.com/a/chromium.org/chromedriver/capabilities for all available options. The code would look like:\r\n\r\n```go\r\n\tcapabilities := agouti.NewCapabilities().Browser(\"chrome\").ChromeOptions(\"args\", \"--headless\")\r\n\twd := agouti.ChromeDriver(agouti.Desired(capabilities))\r\n\tif err := wd.Start(); err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tdefer wd.Stop()\r\n\tp, err := wd.NewPage()\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tif err = p.Navigate(\"https://www.google.com\"); err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n```\r\n\r\nI realize it's not strictly necessary, and very Chrome specific. But it's convenient and similar to how other bindings deal with these options. I'm open to suggestions of cleaner ways to implement this."},"comment":{"url":"https://api.github.com/repos/sclevine/agouti/issues/comments/308614801","html_url":"https://github.com/sclevine/agouti/pull/107#issuecomment-308614801","issue_url":"https://api.github.com/repos/sclevine/agouti/issues/107","id":308614801,"user":{"login":"sclevine","id":1848837,"avatar_url":"https://avatars0.githubusercontent.com/u/1848837?v=3","gravatar_id":"","url":"https://api.github.com/users/sclevine","html_url":"https://github.com/sclevine","followers_url":"https://api.github.com/users/sclevine/followers","following_url":"https://api.github.com/users/sclevine/following{/other_user}","gists_url":"https://api.github.com/users/sclevine/gists{/gist_id}","starred_url":"https://api.github.com/users/sclevine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sclevine/subscriptions","organizations_url":"https://api.github.com/users/sclevine/orgs","repos_url":"https://api.github.com/users/sclevine/repos","events_url":"https://api.github.com/users/sclevine/events{/privacy}","received_events_url":"https://api.github.com/users/sclevine/received_events","type":"User","site_admin":false},"created_at":"2017-06-15T02:58:13Z","updated_at":"2017-06-15T02:58:13Z","body":"Sorry for the delay. I like the idea, but I don't like adding browser-specific features directly to the `Capabilities` object. Instead, let's create another `Option` called `ChromeOptions` that gets merged into `Capabilities` when `Option`s are parsed.\r\n\r\nHere's an example for the `agouti.Browser` `Option`: https://github.com/sclevine/agouti/blob/master/options.go#L73\r\n\r\nThis will give us a cleaner separation between the WebDriver API and browser-specific functionality. And it's even more convenient -- your example wouldn't require creating a `Capabilities` map at all!\r\n\r\nFinally, this will need tests before it's merged."}}
{"actor":{"display_login":"sclevine"}}