Write Test Scripts
TestCafe Studio allows you to write tests using JavaScript and TypeScript.
Follow the steps below to write test script from scratch.
Create a test script file in a test directory or subdirectory. Select the directory in the Explorer panel, invoke the context menu, and select
New Test Script. In the New Test Script dialog, specify the file name and extension (
.js
or.ts
) and click Create.TestCafe Studio creates the file with a test script template and opens it in the Code Editor.
Edit the test script template: modify the fixture's name, the test's name, specify a tested page's URL, and add the test code to the
test
function. See the Test API topic in the open-source TestCafe documentation for information about the API used in tests.
#Convert Recorded Tests to JavaScript
You can convert recorded tests to JavaScript. See Convert Recorded Tests to JavaScript for more information.