Hi, i have read almost all the trades about browser crashing in docker yet non of the solution is helping me and i'm still stuck with the crashing browser error.
each time i run the test it hangs or crashes on different part of the test (the SUT is internal therefore can't share the page).
docker file:
FROM testcafe/testcafe
RUN whoami
COPY --chown=user:user . /opt/testcafe/e2e-tests
RUN cd /opt/testcafe/e2e-tests/ && npm cache clean --force && npm install && rm -rf /tmp/*
WORKDIR /opt/testcafe/e2e-tests
ENTRYPOINT ["/opt/testcafe//e2e-tests/testcafe-docker.sh"]
testcafe-docker.sh:
#!/bin/sh
XVFB_SCREEN_WIDTH=${SCREEN_WIDTH-1280}
XVFB_SCREEN_HEIGHT=${SCREEN_HEIGHT-720}
dbus-daemon --session --fork
Xvfb :1 -screen 0 "${XVFB_SCREEN_WIDTH}x${XVFB_SCREEN_HEIGHT}x24" >/dev/null 2>&1 &
export DISPLAY=:1.0
fluxbox >/dev/null 2>&1 &
node ./node_modules/.bin/testcafe -s '/tmp' 'chromium:headless --no-sandbox --disable-gpu-sandbox --disable-gpu' './tests/onboard-merchant/onboard-with-online-payment.js'
first i build the docker with "docker build . -t e2e"
then run the test with "docker run -v $HOME/tmp:/tmp -it e2e"
test fails with:
ERROR The HeadlessChrome 63.0.3239 / Linux 0.0.0 browser disconnected. This problem may appear when a browser hangs or is closed, or due to network issues.