ceylon-sdk icon indicating copy to clipboard operation
ceylon-sdk copied to clipboard

Add tests for ceylon.interop.browser

Open quintesse opened this issue 9 years ago • 7 comments

The browser interop module has no tests, we should try to add some at least so we perhaps could have caught https://github.com/ceylon/ceylon/issues/6473 sooner.

quintesse avatar Sep 07 '16 11:09 quintesse

Yeah, I don't have a single clue on how to do that, the module is 100% dynamic interfaces, so I don't think we can make automated tests. The best solution I can think of right now, is writing a module that calls every dynamic class/interface, and then periodically (and manually) run this module in every major browser to see if there are errors...

bjansen avatar Sep 07 '16 12:09 bjansen

Well we could:

  1. Write a module to run the tests in the browser, complete with the necessary boilerplate HTML
  2. Within the ceylon test tests fire up a http server to serve that page
  3. Use ceylon.process to fire up a browser pointed at the http server

It would be quite a lot of work, but it would make it relatively easy to ensure the tests were run on developer machines.

For extra points we run ceylon test-js from within the browser ;-)

tombentley avatar Sep 07 '16 12:09 tombentley

This is really a whole ceylon test-browser tool, I suppose.

tombentley avatar Sep 07 '16 12:09 tombentley

I've put together a proof of concept for this browser test tool here. I'd be grateful if someone could give it a try and see if it works for them.

tombentley avatar Sep 16 '16 14:09 tombentley

Very cool! This worked for me. The two extra things I had to do:

  • Add firefox to my path, which for me was export PATH=/Users/jvasileff/Applications/Firefox.app/Contents/MacOS:$PATH
  • Compile the subject with ceylon compile-js --source test. Maybe add a .ceylon/config file?

jvasileff avatar Sep 16 '16 14:09 jvasileff

Thanks @jvasileff I've updated the README.md to mention the $PATH, and added the .ceylon/config I was using.

tombentley avatar Sep 16 '16 15:09 tombentley

I added a couple of very simple tests in ec50440 which you can run using the tool I wrote on Friday. I don't propose to add any more until we're figured out better what the tool should look like.

tombentley avatar Sep 19 '16 13:09 tombentley