Comments (15)
@smcgregor Presently, the safari tests run locally and on SauceLabs without the extension.
The next thing I am targeting is to run the selenium tests locally with the extension. I will have to implement a function configure_for_safari_extension
but I am not completely sure how to go about it. Can you link me to some documentation or some existing examples which help me do the same?
Thanks
from privly-safari.
@smcgregor The PR regarding running the tests locally on Safari with the extension is privly/privly-applications#260
from privly-safari.
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.
from privly-safari.
@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.
I will also try as you mentioned, to first install the extension and then run the Selenium tests.
from privly-safari.
@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?
from privly-safari.
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?
from privly-safari.
@smcgregor The safari extension have a URL such as safari-extension://com.privly.privly-34B3M269R6/32c12845/
. The last 8 characters are alpha-numeric characters which change every time the extension is loaded. Hence, the extension URL cannot be hard-coded.
One way to get the extension URL without going through the first-run page, is to send a message to the extension using the JS console and getting the extension base URL as a response. This way, once we know the extension base URL, we can then set that URL as the base URL for all the selenium tests.
What do you think about this?
from privly-safari.
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.
from privly-safari.
@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.
I am planning to send a message from the test to the extension and getting the extension base URL as the response.
from privly-safari.
Good point. Another option would be to initiate the posting process and to grab the resulting window's URL.
from privly-safari.
@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.
from privly-safari.
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.
from privly-safari.
@smcgregor Can you explain how to initiate the posting process presently?
from privly-safari.
from privly-safari.
@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
Let me know what you think about this.
from privly-safari.
Related Issues (12)
- Add Secure Environmental Variables for privly/privly-safari
- gmail for Safari fails HOT 1
- Indicate when the extension is on/off HOT 1
- Add Toggle Button for Mode
- Don't inject applications when CSP conflicts HOT 8
- Port privly.js to Safari
- Package Safari Extension HOT 22
- Tooltip Positioning Test Fails
- Needs Maintainer HOT 3
- Update Readme HOT 1
- Integrate Karma Test Runner HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from privly-safari.