The requested page is not available for the requested platform. You are viewing the content for Default platform.

Explorer Panel

  • 5 min to read

The Explorer panel allows you to view and manage files in your test directory.

The panel shows the directory's content as a tree of subdirectories, files, and tests. See Test Structure for more information.

Explorer panel

You can manage test directories, files, fixtures, and tests using context menu commands. The available commands depend on the selected item in the panel.

The panel also has buttons for frequently-used actions: Record a New Test icon Record a New Test and Create aNew Fixture icon Create a New Fixture.

Create a Directory

To create a new directory, invoke the context menu for a directory where you want to create it and select New directory icon New Directory. Specify the directory name in the invoked dialog and click Create.

New Directory dialog

The new directory appears in the Explorer panel.

Create a Fixture

To create a new fixture, select a directory where you want to create it and click Create New Fixture icon Create a New Fixture or select the New fixture icon New Fixture command from the context menu. This invokes the Fixture Properties dialog.

Create a fixture

Specify the fixture's properties and click Create. The new file with a fixture appears in the Explorer panel.

Create a Test

You can create a new test in one of the following ways:

  • Record a test - Select the fixture where you want to create a test and click the Record button Record a New Test button. This automatically creates a new test, adds it to the fixture and starts recording.

  • Create an empty test - Select the fixture where you want to create a test and select New test icon New Test from the context menu to open the New Test dialog.

    New Test dialog

    Specify the test name and click Create. TestCafe Studio creates an empty test and opens it in the Test Editor.

Copy and Paste a Test

To copy a test, do one of the following:

  • Invoke the context menu for this test and select Copy icon Copy from the context menu.
  • Select the test in the panel and press Ctrl-C.

You can also copy several tests at once. To select multiple tests in the Explorer panel, use Shift-click, Ctrl-click, or Command-click, and then copy these tests as described above.

To paste the copied test(s) to a fixture, do one of the following:

  • Invoke the context menu for a desired fixture and select Paste icon Paste from the context menu.
  • Select a fixture in the Explorer panel and press Ctrl-V.

Create a Test Script

To create a new file with a test script, invoke the context menu in the directory where you want to create a file and select New Test Script button New Test Script. Specify the file name and extension in the invoked dialog and click Create.

New Test Script dialog

The created file appears in the Explorer panel and opens in the Code Editor.

Create a File

To create a new file, invoke the context menu in the directory where you want to create a file and select New file icon New File. Specify the file name and extension in the invoked dialog and click Create.

New File dialog

The created file appears in the Explorer panel and opens in the Code Editor.

Run Tests

To run any runnable item (test, fixture or directory), hover the mouse over it and click the The Run test button Run test or Run all tests button next to this item.

To run several tests from different fixtures and directories, select the tests using Shift-click, Ctrl-click, or Command-click, then click the The Run tests button Run Tests button next to any selected item.

Run multiple items

You can also use the context menu's Run test icon Run Test command to run tests.

Modify a Fixture's Properties

To edit fixture properties, open its context menu and select Edit icon Edit to invoke the Fixture Propeties dialog. You can change the fixture name, file name, target webpage, and authentication credentials in this dialog. To save the changes, click OK.

Fixture Properties dialog

Rename Tests

To rename a test, invoke its context menu and select Rename icon Rename. The Rename Test dialog appears. Specify the new test name and click Rename.

Rename Test dialog

Convert Recorded Tests to JavaScript

You can convert a recorded test or a fixture to a .js file. To do this, select a desired item in the Explorer panel, invoke its context menu and select Convert icon Convert to JavaScript Code. This invokes the Convert to JavaScript dialog. Specify the file name and extension, then click Create.

Convert to JavaScript Dialog

TestCafe Studio creates the test script file in the same test directory and displays it in the Explorer panel.

View Test Code

To open a test script file in the Code Editor, double-click it in the Explorer panel or invoke the context menu and select Show code icon Show Code.

Show Files in Windows Explorer/MacOS Finder

To view a fixture or directory in Windows Explorer and macOS Finder, invoke the context menu for the fixture or directory and select Show in Explorer icon Show in Explorer/Finder.

Delete Directories, Files and Tests

To delete a directory, file, or individual recorded test, invoke its context menu and select Delete icon Delete. A confirmation dialog appears. Click Yes to delete the selected item.

Note

The Delete command is not available for individual tests in test script files However, you can go to the Code Editor and delete these tests from code.

You can also delete several recorded tests from different files and directories. To do this, select the tests with Shift-click, Ctrl-click, or Command-click, then select Delete icon Delete from the context menu.

Delete multiple items