test Function

Declares a test.

test( testName, fn(t) ) → this
Parameter Type Description
testName String The test name.
fn Function An asynchronous function that contains the test code.
t Object The test controller used to access the test run API.
fixture `My Fixture`;

test('Click a button', async t => {
    await t.click('#button');
});

test('Type something', async t => {
    await t.typeText('#comment', 'I love TestCafe')
});

Use the fixture global function to declare fixtures.