In the wdio.config file add the following:

compatibilities: [
  maxInstances: 1,
  browserName: "Chrome",
  "goog:chromeOptions": {
    args: ["--headless"],
  },
]