WebGL apps (Cesium) in headless browser with xvfb - firefox

I am trying to run Cesium (http://cesiumjs.org/) with a headless firefox. I also tried slimerjs. In both cases, I am using xvfb, and get this:
[azureuser#myvm.net slimerjs-0.9.5]$ ./slimerjs test.js
Script Error: uncaught exception: RuntimeError: The browser supports WebGL, but initialization failed.
RuntimeError#http://myvm.net/Cesium/Cesium.js:11697:19
Context#http://myvm.net/Cesium/Cesium.js:97405:1
Scene#http://myvm.net/Cesium/Cesium.js:122319:23
CesiumWidget#http://myvm.net/Cesium/Cesium.js:132474:25
#http://myvm.net/:254:22
x.Callbacks/l#http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js:4:24877
x.Callbacks/c.fireWith#http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js:4:25702
.ready#http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js:4:2898
S#http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js:4:551
Stack:
-> undefined: 0
I did look around online, but did not find any satisfactory answer. There is this: Is there a way to run unit test for a WebGL webapp in a headless browser, but it did not generate many replies, and the only answer is not accepted.

Related

Getting Hydration Failed errors in shopify when building the first app

I am learning how to code an Shopify app. I wanted to build first app and I started following this tutorial : https://shopify.dev/apps/getting-started/create
I used npm init #Shopify/app#latest to create first app, then moved to that directory using cd .\first-app\ then I used npm run dev App looks and works fine with UI but on console I am getting lots of errors. Here are few of them.
Hydration failed because the initial UI does not match what was rendered on the server.
There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
vendors-node_modules_bugsnag_js_browser_notifier_js-node_modules_shopify_monorail_lib_monorai-fdaebc-b7c7bc61031d801d7cdf29f30133708999e0fe454a161247422ecc3e28c64ef8.js:2
Uncaught (in promise) Error: Error completing request. A network failure may have prevented the request from completing. Error: TypeError: Failed to fetch
And few more, I did set up the ngrok tunnel and it is working fine.
I might be missing something, any help or pointing me to right direction is appriciated
Trying to build my first app on Shopify going through their documentation using : https://shopify.dev/apps/getting-started/create

The stylesheet x was not loaded because its MIME type, “text/html”, is not “text/css”

I developed a MERN application where everything runs perfectly normal on localhost. Now I put my application live, Heroku for the backend and Netlify for the frontend, and when visting my home url (https://bap-nmd-2020-2021.netlify.app/) the page just stucks. Nothing is loaded and the code stops executing.
I used chrome and firefox dev edition to see what could be wrong. What I found where the following errors
In chrome dev tools:
Uncaught SyntaxError: Unexpected token '<'
In Firefox dev edition:
The stylesheet https://bap-nmd-2020-2021.netlify.app/static/css/main.ab94b624.chunk.css was not loaded because its MIME type, “text/html”, is not “text/css”.
Uncaught SyntaxError: expected expression, got '<'2.c23262ff.chunk.js:1
Uncaught SyntaxError: expected expression, got '<'main.361ee52b.chunk.js:1
As I said, everything runs smooth on localhost without any problems so my paths to imported files should be ok. So I am totally clueless about what could be the issue here.
I've already read through some threads here concerning this issue but I could not found the same exact problem. Most of the people have wrong paths included in there hrefs, which is not the the case here I think.
Somebody has any idea please?
Thanks in advance!

How to debug headless Electron preload script failure?

I have an Electron app with code like
let win = new BrowserWindow({ show: false, frame: false, webPreferences: {preload: "/path/to/preload.js", ...}, ...});
and while developing new feature, I missed one closing parenthesis and one closing brace. Of course, I didn't know that and I instead got output to console while trying to launch the app
[18330:1204/142153.915989:INFO:CONSOLE(91)] "Unable to load preload script: /path/to/preload.js", source: electron/js2c/renderer_init.js (91)
[18330:1204/142153.916049:INFO:CONSOLE(91)] "SyntaxError: missing ) after argument list", source: electron/js2c/renderer_init.js (91)
For some reason, electron doesn't want to share the exception it actually receives while trying to load the preload script. For example, line number of the original parse error would be great! So I end up with no clue about the real cause barely on the log alone. Note that this issue is about problems with preload script contents - I know that some people are having problems with the preload script not being found by electron.
Also note that the second line in the log claims that error is on file electron/js2c/renderer_init.js on line 91 which is obviously only incorrect reporting from electron.
Is there a way to get the actual parse error to log? I'm trying to create headless app to be run with xvfb-run so I need to have output in the log.
I'm currently working with electron v10.0.1 but I'm willing to take hints for any version. Currently the only way forward is to use external linters or randomly comment out newly modified code blocks and try to figure out the problem manually. There must be a better way.
I'm already passing following command line flags to electron:
--enable-logging --v=2 --debug-print --noerrdialogs --headless

RSpec, Appium: provide desired capabilities from CLI

I am using this official Appium page http://appium.io/docs/en/writing-running-appium/default-capabilities-arg/
and I want to override the capabilities which are provided in spec_helper.rb this way
rspec --default-capabilities spec/test_data/new_caps.json spec/cli_test/cli_test_spec.rb
but it is giving me error invalid option: --default-capabilities.
Appium server already running in the background.
What am I doing wrong here?

close browser upon test error - protractor

i'm running protractor tests. if angular is not found or some exception is thrown, the test finishes however, the browser is not closed. this is a problem when running protractor in CI.
i tried using the onCleanUp function in the config file with no success.
any ideas how to close the browser after tests finished?
thanks you

Resources