t.fixtureCtx Property

References the fixture context object. Each fixture has a fixture context object of its own. Store data within the fixture context object to share information between fixture hooks and the content of the fixture.

t.fixtureCtx → Object
fixture `Fixture1`
    .before(async ctx  => {
        ctx.someProp = 123;
    })
    .after(async ctx  => {
        console.log(ctx.someProp); // > 123
    });

You cannot redefine the t.fixtureCtx object. However, you can define the object’s properties and add new properties to the object.

fixture `Fixture1`
    .before(async ctx  => {
        ctx.someProp = 123;
    })
    .after(async ctx  => {
        console.log(ctx.newProp); // > abc
    });

test('Test1', async t => {
    console.log(t.fixtureCtx.someProp); // > 123
});

test('Test2', async t => {
    t.fixtureCtx.newProp = 'abc';
});