nathanboktae / mocha-phantomjs

:coffee: :ghost: Run client-side mocha tests in the command line through phantomjs
MIT License
954 stars 112 forks source link

will it support slimerjs in docker container(ubuntu) #254

Closed vercha closed 7 years ago

vercha commented 7 years ago

On windows, run test with slimerjs(0.10.3)+firefox(50.1.0) +mocha-phantom-js, it will output the expected result; On docker container(Ubuntu): I try same steps, but there is no output and no errors;

I try to use xvfb-run slimerjs test/test.js, but also no output.

I wonder: will mocha-phantomjs-core support slimerjs in a docker container? Thanks!

nathanboktae commented 7 years ago

It doesn't support it, firefox + xvbf does that support. Remember mocha-phantomjs-core runs within whatever phantomjs-like environment and that environment does the headless graphics rendering. (Also this issue should have been opened against mocha-phantomjs-core)

This is the same environment as travis - see this build. Note slimerjs is failing tests (see nathanboktae/mocha-phantomjs-core#25) but I'll have to try that combination you're using.

vercha commented 7 years ago

Yes,solved by using xvbf. and mocha-phantomjs-core support the latest slimerjs well. Thank you! By the way, have you tried any docker IE test? I‘v tried winetricks on my linux machine ,it can run ie8, but I'm disappointed that ie8 can't be installed by winetricks(cause X server & $DISPLAY problems).

TrifleJS seems to be a promising solution, but I it failed to run on Windows machine. Thanks for any advice!

nathanboktae commented 7 years ago

docker ie Not possible. Docker virtualizes the Linux kernel and IE is Windows only often relying on the latest or even private APIs.

If you need to do cross browser testing you should use Karma or hosted testing like SauceLabs. I highly recommend the later. I've had IE bugs only repro on specific windows versions with specific windows features turned on and off.

vercha commented 7 years ago

Thank you, I have a brief look at SauceLab, not sure will it support our gitlab CI test. And I found a docker image suchja/x11server ; if I run x11server before running wine image, wine can open IE from docker image successfully. but I'm still not sure if it possible to run test through docker IE.

nathanboktae commented 7 years ago

Even if you get that running, you will constantly be maintaining that Frankenstein setup. Don't do it.