1

enter image description hereI'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.

Raman
  • 386
  • 5
  • 17

2 Answers2

2

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

Brendan
  • 2,947
  • 1
  • 18
  • 31
  • Thanks. I will try this and why every time Integration folder is getting generated with multiple folder tree structure? If run 3 times then 3 levels integration folder getting created with parent integration folder – Raman Nov 12 '19 at 16:21
  • I think they didn't get enough time to test the testing tool itself ;). Its not just running from cypress/integration, even you can't "open" from the "cypress" folder. The spec folder magically ignore anything other than their original shipped samples. even I tried to place the files under the "example" folder but not reflecting in the window. – sarath May 18 '20 at 16:40
0

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

Pritam Patil
  • 78
  • 1
  • 8