Raman
Raman

Reputation: 454

Unable to run cypress test.spec.js file from Cypress Integration folder path

enter image description here

I'm new to Cypress and using Visual Studio Code as IDE for Cypress. I have written sample test to launch a web page as below and it has written under Cypress Integration folder.

/// <reference types="cypress"/> 

it('Page should navigate to todoMVC', () =>{
    cy.visit('http://todomvc-app-for-testing.surge.sh/')
})

If try to run this script from Visual Studio Code terminal using

npx cypress open 

from Integration folder. Cypress window appears after but newly created xx.spec.js file won't be displayed and no error also. Any help would be appreciated.

Upvotes: 1

Views: 1378

Answers (2)

Pritam Patil
Pritam Patil

Reputation: 100

Go to package.json file of your project, under script write "cypress":"cypress open" and then from terminal - npm run cypress. Look here - https://www.opencodez.com/software-testing/front-end-automation-testing-cypress.htm

Upvotes: 0

Brendan
Brendan

Reputation: 4649

The issue is you're running npx cypress open from the cypress/integration directory. You should be running this from the root of your project - in your case it would be C:\VSCode-win32-x64-1.40.0\Code-Work

Upvotes: 2

Related Questions