I am currently using Cypress version 12.17.1 on VS Code within the Windows 10 operating system.
My goal is to write Cypress code in Visual Studio Code, but encountered an issue where the cypress commands that start with cy
are not appearing as auto-complete suggestions (intellisense). For example, in the provided image, the suggestions only show up when I explicitly require Cypress within the should('')
block.
https://i.sstatic.net/qTlGX.png
To make the above suggestions work, I have to import Cypress explicitly as shown below:
const cypress = require("cypress")
However, if I include this statement in my Cypress test file, such as e2e/test.cy.js, I encounter the error Cypress: process is not defined when trying to run my tests. This forces me to delete the line before every test run.
Is there a way to prevent this error or enable Cypress suggestions without requiring the Cypress package?