0

I'm trying to run cypress tests inside a docker container.

It works when my test spec files are located inside ./cypress folder as cypress looks for default folder(cypress/integration) but it could not find spec files when i use different test spec files path( trying to override default folder);

I'm using below docker command ;

docker run -it -v $PWD:/e2e -w /e2e cypress/included:6.2.1 cypress run --config integrationFolder=tests --spec 'tests/spec.js'

ERROR:

Can't run because no spec files were found.

We searched for any files matching this glob pattern:

tests/spec.js
itgeek
  • 549
  • 1
  • 15
  • 33

2 Answers2

1

You can use your own test folder path by configuring cypress.json file as below;

{   
    "integrationFolder": "tests"
}
itgeek
  • 549
  • 1
  • 15
  • 33
0

Hi can try to write your exact workaround in a cypress.json

{
"integrationFolder": "cypress/integration" }

I think it's mostly working. I am also writing for this particular error..

  • 1
    Good answer, a few suggestions though. Try formatting the code properly and providing more explanation on what the answer solves. – user Apr 22 '22 at 14:02