Skip to content

Commit

Permalink
Make tests relying on xeokit work locally
Browse files Browse the repository at this point in the history
Tests using xeokit, the 3d visualization kit from BIM edition, did not
work locally for me. It fails with the following devtools console error:
"[ERROR] [Canvas '__0']: Failed to get a WebGL context". They do pass on
CI though.

One example test is `./modules/bim/spec/features/model_viewer_spec.rb`.

In an effort to make these tests pass both on CI and locally, I'm trying
some flags seen on https://stackoverflow.com/q/70948512/177665 to keep
the GPU enabled, but use a software implementation. It works locally.
Not sure yet if it works in a docker container and on CI.
  • Loading branch information
cbliard authored and oliverguenther committed Sep 9, 2024
1 parent 460a8c4 commit ad1739f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/support/browsers/chrome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ def register_chrome(language, name: :"chrome_#{language}", headless: "old", over
end

options.add_argument("--no-sandbox")
options.add_argument("--disable-gpu")
options.add_argument("--disable-popup-blocking")
options.add_argument("--lang=#{language}")
options.add_preference("intl.accept_languages", language)
# This is REQUIRED for running in a docker container
# https://github.com/grosser/parallel_tests/issues/658
options.add_argument("--disable-dev-shm-usage")
options.add_argument("--disable-smooth-scrolling")
# Software GPU to avoid the dreaded "[ERROR] [Canvas '__0']: Failed to get a
# WebGL context" error for tests using xeokit, adapted from answers of
# https://stackoverflow.com/q/70948512/177665 and
options.add_argument("--use-gl=angle")
# Disable "Select your search engine screen"
options.add_argument("--disable-search-engine-choice-screen")

Expand Down

0 comments on commit ad1739f

Please sign in to comment.