Why is it wrong for me to run the tests of a specific directory with cypress?

拟墨画扇 提交于 2021-02-11 12:44:47

问题


I am trying to run some specific tests within a directory, using cypress the command that I try to execute is:

node_modules\.bin\cypress run --spec 'cypress\integration\tests\default.spec.js'

I have also tried with:

node_modules\.bin\cypress run --spec 'cypress\integration\tests\*.spec.js'

Or:

node_modules\.bin\cypress run --spec 'cypress\integration\tests\**'

The directory and the files exist, I tried to keep the absolute path to those files but it does not work either. Try changing the configuration of the integration directory in the cypress.json, at the end I have this file:

cypress.json

{
  "baseUrl": "http://localhost/",
  "chromeWebSecurity": false,
  "integrationFolder": "./cypress/integration/",
  "testFiles": "**.spec.js"
}

This is the message's error: Can't run because no spec files were found.

We searched for any files matching this glob pattern:

'cypress\integration\tests\default.spec.js'


回答1:


I know it's late but I just came across this issue.

I solved it by using (=) --spec=cypress/integration/[path], it can't detect if I'm using quotes, --spec 'cypress/integration/[path]'.



来源:https://stackoverflow.com/questions/53324050/why-is-it-wrong-for-me-to-run-the-tests-of-a-specific-directory-with-cypress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!