Skip to main content

Explorer Panel

  • 4 minutes 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.

Explorer panel

You can manage test directories, files, fixtures, and tests through context menus. The content of the context menu depends on the item.

Create a Directory

To create a new directory within an existing directory, right-click a directory entry and select New directory icon New Directory. Specify the directory name and click Create.

New Directory dialog

Create a New Fixture (Codeless Test File)

To create a new codeless fixture, right-click the destination directory and select the New fixture icon New Fixture menu entry. This invokes the Fixture Properties dialog.

Create a fixture

Specify the fixture’s properties and click Create.

Add a Codeless Test to a Fixture

Right-click the destination fixture and select New test icon New Test. TestCafe Studio opens 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 Codeless Test Editor.

Copy and Paste a Test or Hook

To copy a test or hook, do one of the following:

  • Invoke the context menu for this item and select Copy icon Copy from the context menu.
  • Select this item and press Cmd/Ctrl-C.

You can copy several tests at once, but you cannot copy more than one before each or after each hook.

To paste the items to a fixture, do one of the following:

  • Right-click the destination file or fixture, and select Paste icon Paste from the context menu.
  • Select a fixture or file, and press Cmd/Ctrl-V.

Create a Test Script

Right-click the destination directory and select New Test Script button New Test Script. Specify the file name, the extension, and click Create.

New Test Script dialog

The Code Editor opens the new file.

Create a File

To create a new file, right-click the destination directory and select New file icon New File. Specify the file name and click Create.

New File dialog

The Code Editor opens the new file.

Add a Hook to a Fixture

To add an empty hook to a fixture, right-click the fixture and select Before each hook icon Add ‘before each’ hook or After each hook icon Add ‘after each’ hook.

Add an empty hook

Copy Actions to a Hook

Invoke a test’s context menu and select Before each hook icon Copy actions to ‘before each’ hook or After each hook icon Copy actions to ‘after each’ hook to copy all actions of the test to a hook.

Copy actions to a hook

TestCafe Studio appends these actions to an existing hook, or creates a new hook if none exists.

Run Tests

To launch any test item (test, fixture, or directory), hover the item entry. Click the The Run test button Run test or The Run test button Run all tests button that appears next to this item.

You can select multiple items and click the The Run tests button Run Tests button next to any one of them.

Run multiple items

You can also right-click an item and select the Run test icon Run Test command from the context menu.

Modify Fixture Properties

To edit fixture propeties, right-click a fixture and select Edit icon Edit. You can change the fixture name, file name, the test URL, and authentication credentials. Click OK to save your changes.

Fixture Properties dialog

Rename Tests

To rename a test, right-click it and select Rename icon Rename. The Rename test dialog appears. Enter the new name and click Rename.

Rename Test dialog

Convert Codeless Tests to JavaScript

Right-click a codeless test and select Convert icon Convert to JavaScript…. This invokes the Convert to JavaScript dialog. Specify the file name and extension, then click Create.

Convert to JavaScript Dialog

TestCafe Studio adds the test script file to the directory that contains the original test.

View Test Code

To open a test script file in the Code Editor, double-click its Explorer panel entry, or right-click it 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, right-click a fixture or directory and select Show in Explorer icon Show in Explorer/Finder/Files.

Delete Items

To delete a directory, file, codeless test, test script, or hook, right-click it and select Delete icon Delete. Click Yes in the confirmation dialog.

Note

The Delete command does not work with scripts’ test declarations. However, you can open the Code Editor and manually delete the corresponding code.

You can delete multiple items at once.

Delete multiple items