Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cypress Feture testing does not work in react-monorepo #23272

Open
1 of 4 tasks
Mrblackey opened this issue May 9, 2024 · 0 comments
Open
1 of 4 tasks

Cypress Feture testing does not work in react-monorepo #23272

Mrblackey opened this issue May 9, 2024 · 0 comments
Assignees
Labels
scope: react Issues related to React support for Nx scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug

Comments

@Mrblackey
Copy link

Mrblackey commented May 9, 2024

Current Behavior

The generated e2e suite fails to run.

Expected Behavior

Generator should create a working boilerplate suite.

GitHub Repo

https://github.com/nrwl/nx-examples

Steps to Reproduce

  1. nx generate @nx/cypress:configuration --project=cart-cart-page --devServerTarget=cart:serve --no-interactive
  2. nx run cart-cart-page:e2e

Nx Report

Node   : 20.10.0
OS     : win32-x64
yarn   : 1.22.19

nx                 : 19.0.0-beta.5
@nx/js             : 19.0.0-beta.5
@nx/jest           : 19.0.0-beta.5
@nx/linter         : 19.0.0-beta.5
@nx/eslint         : 19.0.0-beta.5
@nx/workspace      : 19.0.0-beta.5
@nx/angular        : 19.0.0-beta.5
@nx/cypress        : 19.0.0-beta.5
@nx/devkit         : 19.0.0-beta.5
@nx/eslint-plugin  : 19.0.0-beta.5
@nx/react          : 19.0.0-beta.5
@nrwl/tao          : 19.0.0-beta.5
@nx/web            : 19.0.0-beta.5
@nx/webpack        : 19.0.0-beta.5
typescript         : 5.4.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/cypress/plugin
@nx/jest/plugin
---------------------------------------
Community plugins:
@ngrx/component-store : 17.0.1
@ngrx/effects         : 17.0.1
@ngrx/entity          : 17.0.1
@ngrx/router-store    : 17.0.1
@ngrx/store           : 17.0.1
@ngrx/store-devtools  : 17.0.1

Failure Logs

*  Executing task: yarn nx run cart-cart-page:e2e 

yarn run v1.22.19
$ nx run cart-cart-page:e2e

> nx run cart-cart-page:e2e

> cypress run



DevTools listening on ws://127.0.0.1:60042/devtools/browser/b17706a7-516b-4440-9e3d-bd4bf43881bb        

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

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐    
  │ Cypress:        13.6.6                                                                         │    
  │ Browser:        Electron 118 (headless)                                                        │    
  │ Node Version:   v20.10.0 (C:\Program Files\nodejs\node.exe)                                    │    
  │ Specs:          1 found (app.cy.ts)                                                            │    
  │ Searched:       cypress/**/*.cy.{js,jsx,ts,tsx}                                                │    
  └────────────────────────────────────────────────────────────────────────────────────────────────┘    


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

  Running:  app.cy.ts                                                                       (1 of 1)    


  cart-cart-page
    1) "before each" hook for "should display welcome message"


  0 passing (337ms)
  1 failing

  1) cart-cart-page
       "before each" hook for "should display welcome message":
     CypressError: `cy.visit()` failed trying to load:

/

We failed looking for this file at the path:

.../nx-examples/libs/cart/cart-page/

The internal Cypress web server responded with:

  > 404: Not Found

Because this error occurred during a `before each` hook we are skipping the remaining tests in the current suite: `cart-cart-page`
      at <unknown> (http://localhost:60043/__cypress/runner/cypress_runner.js:130958:76)
      at visitFailedByErr (http://localhost:60043/__cypress/runner/cypress_runner.js:130372:12)
      at <unknown> (http://localhost:60043/__cypress/runner/cypress_runner.js:130941:13)
      at tryCatcher (http://localhost:60043/__cypress/runner/cypress_runner.js:1807:23)
      at Promise._settlePromiseFromHandler (http://localhost:60043/__cypress/runner/cypress_runner.js:1519:31)
      at Promise._settlePromise (http://localhost:60043/__cypress/runner/cypress_runner.js:1576:18)     
      at Promise._settlePromise0 (http://localhost:60043/__cypress/runner/cypress_runner.js:1621:10)    
      at Promise._settlePromises (http://localhost:60043/__cypress/runner/cypress_runner.js:1697:18)    
      at _drainQueueStep (http://localhost:60043/__cypress/runner/cypress_runner.js:2407:12)
      at _drainQueue (http://localhost:60043/__cypress/runner/cypress_runner.js:2400:9)
      at Async._drainQueues (http://localhost:60043/__cypress/runner/cypress_runner.js:2416:5)
      at Async.drainQueues (http://localhost:60043/__cypress/runner/cypress_runner.js:2286:14)
  From Your Spec Code:
      at Context.eval (webpack:///./cypress/e2e/app.cy.ts:5:0)




  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐    
  │ Tests:        1                                                                                │    
  │ Passing:      0                                                                                │    
  │ Failing:      1                                                                                │    
  │ Pending:      0                                                                                │    
  │ Skipped:      0                                                                                │    
  │ Screenshots:  1                                                                                │    
  │ Video:        false
  │ Duration:     0 seconds                                                                        │    
  │ Spec Ran:     app.cy.ts                                                                        │    
  └────────────────────────────────────────────────────────────────────────────────────────────────┘    


  (Screenshots)

  -  ...\nx-examples\dist\cypress\libs\cart\cart-page\screenshots\ap     (1280x720)    
     p.cy.ts\cart-cart-page -- should display welcome message -- before each hook (fa
     iled).png


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

  (Run Finished)


       Spec                                              Tests  Passing  Failing  Pending  Skipped      
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐    
  │ ✖  app.cy.ts                                340ms        1        -        1        -        - │    
  └────────────────────────────────────────────────────────────────────────────────────────────────┘    
    ✖  1 of 1 failed (100%)                     340ms        1        -        1        -        -      

Warning: command "cypress run" exited with non-zero status code
———————————————————————————————————————————————————————————————————————————————————————————————————————

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@FrozenPandaz FrozenPandaz added scope: react Issues related to React support for Nx scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: react Issues related to React support for Nx scope: testing tools Issues related to Cypress / Jest / Playwright / Vitest support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants