Search code examples
automated-testse2e-testingcode-organizationweb-testingtestcafe

TestCafe - How can I run multiple fixtures (one after the other, not concurrent)?


I have multiple fixtures (interaction between a website and a hybrid app) and I would like to have a test suite run (Smoke test, regression test ...) but I'm not sure how to do it.

This is how my tests look like:

enter image description here

What I want to do is run all tests (eg. CreatePollAndCloseIt.js, CreatePollPinAndDelete.js, CreateStreamAssertions.js and so on until the last one VotePollWhitelabel ) and get a report after.

Thank you!


Solution

  • You can run all your tests by specifying the parent folder of your test file. For example you can run all your Mobile Tests with the command: testcafe chrome <path>/MobileTests

    Also it's possible to reorganize your folder structure, eg:

     - Mobile
         - Smoke
         - Regression
    

    In this case you can run your test suites via following commands:

    • testcafe chrome <path>/Mobile - for all tests
    • testcafe chrome <path>/Mobile/Smoke - only smoke
    • testcafe chrome <path>/Mobile/Regression - only regression

    Another way to organize the test-suites is using the testing metadata. Please refer to the following articles to get the details: