important-diamond-61614
07/05/2022, 9:38 AMcypress open --browser chrome --e2e
or cypress run chrome --e2e
runs without issue, and finds all the relevant spec files. But when I use a command which runs a js file: CONFIG_FILE=qa1.mt1_all MARKET=all DEVICE=desktop node index.js
It cannot find the spec files, and returns the error:
Can't run because no spec files were found.
We searched for specs matching this glob pattern:
> /Users/oiuasofd/code/oiuasodf/node/repo-name/cypress/e2e/**/*.cy.{js,jsx,ts,tsx}
The contents of index.js
const cypress = require('cypress');
const { v4: uuidv4 } = require('uuid');
cypress
.run({
browser: 'chrome',
headless: true,
record: true,
parallel: true,
ciBuildId: process.env.BUILD_ID || uuidv4(),
key: 'randomly-generated-string', // This is a unique value for running parallel tests
config: {
env: {
configFile: process.env.CONFIG_FILE || '',
device: process.env.DEVICE,
market: process.env.MARKET,
},
},
})
.catch(() => {
process.exit(1);
});