Javascript 修改/更改“example-spec.js”时,Cypress test runner不会立即运行
修改/更改“example-spec.js”时,Cypress test runner不会立即运行。测试跑步者的版本是cypress中的Chrome 68和Electron 59。cypress安装的版本是3.1.0。也可以使用atom.js编辑器。桌面计算机是Windows 8.1 Pro 在命令提示符下,首先运行此命令以转到目录“cd C:\node\u modules.bin”,然后运行“cypress open”。这将打开cypress应用程序 下面的文件夹目录和添加的屏幕截图 C:\node\u modules.bin\cypress\integration\examples\example-spec.js 在下面给出的应用程序设置>配置>json设置中Javascript 修改/更改“example-spec.js”时,Cypress test runner不会立即运行,javascript,cypress,Javascript,Cypress,修改/更改“example-spec.js”时,Cypress test runner不会立即运行。测试跑步者的版本是cypress中的Chrome 68和Electron 59。cypress安装的版本是3.1.0。也可以使用atom.js编辑器。桌面计算机是Windows 8.1 Pro 在命令提示符下,首先运行此命令以转到目录“cd C:\node\u modules.bin”,然后运行“cypress open”。这将打开cypress应用程序 下面的文件夹目录和添加的屏幕截图 C:\n
{
animationDistanceThreshold: 5,
baseUrl: null,
blacklistHosts: null,
chromeWebSecurity: true,
defaultCommandTimeout: 4000,
env: {},
execTimeout: 60000,
fileServerFolder: '',
fixturesFolder: 'cypress/fixtures',
hosts: null,
integrationFolder: 'cypress/integration',
modifyObstructiveCode: true,
numTestsKeptInMemory: 50,
pageLoadTimeout: 60000,
pluginsFile: 'cypress/plugins',
port: null,
reporter: 'spec',
reporterOptions: null,
requestTimeout: 5000,
responseTimeout: 30000,
screenshotsFolder: 'cypress/screenshots',
supportFile: 'cypress/support',
taskTimeout: 60000,
testFiles: '**/*.*',
trashAssetsBeforeRuns: true,
userAgent: null,
video: true,
videoCompression: 32,
videoUploadOnPasses: true,
videosFolder: 'cypress/videos',
viewportHeight: 660,
viewportWidth: 1000,
waitForAnimations: true,
watchForFileChanges: true}
看起来您正在修改Cypress安装中的测试文件。这可能不是你想做的 Cypress有两个重要组成部分: Cypress软件包安装。在您的情况下,它安装在c:\node\u modules\.bin\cypress 测试中的项目还有一些与Cypress相关的文件,包括项目顶层目录中的Cypress.json,以及位于项目目录中Cypress文件夹中的测试文件,除非您告诉Cypress使用其他目录。 在项目上运行Cypress测试时,监视的测试文件是位于项目目录中的文件,而不是Cypress安装本身中的文件 当运行cypress open时,您可以手动选择要测试的项目的目录,比如说它是C:\MY\u project。如果没有cypress.json文件且未找到测试,cypress将自动在C:\MY_项目中创建一个cypress.json文件和一个cypress目录。在C:\MY\u PROJECT\cypress\integration\目录中会有一些示例测试。当您使用watchForFileChanges=true编辑此目录中的测试并手动选择要测试的C:\MY\u项目时,它们将在保存时自动重新运行 我还测试了在node_modules目录下的Cypress包的example目录中运行和修改测试。我可以确认,当编辑该目录中的文件时,测试不会重新运行。但是,当您尝试测试自己的一个项目时,编辑这些文件是错误的
HTH为了首先运行cypress open命令,我们需要cd到C:\node\u modules\.bin目录。然后运行cypress open…在该级别,cypress将创建另一个包含所有示例文件的cypress文件夹。应用程序正在加载该级别的文件,我无法从应用程序更改它。回到你的观点,如果我创建一个新文件夹,比如“C:\MY_PROJECT”,我们如何从该级别运行cypress open?感谢你的详细澄清,欢迎你。在您的C:\MY\u项目文件夹中,您应该能够在C:\node\u modules\.bin\Cypress打开的情况下运行Cypress。引号很重要,因为命令中有空格。我目前没有可用的Windows进行测试,但我认为该命令应该可以工作。另外,请参阅,了解如何从不同目录运行Windows命令。所以也可以尝试c:\node\u modules\.bin\cypress open no引号。