Nx: cypress setup not copying fixtures files

Created on 15 Jan 2019  路  10Comments  路  Source: nrwl/nx

We recently updated from @nrwl/nx and related dependencies from 7.0.2 to 7.2.0.

When running e2e test with cypress, the fixture folder was not copied over to the corresponding output.

any ideas what changed in between? Angular versions are at 7.1.4.

community bug

Most helpful comment

@Need-To-Learn Hi, it works. IMHO this is a bug in nrwl/builders package.

All 10 comments

I have the same issue, which is blocking us from upgrading ``"@nrwl/builders": "7.0.2" to anything newer. The version 7.0.2 works correctly.

Hi,
I'm having the same issue with @nrwl/builders 7.3.0.
My current fix is to add fixtures and fixturesFolder with the same path configuration in cypress.json.

@Need-To-Learn hi, how did you actually fix it?
Did you modify the cypress.json file?

This is how the output looks like in version 7.0.2:
image

this is how it looks in 7.5.0:
image

Here is my 2e2 app:
image
and cypress.json file:

{
    "reporter": "junit",
    "reporterOptions": {
        "mochaFile": "../../../test/el-portal-e2e-junit.xml"
    },
    "fileServerFolder": "../../../dist/out-tsc/apps/el/portal-e2e",
    "fixturesFolder": "../../../dist/out-tsc/apps/el/portal-e2e/src/fixtures",
    "integrationFolder": "../../../dist/out-tsc/apps/el/portal-e2e/src/integration",
    "pluginsFile": "../../../dist/out-tsc/apps/el/portal-e2e/src/plugins/index.js",
    "supportFile": false,
    "video": true,
    "videosFolder": "../../../dist/out-tsc/apps/el/portal-e2e/videos",
    "screenshotsFolder": "../../../dist/out-tsc/apps/el/portal-e2e/screenshots",
    "chromeWebSecurity": false
}

What did you change and where? Thank you for your time.

Hi @skorunka
I added "fixtures" key, for you it would look like:

{
  "fixtures": "../../../dist/out-tsc/apps/el/portal-e2e/src/fixtures"
}

@Need-To-Learn 馃 I just upgraded to the latest version of NX...but for some reason the entire fixtures folder is not copied over ot the dist folder that's specified in the cypress.json. All other stuff is there, but not the fixtures. Which obviously results in a broken test when trying to access those

It seems to work when setting the fixturesFolder to the local one in the e2e generated project. Not sure this is a bug in the schematic in the sense of generating the wrong cypress.json or whether it is a bug in not copying them over to the dist/out-tsc/...

//cc @FrozenPandaz

@Need-To-Learn Hi, it works. IMHO this is a bug in nrwl/builders package.

I agree with @skorunka that if the behavior changed between the versions, it should be treated as a bug.
I expect the same behavior with the latest version as in the previous, without manually wiring up the output path.

Good stuff. Thnx.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SWGeekPD picture SWGeekPD  路  3Comments

zachnewburgh picture zachnewburgh  路  3Comments

jon301 picture jon301  路  3Comments

Koslun picture Koslun  路  3Comments

IonFoXx picture IonFoXx  路  3Comments