xhr icon indicating copy to clipboard operation
xhr copied to clipboard

Use a service for running tests in browsers

Open naugtur opened this issue 9 years ago • 8 comments

[edited]

The idea is to find and configure a service for running tests in multiple browsers to monitor browser support automatically.

The trick is, we need the server side for the tests running in the same origin.

See how npm test does it now.

naugtur avatar Jul 10 '15 21:07 naugtur

@Raynos I set up zuul and got saucelab account for opensource, but it seems like I'm missing something. The tests start and then timeout or break. Could you verify if that's also happening for you? I tried starting with different browsers etc. (There are also cross-domain issued in saucelab's IE8 that didn't happen on my VM, but that's for later)

It might be because they don't support making requests outside, but I didn't find it in docs.

I committed the zuul setup https://github.com/Raynos/xhr/tree/zuul-saucelabs It works with regular ~/.zuulrc

naugtur avatar Jul 11 '15 19:07 naugtur

I couldn't get Zuul + Saucelabs to work very well for my projects, but I've had decent luck with Browserstack. See http://joshduff.com/#!/post/2015-08-automated-testing-with-tape-and-browserstack.md

TehShrike avatar Jun 01 '16 03:06 TehShrike

You need to set up access to saucelabs. But the tests may not work currently as they're making requests outside - I'm not sure if saucelabs is allowing that.

naugtur avatar Jun 04 '16 12:06 naugtur

I have a free/open source Saucelabs account, but the test limit was so low that I hit it right away.

TehShrike avatar Jun 04 '16 16:06 TehShrike

But I'd need to run the mock server to test xhr. browserstack runner doesn't allow for that...

naugtur avatar Jul 08 '16 09:07 naugtur

Now that I see BrowserStack claims they support running a mock server. @TehShrike would you mind helping me out with getting this repo configured with BrowserStack and browserstack-tape-reporter?

naugtur avatar Feb 17 '17 21:02 naugtur

I went back and poked at it recently, and browserstack-runner was completely borked for me, thus borking browserstack-tape-reporter :-( I haven't dived into automated browser testing since then, so I don't actually have a good way at hand to pull off testing with BrowserStack.

TehShrike avatar Feb 18 '17 18:02 TehShrike

**EDIT: I probably spoke too soon, just noticed https://github.com/naugtur/xhr#mocking-requests Doesn't yet make everything easy, but I see how this it's not this library's "fault" :)

I think it would be completely fine if your library would work with https://www.npmjs.com/package/xhr-mock (I haven't dig deep into this, but it seems that you cache the object, so by the time I want to replace it, it's already too late)

ashnur avatar Aug 01 '18 09:08 ashnur