-
-
Notifications
You must be signed in to change notification settings - Fork 723
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
Test DOMPurify with a Browser grid #61
Comments
That would make sense indeed, research in this area is highly appreciated! Thanks :) |
I know some people at SauceLabs, maybe they can help us with that … EDIT: That really sounds incredible (https://saucelabs.com/opensauce/)
|
Would also be great if the the tests could be refactored so that they can run without a html file, do not require jquery and do not require XHR. The html file would only serve as a runner, but it does not contain any of the tests itself. It would make this script much simpler: https://joris-van-der-wel.github.io/DOMPurify-test-jsdom.js |
I spent some time figuring this out for a different project (using Sauce Labs Open Sauce). I first tried the runner "testem", which is great if you are only testing on your own machine. However the integration with things such as saucelabs is not yet mature. So I switched to the runner karma instead. Karma understands QUnit, however I used it with mocha + browserify myself. You will have to move over the tests to their own javascript file though (instead of that big .html file). It is probably easiest to use browserify for this, so that you will no longer need a XHR request to load that json file: I made two karma configurations, the first one tests with jsdom and then simply waits for you to manually visit a special url. The second one launches a large amount of browsers on saucelabs (with a build id, which gives you a nice status image). I configured a large amount of browsers in my project which is kind a cumbersome to do unless you add a few convenience functions If you launch karma with all those browsers, it will try to test them all at once... So I made a simple grunt script to execute them one by one. The downside of sauce labs is that sometimes a browser will simply fail to launch (even with the built in retrying of karma). This is why some browsers are marked as gray on my package page: https://www.npmjs.com/package/name-overrides-builtin. For some strange reason, iOS browsers almost always fail to launch. I only got those to work a handful number of times. Yes, this post is also plugging my library ;) |
@fxa @Joris-van-der-Wel @fhemberger Hi all! I wasn't following this ticket, what's the status here? |
Sorry, I've been completely out of touch the last couple of weeks. I don't know about any changes. |
I don't have the time to do anything in this direction. i just wanted to submit a suggestion to improve the quality of DOMPurify |
Okay then :) |
Since we don't have any progress here, I would suggest to close this issue. Any objections? |
Why not leave it open as feature todo? Just flag it with a tag "future", "enhancement" or "discussion". |
I have experience in karma testing via BrowserStack's Selenium grid. They usually give away free slots for Open Source. Any objections against TravisCI and BrowserStack? Otherwise I'd just work on it in a fork and give you folks the chance to merge it back in. |
I'm fine with that, we can use either BrowserStack or SourceLabs. Having browser testing would be a huge improvement. |
@tdeekens Perfectly fine with that, thanks! |
@tdeekens Alright, we have BrowserStack access, I connected Travis-CI. Looks like we're set - aside from the credentials to be added. Let's set up the rest tomorrow? |
Awesome. Sure thing. |
I have some remarks about the new testing process:
|
...just saw that you'd at least need some sort of DOM within the node environment. I guess something like |
@tdeekens Yes, we used |
@tdeekens There is one more concern - the local tests don't work yet. I assume it has to do with the environment vars in the karma configuration file:
Any idea what needs to be set / changed to make it work again? |
I am thinking, this might be the problem? https://github.com/cure53/DOMPurify/blob/master/test/karma.conf.js#L22 |
Yeah. Just export the |
Why can it not grab the data from here? https://github.com/cure53/DOMPurify/blob/master/.travis.yml#L10 |
Even so I am not super fond of it but it seems to be the general way to avoid checking in those credentials. You can add team members in your BrowserStack account here. Still you'd need to export your raw username and accesskey not the encrypted one for TravisCI. |
I wonder why we have six entries in the |
I'd suggest to meet up tomorrow and have a look? |
Sure. |
So be it :) |
Sweet, we got the automation plan from BrowserStack and now we have all tests running in eight different browsers: 'bs_win81_ie_11',
'bs_win8_ie_10',
'bs_mavericks_chrome_44',
'bs_yosemite_firefox_40',
'bs_yosemite_safari_8',
'bs_win81_opera_31',
'bs_win7_firefox_12',
'bs_win81_chrome_22'
], Anything that comes to mind we should add as well? |
Good question. I'd say test for the worst (some really old crappy version) and latest (as most of them are evergreen self updating browsers anyway) on Mac and Win. Still, I am no expert on or buggy intermediate versions of browsers are. |
I am also planning to add Android and iOS just in case. We should be able to run on older FF and Chrome as well but I have to test manually first... |
We just have to make sure not to run on Android and iOS emulators for those tests. I had some mobile tests activated for grunt-dactylographsy which turned out to have very long queue times cause devices will be booted etc. Maybe having desktop test run on all commits and mobile as an addition on release commits if that is possible and makes sense. |
...do we wanna close this one? I suggest opening another issue covering running tests against node/iosjs with jsdom. |
Yes, I agree. Similarly for mobile. |
DOMPurify is designed to run in browsers. In ALL browsers. I would like to make some minor changes, but would like to be sure not to break anything. So I would like to have tests in a LOT of browsers in different versions and OSs. Wouldn't it be nice to have tests with a lot of browser/os combinations? There are some vendors, who offer that for free for open source projects like BrowserStack, SauceLabs or BrowserSwarm (I did not evaluate any of them for features or even fitness).
I think, this test support is more important, than my suggesting changes.
Are there any plans to do things like that? If not, I would like to do some research in this area.
The text was updated successfully, but these errors were encountered: