question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error occurs when referencing the upper hierarchy with specPattern

See original GitHub issue

Current behavior

I execute test specs in the hierarchy above the folder specified by “–project”. By updating Cypress v10, integrationFolder option was removed and replaced with specPattern option. When I replace integrationFolder option with specPattern option and execute test specs, below error is happened.

Error: EINVAL: invalid argument, mkdir 'C:\Users\<user>\AppData\Roaming\Cypress\cy\production\projects\project-ebb3941567b10beb6f33096d39c6ad57\bundles\D:\ProgramData\workspace\sample\test'

error-message

My project strucutre is separated with settings folder and test spcec folder. So, I execute cypress with “–project” option.

  • My project structure
<Project>
  ├─Path
  │  └─to
  │     └─project
  │         ├─fixtures
  │         ├─support
  │         └─cypress.config.js
  └─test
      └─spec.cy.js
  • Execute command
npx cypress open --project .\path\to\project
  • cypress.config.js
const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    specPattern: "../../../test/*.cy.js"
  }
});

Cypress 9.x with integrationFolder don’t happen this problem.

Desired behavior

Cypress can execute test specs in the hierarchy above the folder specified by “–project”

Test code to reproduce

  • cypress.config.js
const { defineConfig } = require("cypress");

module.exports = defineConfig({
  e2e: {
    specPattern: "../../../test/*.cy.js"
  }
});

Cypress Version

10.0.2 (happens 10.0.0 and above)

Other

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
flotwigcommented, Aug 22, 2022

Definitely a regression in v10. However, I’d like to point out that this isn’t “best practice” to set up your Cypress tests like this. You can use a central package to manage the cypress version and use --project to point to a cypress.config.js per package.

0reactions
Sjeiticommented, Oct 24, 2022

use a central package to manage

@flotwig Does this mean the Nx implementation of Cypress is not best practice? Were you referring to globs outside the cypress.config-directory or the use of a central package?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing and Organizing Tests - Cypress Documentation
What you'll learn How to organize your test and support files. What languages are supported in your test files. How Cypress handles unit...
Read more >
Organizing Test Suite - WebdriverIO
In general, try to test only a single feature per spec file. Try to not have too many or too few tests in...
Read more >
Ginkgo test suite - GitHub Pages
This hierarchy is constructed using three kinds of nodes: We use container nodes like Describe and Context to organize the different aspects of...
Read more >
gcc/ada/prj.ads - chromiumos/third_party/gcc - Git at Google
GNAT is free software; you can redistribute it and/or modify it under -- ... Reference to a project tree. ... The upper bound...
Read more >
glom Documentation
glom is a new approach to working with data in Python, featuring: ... the top-level package is not documented, please file an issue...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found