Write Test Code

TestCafe Studio allows you to write tests using JavaScript and TypeScript.

Follow the steps below to write test code from scratch.

  1. Create a .js or .ts file in a test directory or subdirectory. Right-click the directory in the Explorer panel and select New File from the context menu. In the New File dialog, specify the file name and click Create. TestCafe Stuido creates the test file and opens it in the Code Editor.

  2. Write the test code. See the Test API topic in the open-source TestCafe documentation for information about the API used in tests.

    Code Editor

Convert Recorded Tests to JavaScript

You can convert recorded tests to JavaScript. See Converting Fixtures to JavaScript for more information.