-
Notifications
You must be signed in to change notification settings - Fork 15
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
Use the Safari 10 WebDriver to run tests #22
base: master
Are you sure you want to change the base?
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
690fe97
to
c8ce913
Compare
To make it possible to test both old and new safari versions could you keep the current one as a legacy launcher? similiar to how the chrome-launcher exposes multiple different launchers |
I think I understand how that works in the chrome-launcher; so I can give that a try. Do you have any suggestions for names? The reason why I ask is that in the chrome-launcher it truly launches different applications. Yet it this instance it's really launching different versions of the same browser. Technically the "legacy" version covers all versions of Safari that the new one does while the new one only covers Safari 10 and newer. Suggestions:
|
I think Safari and SafariLegacy are pretty good |
…lution). Merge branch 'safari-webdriver' into develop * safari-webdriver: Use the Safari 10 WebDriver to run tests # Conflicts: # index.js # package.json
9f6c4e4
to
ffcd936
Compare
26a9695
to
2623b3e
Compare
For all the reasons addressed in a WebKit blog post, https://webkit.org/blog/6901/webdriver-support-in-safari-10/, this method should be preferred over the previous method.
2623b3e
to
1c02e73
Compare
@dignifiedquire better late than never right? 😏 I've incorporated the feedback. There are now two exported launchers Safari and SafariLegacy. |
When I tried to use this branch with macOS Mojave 10.14 and Safari 12.0, Karma threw the following error.
SeleniumHQ/selenium#6026 (comment) is the reason why it stopped working:
We should pass |
The biggest problem is that is not a backwards compatible solution. We cannot globally just pass Not thrilled with that. Better yet would be to update the wd library to support W3C or to use a new library all-together that supports W3C. |
Update to a pre-release version of WD to add suppor for the W3C WebDriver protocol. This means that it supports Safari 10-12 with the same configuration.
e6e8aac
to
5b77a2f
Compare
One concern with using safaridriver is that the window is not interactive so you cannot click Debug, open the inspector etc. That may sometimes be necessary so I wonder if we should support running new Safari the old way as well (not as a default)? For example, jQuery's Karma setup requires clicking Debug to actually run the tests. |
This change does just that. The old way is now called
It is still possible in the new one. I have personally made use of "breaking the glass pane" over the automation window as discussed in the WebKit.org article: WebDriver Support in Safari 10. Granted it is a bit more clicking and as I recall required me to use some |
@dignifiedquire can you merge this PR? |
Hey @RLovelett, Some further info in case you need it: I used I get the following error:
I used As far as I understand webdriver support is not enabled by default but I don't know how to set it programatically. I also think this should be set by karma-safari-launcher (if it's possible). Or am I missing something? |
@gergo-papp this is the relevant part of the error message:
That seems to indicate that you have not configured Safari to enable support for the web driver. There are a few articles out there: Testing with WebDriver in Safari: Configure Safari to Enable WebDriver Support and WebDriver Support in Safari 10. The steps are different depending on the version of Safari you have but on the latest versions it is effectively just Hopefully that helps. |
@RLovelett thanks for the response. In this case I’m happy with this change. Is this repo still maintained? I haven’t seen too much activity |
That is a good question. I think so but I could be wrong. |
Can somebody please merge this and get it out on NPM ASAP? |
@dignifiedquire Any chance of merging this? |
@dignifiedquire Could you merge the PR? |
69c5103
to
a1407ee
Compare
FYI: I've published @onslip/karma-safari-launcher from https://github.com/Onslip/karma-safari-launcher/tree/onslip. |
So I've been using the code from this PR for a while now and it runs fine. https://gist.github.com/taymoork2/8eb2be290579467f0d0090671e031ca8 |
Seconding @mgol requests... @dignifiedquire Could you merge the PR, please? |
Any volunteers to maintain this repo? |
I mean, I'd be happy to merge and publish this if I have access to the npm package. I'd prefer to share this with @mgol if he's +1 and has the bandwidth, considering the work he's done at the jQuery foundation. |
I'm not able to commit to a timely feedback to issues but at least looking at available PRs and an occasional publish should be fine, especially if shared with you, @leobalter. |
FYI again: We've switched to |
For all the reasons addressed in a WebKit blog post, https://webkit.org/blog/6901/webdriver-support-in-safari-10/, this method should be preferred over the previous method.
How does this work?
/usr/bin/safaridriver
on a specified port (defaults to4444
).safaridriver
until it starts accepting incoming connections.Caveats
By going this route the launcher named
Safari
now only supports Safari 10 on OS X El Capitan and newer.SafariLegacy
works as it currently does.Notes
I'm not thrilled with the retry method. It just does not feel right. Though I'm not sure how else to know when the
safaridriver
is fully launched and accepting incoming connections.This should address the concerns of both #6 and #20.