Nx: Using --headless mode isn't hiding the chrome browser

Created on 6 Mar 2020  路  6Comments  路  Source: nrwl/nx

_Please make sure you have read the submission guidelines before posting an issue_

Prerequisites

Please answer the following questions for yourself before submitting an issue.
YOU MAY DELETE THE PREREQUISITES SECTION.

  • [x] I am running the latest version
  • [x] I checked the documentation (nx.dev) and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository (not related to React, Angular or any dependency)

Expected Behavior

Please describe the behavior you are expecting

Current Behavior

What is the current behavior?

Failure Information (for bugs)

Please help provide information about the failure if this is a bug. If it is not a bug, please remove the rest of this template.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1
  2. step 2
  3. ...

If you can provide steps to reproduce from scratch, that would be enormously appreciated (i.e. where the first step is npx create-nx-workspace@latest repro-workspace)

Context

Please provide any relevant information about your setup:

  • version of Nx used (_Please run nx report at the root of your workspace and copy the results here if you are using Nx 8.6.1 or greater_)
  • 3rd-party libraries and their versions
  • and most importantly - a use-case that fails

A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Failure Logs

Please include any relevant log snippets or files here.

Other

Any other relevant information that will help us help you.

repro needed testing tools bug

Most helpful comment

Same problem for me when using cypress with nx e2e projectName 鈥攂rowser chrome 鈥攈eadless on @nrwl/[email protected] with [email protected]

All 6 comments

Using --headless mode isn't hiding the chrome browser. Using the latest version of nrwl.

Same problem for me when using cypress with nx e2e projectName 鈥攂rowser chrome 鈥攈eadless on @nrwl/[email protected] with [email protected]

Folks. Could you try it with Nx 9.1.0? Cypress 4 wasn't officially supported by Nx <= 9.1

If the issue persists with 9.1., could you provide a repository with a repro?

Folks. Could you try it with Nx 9.1.0? Cypress 4 wasn't officially supported by Nx <= 9.1

If the issue persists with 9.1., could you provide a repository with a repro?

Can confirm that the issue persists.

I prepared a reproduction for you.

The script yarn example-e2e should run cypress with browser Chrome in headless mode but it's starting with UI.

My current workaround is to run cypress with the following command

cypress run -P path/to/e2e-app --browser chrome --headless

after changing plugins/index.js to look like this:

const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
const { cwd } = require('process');
const { join } = require('path');

module.exports = (on, config) => {
  // `on` is used to hook into various events Cypress emits
  // `config` is the resolved Cypress config

  // Preprocess Typescript file using Nx helper
  config.env.tsConfig = join(cwd(), 'tsconfig.e2e.json');
  on('file:preprocessor', preprocessTypescript(config));
};

This is fixed in the latest version of Nx by #2683! :tada:

Thank you for reporting the issue!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SWGeekPD picture SWGeekPD  路  3Comments

elliotmendiola picture elliotmendiola  路  3Comments

Svancara picture Svancara  路  3Comments

joelmuskwe picture joelmuskwe  路  3Comments

markphip picture markphip  路  3Comments