While conducting functional tests with nightwatch.js, I encountered a discrepancy between my local environment and the containerized environment. In the container environment, which is crucial for integrating into my CI pipeline and running automated tests upon every release, I faced issues related to asset loading and screenshots.
When a test fails, a screenshot is captured and stored in a directory that can be easily accessed from the host machine. However, each time a test fails, the screenshot displays an unstyled page without executed JavaScript code. It seems like none of the assets, including CSS and client-side JS, are loading properly, resulting in failed tests.
I experimented with both chromedriver and firefox within a selenium container, while my app, a node.js application, also runs inside a separate container. Interestingly, when I access my app through a browser within its respective container, everything appears as expected. Despite trying various selenium images, including both standalone and blueimp's versions, the issue persists. Conversely, tests on external websites run smoothly.
Update: Upon further investigation, I discovered that my app only processes one type of request - the main URL. There seem to be no requests made for any assets required by the application.