You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I migrated my cypress e2e project to infer targed with npx nx g infer-targets --project=cypress --plugins=@nx/cypress and while it works, when I run the target it starts the wrong server.
This is my cypress.config.ts where I define app:serve:cypress as my default webServerCommand.
import{defineConfig}from'cypress';import{nxE2EPreset}from'@nx/cypress/plugins/cypress-preset';importsetupNodeEventsfrom'./src/plugins/index';letrunningOnCI=false;if(typeofprocess!=='undefined'&&process.env['CI']){runningOnCI=true;}exportdefaultdefineConfig({chromeWebSecurity: false,e2e: {
...nxE2EPreset(__filename,{cypressDir: 'src',webServerCommands: {default: 'npx nx run app:serve:cypress',production: 'npx nx run app:serve:cypress',},ciWebServerCommand: 'npx nx run app:serve-static',ciBaseUrl: 'http://localhost:8200',}),baseUrl: 'http://localhost:8200',
setupNodeEvents,viewportHeight: 640,viewportWidth: 360,includeShadowDom: true,scrollBehavior: 'center',experimentalRunAllSpecs: true,videoCompression: false,video: !runningOnCI,experimentalMemoryManagement: true,numTestsKeptInMemory: 20,// Please ensure you use `cy.origin()` when navigating between domains and remove this option.// See https://docs.cypress.io/app/references/migration-guide#Changes-to-cyorigininjectDocumentDomain: true,specPattern: './src/e2e/**/*.cy.{js,jsx,ts,tsx}',excludeSpecPattern: '**/*.po.ts',supportFile: 'src/support/e2e.ts',},});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I migrated my cypress e2e project to infer targed with
npx nx g infer-targets --project=cypress --plugins=@nx/cypressand while it works, when I run the target it starts the wrong server.This is my
cypress.config.tswhere I defineapp:serve:cypressas mydefaultwebServerCommand.and this is the
servepart of the appWhen I run the target, it starts

servein port4200but cypress waits for8200as specified.Is this a bug? Or Did I miss configured something?
Beta Was this translation helpful? Give feedback.
All reactions