getgauge / taiko

A node.js library for testing modern web applications
https://taiko.dev
MIT License
3.56k stars 452 forks source link

"Navigation took more than 30000ms. Please increase the navigationTimeout" - working locally but issue in GitLab pipeline #2700

Open tester-mind opened 1 year ago

tester-mind commented 1 year ago

Describe the bug "Navigation took more than 30000ms. Please increase the navigationTimeout" - working locally but issue in GitLab pipeline

To Reproduce Steps (or script) to reproduce the behavior:

  1. Open the browser (chrome) in headless mode
await openBrowser({
        headless: headless,
        args: ["--no-sandbox"]
    });
    console.log('Browser opened.');
    gauge.message('Browser opened.');
  1. Goto url

await goto(url);

tried all the below solutions, but none is working -

  1. Script is working locally but issue in GitLab pipeline

  2. See error "Navigation took more than 30000ms. Please increase the navigationTimeout"

Logs

Paste any log or error messages here

Error Message: Error: Navigation took more than 30000ms. Please increase the navigationTimeout.
    Stacktrace: 
    Error: Navigation took more than 30000ms. Please increase the navigationTimeout.
        at doActionAwaitingNavigation (node_modules/taiko/lib/doActionAwaitingNavigation.js:66:13)
        at async module.exports.goto (node_modules/taiko/lib/taiko.js:744:3)
        at async module.exports.<computed> (node_modules/taiko/lib/taiko.js:2620:14)
        at async Object.<anonymous> (tests/step_implementation.js:36:5)

![image](https://user-images.githubusercontent.com/130654429/231729767-f5ccc606-89e1-4b4a-a81d-12d7335d8551.png)

Expected behavior The script should run in the CI/CD pipeline as it is running locally

Screenshots If applicable, add screenshots to help explain your problem.

Versions:

Gauge version: 1.4.3
Plugins
-------
html-report (4.2.0)
js (2.4.0)
python (0.3.17)
screenshot (0.1.0)

Additional context .gitlab-ci.yml file image

hojerst commented 1 year ago

seems you have to set --disable-dev-shm-usage as browser arg as well to get everything running in a docker container

export TAIKO_BROWSER_ARGS: '--no-sandbox --disable-dev-shm-usage --disable-setuid-sandbox --disable-web-security'

see also: https://docs.taiko.dev/taiko_in_docker/#a-note-on-the-flags-and-options