# gf.trigger

> Documentation index: https://frontend-tools.coherent-labs.com/llms.txt lists every page of this documentation as Markdown; the full text is in https://frontend-tools.coherent-labs.com/llms-full.txt.

Source: https://frontend-tools.coherent-labs.com/e2e/api/gf/page/trigger/

## gf.trigger(eventName: string, data: Object)

Triggers a custom DOM event on the document with the specified name and data.

- **`eventName`** - The name of the custom event to dispatch.
- **`data`** - The data to include in the event’s `detail` property.
- Returns a promise that resolves when triggering custom event up is complete.

## Usage

```js
describe('Test script', function () {
    it('Test 1', async () => {
        await gf.trigger('custom-event');
        await gf.trigger('custom-event', { testData: 1 });
    });
});
```
