Skip to content

[cypress] test:e2e doesn't run in headless mode if project uses cli-plugin-typescript #2903

Closed
@cexbrayat

Description

@cexbrayat

Version

3.1.1

Reproduction link

https://github.com/cexbrayat/vue-cypress-e2e-issue

Node and OS info

Node 8.11, npm 6.4, macOS 10.14

Steps to reproduce

npx @vue/cli@3.1.1 create vue-cypress-e2e-issue --inlinePreset '{"useConfigFiles": true,"plugins": {"@vue/cli-plugin-typescript": {"classComponent": true,"tsLint": true,"lintOn": ["save"]},"@vue/cli-plugin-unit-jest": {},"@vue/cli-plugin-e2e-cypress": {}}}'

# or git clone https://github.com/cexbrayat/vue-cypress-e2e-issue

cd vue-cypress-e2e-issue
npm run test:e2e -- --headless

What is expected?

When running npm run test:e2e -- --headless, the test should complete.

What is actually happening?

The task hangs and never runs the test nor fails or completes.

It logs:

vue-cypress-e2e-issue git:master ❯ npm run test:e2e -- --headless

> vue-cypress-e2e-issue@0.1.0 test:e2e /Users/ced-pro/Code/test/vue/vue-cypress-e2e-issue
> vue-cli-service test:e2e "--headless"

 INFO  Starting e2e tests...
 INFO  Starting development server...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit


 DONE  Compiled successfully in 2012ms                                                                                            11:45:27 AM

Type checking and linting in progress...

  App running at:
  - Local:   http://localhost:8080/
  - Network: http://192.168.150.187:8080/

  App is served in production mode.
  Note this is for preview or E2E testing only.

No type errors found
No lint errors found
Version: typescript 3.1.6, tslint 5.11.0
Time: 2246ms

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.1.1                                                                              │
  │ Browser:    Electron 59 (headless)                                                             │
  │ Specs:      1 found (test.js)                                                                  │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────

  Running: test.js...                                                                      (1 of 1)
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit


 DONE  Compiled successfully in 2994ms

And hangs there indefinitely.

Note that it works well if not in headless mode.


The project uses cli-plugin-typescript. The e2e tests run fine if not in headless mode.

If TypeScript is not used, the e2e tests are fine in headless mode or not.

Workaround

Commenting:

module.exports = (on, config) => {
  on('file:preprocessor', webpack({
    // webpackOptions: require('@vue/cli-service/webpack.config'),
    watchOptions: {}
  }))

in tests/e2e/plugins/index.js fixes the issue.
The task then run fine in headless mode as well.

Might be related to #2783 but in this case I never have a complete run not even the first one.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions