If you used the Angular CLI to create your Angular project, there is not that much work left to do to start using Chrome in headless mode to run your end-to-end tests.
Let’s walk through the steps:
- Open the protractor.conf.js file in the e2e folder. Change the capabilities entry in the config to include a
chromeOptions
object like this:
capabilities: { chromeOptions: { args: [ "--headless" ] }, 'browserName': 'chrome' },
By using the args property, we pas a --headless option. This configures Chrome to run in headless mode.
That is all we need to do . Just kick off your E2E tests using:
npm run e2e