Cesium E2E testing with Puppeteer

I am trying to setup E2E testing for my application based on cesium using puppeteer and jest. The testcases work as expected in headful mode but when switched to headless regardless of the timeout I set, it always times out. Could it be caused by Cesium not being able to render properly in headless mode. I am using the native networkidle2 to wait for navigation. Below is a simple testcase that works perfectly in headful but times out in headless mode.

import 'expect-puppeteer';
import { INSITEAnnotationType } from '../../../js/insite_data';
import { clearAllAnnotations } from '../../../utils/testUtils/annotations';
import { login } from '../../../utils/testUtils/auth';

describe('Line tool testing', () => {
  beforeAll(async () => {
    await page.goto(`${process.env.APPLICATION_BASE_URL}/${process.env.TEST_PROJECT_PATH}`,{waitUntil: 'networkidle2'});

  it('tool should exist', async () => {
    const lineToolBtn = await page.$('i#toolbar_distance');

This is the error I get:
TimeoutError: Navigation timeout of 60000 ms exceeded