3

I am running Testcases (typescripts files) from the command prompt and there only providing settings like browser selection and concurrency number. But I want to use common settings mentioned in TestCafe configuration file testcafe.js. Can someone please help me with sample testcafe configuration file, and how to execute testcases to use settings mentioned in the configuration file.

const createTestCafe = require('testcafe');

createTestCafe('localhost', 1337,1338)
.then(tc=>{
    testcafe= tc;
    const runner=testcafe.createRunner();
    return runner
      .browsers(['chrome'])
      .concurrency(3)
      .run();
});
Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Neha
  • 31
  • 3

1 Answers1

1

Create your .testcaferc.json configuration file in the same directory where you have your test script. TestCafe will find the config file and use it automatically. You don't have to specify it in your programming interface.

I recommend that you refer to the Configuration File topic where its options are described. You can find a complete configuration file example in the GitHub repository.

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47