sclevine / agouti

A WebDriver client and acceptance testing library for Go
MIT License
821 stars 103 forks source link

Allow to join page with custom HTTP client #153

Closed borodiychuk closed 6 years ago

borodiychuk commented 6 years ago

It was possible to create a new page with custom HTTP client using agouti.NewPage, but was unable to join a running webdriver session with custom HTTP client: agouti.JoinPage did not offer a way to do that.

In order not to break an existing API, this PR introduces a new method to join the running session using custom HTTP client.

sclevine commented 6 years ago

I think we can make this change to JoinPage without breaking the API (for the vast majority of usages, at least). Just add options ...Option as the final argument in the method signature. This method isn't defined on a type, so we won't break any interfaces. Someone could have theoretically stored a pointer to the JoinPage method with the previous signature, but that seems rather unlikely.

See NewPage for an example.

sclevine commented 6 years ago

Looks great! Thanks for contributing!