Home > OS >  Where are fixtures located in the file structure of synpress (cypress) tests?
Where are fixtures located in the file structure of synpress (cypress) tests?

Time:03-16

I am attempting to test my react app using synpress, which is a wrapper around cypress that allows you to interact with the metamask crypto wallet browser extension. I have set up my tests and they are working, but I need to utilize a fixture for some of them, but I cannot figure out where the fixtures are stored.

enter image description here

CodePudding user response:

Take a look at the example package.json scripts here, you can specify the fixtures folder on the command line

"test:e2e": "start-server-and-test ... --config='fixturesFolder=tests/e2e/fixtures'"

Or try adding synpress.json to project root - synpress.json

{
    "baseUrl": "http://localhost:3000",
    "userAgent": "synpress",
    "retries": { "runMode": 0, "openMode": 0 },
    "integrationFolder": "tests/e2e/specs",

    "fixturesFolder": "tests/e2e/fixtures",

    "screenshotsFolder": "tests/e2e/screenshots",
    "videosFolder": "tests/e2e/videos",
    "chromeWebSecurity": true,
    "viewportWidth": 1366,
    "viewportHeight": 768,
    "component": {
        "componentFolder": ".",
        "testFiles": "**/*spec.{js,jsx,ts,tsx}"
    },
    "env": {
        "coverage": false
    },
    "defaultCommandTimeout": 30000,
    "pageLoadTimeout": 30000,
    "requestTimeout": 30000
}
  • Related