blueimp / nightwatch

This project is deprecated in favor of blueimp/wdio.
https://github.com/blueimp/wdio
134 stars 43 forks source link

Running tests in parallel #3

Open ericomurtez opened 7 years ago

ericomurtez commented 7 years ago

Hi,

I am running into issues running tests in parallel. If I updated the "test_workers" param to true in the nightwatch.json and run docker-compose run --rm nightwatch

Both sample tests I have configured to run fail immediately, without starting the tests. I have looked at the docker containers and as much logs as possible but I have found no relevant information.

I have gotten tests running in parallel outside of docker, so wondering if you have any advice on how to run tests across a number of workers within the docker container?

Thanks, Eric

blueimp commented 7 years ago

Hi Eric, thanks for the report.

Not sure what the reason for the immediate failure is, might have something to do with the chromedriver interface.

That being said, the video recordings will be quite useless if multiple chrome instances are running at the same time, as they will overlap since the recording feature simply grabs the desktop display content.

To parallelise the tests, my recommendation is to start multiple chromedriver instances and run each spec with a different chromedriver as selenium server.

moneyrich commented 5 years ago

Resurrecting this thread, if that is OK.

I am running two dockers like this from a shell script:

docker-compose run --rm nightwatch -e load1 & docker-compose run --rm nightwatch -e load2 & wait

And I am seeing confusing on the videos, but not the screenshots. Is this to be expected?

moneyrich commented 5 years ago

The -e nightwatch tags are to drive the different user logins and behavior.

blueimp commented 5 years ago

Hi @moneyrich,

the reason you see this behavior is that you start two different container instances of the test driver (NightwatchJS), but are still connecting to only one Chromedriver instance.

If you want to isolate the video recordings for the tests, I recommend using two different sets of docker-compose.yml files.

The reason that screenshots are still recorded as expected is that they are taken via the webdriver API, while the videos are fullscreen Desktop recordings via FFMPEG X11.