Make it possible to run VisualEditor tests in headless mode

Bug: 60584
Change-Id: I63782af45610d4e5fcbbea73d7f8d68035faee1a