-
Notifications
You must be signed in to change notification settings - Fork 5
Integrate privly-applications selenium tests #20
Comments
@smcgregor Presently, the safari tests run locally and on SauceLabs without the extension. |
@smcgregor The PR regarding running the tests locally on Safari with the extension is privly/privly-applications#260 |
I think Apple may have removed the ability to programmatically install extensions via Selenium for security reasons. I recommend starting with locally testing the browser extension by pre-installing it to Safari. This will mean you can test the extension from Selenium without installing it from Selenium. Testing on SauceLabs will be trickier, but let's get local testing running before we starting thinking about that. |
@smcgregor I have found https://code.google.com/p/selenium/wiki/RubyBindings#Safari . Though I am not completely sure if this will work, I am currently trying to make this work. |
@smcgregor Presently, when I install the extension in Safari, I need to know the base URL of the safari extension in order for the tests to run. But, we do not currently get the first run page to know the URL of the extension. What do you think about this? |
The problem on Chrome is that the URL can cryptographically change depending on whose system they are running their development version on. Is this the case on Safari? Why can't you hard-code the address? |
@smcgregor The safari extension have a URL such as |
Ah, ok. I think you should create a version of this file. You will need to add a first-run page for it to work. It basically waits for an extension context page to open then grabs the URL from the page. |
@smcgregor Yes, I have tried creating this file but the first-run page on Safari does not load up for tests as the extension is already previously installed. |
Good point. Another option would be to initiate the posting process and to grab the resulting window's URL. |
@smcgregor I will open a new PR in the privly-safari repo to support sending a message to the extension and getting back the extension base URL as a response. |
Getting the URL from the posting process is an option but getting the URL from the extension sendMessage itself is an easier and a safer option. |
@smcgregor Can you explain how to initiate the posting process presently? |
You could do this when you add the posting button to safari by clicking the
button when it appears on the website. For now, I recommend either hard
coding the url or setting it as an environmental variable.
|
@smcgregor I have now got the extension URL from the injected application of privly's test page. The commit can be seen at sambuddhabasu/privly-applications@dc8e886 |
The selenium tests found in privly-applications test all the core functionality of the system and will quickly tell you if there is an issue integrating privly-applications with privly-safari. These tests should be supported by the Safari browser's extension context and/or by the Safari web (hosted) context.
Steps:
ruby run_all.rb --platform safari_web --release-status experimental --content-server http://localhost:3000
For the tests to pass you will need a local content server running on port 3000. You do not need the tests to pass to see that you have configured testing correctly.I recommend getting this working for safari_web before attempting to test safari_extension.
Completing these steps for TravisCI and SauceLabs will likely be more complicated since it would require somehow installing the safari extension on SauceLabs. This works for the Firefox extension by adding it to the browser's profile from Travis, and it works for the Chrome extension by base64 encoding the extension and streaming it to SauceLabs. One of these approaches will likely work for Safari as well, but the first step is to get these tests running locally without SauceLabs and TravisCI.
The text was updated successfully, but these errors were encountered: