How to have multiple filters for fixture meta in .testcaferc cofiguration file?

Viewed 324

I am having below filter defined for fixture meta in the .testcaferc.json file.

{
 "filter": {
        "fixtureMeta": {
            "FixtureType": "Smoke",
            "ProjectName": "CI"           
        }
    }
}

now i am using the command

npx testcafe chrome e2e/tests --filter.fixtureMeta

which is actually running the tests with meta FixtureType equlas to value Smoke and ProjectName equals to value CI

My Question is

how to add one more filter for fixture meta to the configuration file and make it run using the command?

for example if i have config like following

{
 "filter": {
        "fixtureMeta": {
            "FixtureType": "Smoke",
            "ProjectName": "CI"           
        }
    },
 "filter": {
        "fixtureMeta": {
            "FixtureType": "Smoke",
            "ProjectName": "CTS"           
        }
    }
}

how can i have multiple filters as defined above and two different commands to run those different projects?

1 Answers

You can use the --fixture-meta flag from TestCafe CLI and create two commands:

npx testcafe chrome e2e/tests --fixture-meta FixtureType=Smoke,ProjectName=CI

npx testcafe chrome e2e/tests --fixture-meta FixtureType=Smoke,ProjectName=CTS
Related