tnicola / cypress-parallel

Reduce up to 40% your Cypress suite execution time parallelizing the test run on the same machine.
MIT License
561 stars 116 forks source link

DEPRECATED: using path is deprecated and will be removed, switch to glob pattern #123

Closed BartusZak closed 1 year ago

BartusZak commented 1 year ago

package.json

        "cy:run": "cypress run --browser chrome --headless",
        "cy:parallel" : "cypress-parallel -s cy:run -t 2",

Result:

$ cypress-parallel -s cy:run -t 2
DEPRECATED: using path is deprecated and will be removed, switch to glob pattern
node:fs:1442
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, scandir 'cypress/integration'
    at Object.readdirSync (node:fs:1442:3)
    at getFilePathsByPath (\e2e\node_modules\cypress-parallel\test-suites.js:8:6)
    at getTestSuitePaths (\e2e\node_modules\cypress-parallel\test-suites.js:38:16)
    at start (\e2e\node_modules\cypress-parallel\cli.js:24:32)
    at Object.<anonymous> (\e2e\node_modules\cypress-parallel\cli.js:124:1)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
    at Module.load (node:internal/modules/cjs/loader:1004:32)
    at Function.Module._load (node:internal/modules/cjs/loader:839:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  errno: -4058,
  syscall: 'scandir',
  code: 'ENOENT',
  path: 'cypress/integration'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

NodeJS: v16.17.0

package.json

    "devDependencies": {
        "@types/cypress-image-snapshot": "3.1.6",
        "cypress": "10.7.0",
        "cypress-image-snapshot": "4.0.1",
        "cypress-intellij-reporter": "0.0.7",
        "cypress-parallel": "^0.9.1",
        "dayjs": "1.11.5",
        "eslint": "8.23.0",
        "eslint-config-airbnb": "19.0.4",
        "eslint-import-resolver-babel-module": "5.3.1",
        "eslint-plugin-import": "2.26.0",
        "eslint-plugin-json": "3.1.0",
        "eslint-plugin-jsx-a11y": "6.6.1",
        "eslint-plugin-prettier": "4.2.1",
        "eslint-plugin-react": "7.31.1",
        "eslint-plugin-react-hooks": "4.6.0",
        "http-server": "14.1.1",
        "start-server-and-test": "1.14.0",
        "typescript": "4.8.2"
    }
BartusZak commented 1 year ago

Changing:

        "cy:parallel": "cypress-parallel -s cy:run -t 2 -d ./src/integration ",

Installing:

        "cypress-multi-reporters": "^1.6.1",

Allowed me to run tests.

noethig commented 1 year ago

also works for me.

~unfortunately that didn't work for me...~

it didn't work before, because I mistakenly used this wrong npm script config:

"cy:parallel":  "cypress-parallel -s cy:run -t 2 -d cypress/e2e/*"

(the ".../*" let it fail)

tnicola commented 1 year ago

Oh, the correct syntax here is using single quotes:

e.g.: "cy:parallel": "cypress-parallel -s cy:run -t 2 -d 'cypress/e2e/*'"