Skip to content

element.trigger

element.trigger(eventName: string, data?: Object): Promise<void>

Section titled “element.trigger(eventName: string, data?: Object): Promise<void>”

Triggers a custom event on the element.

  • eventName: The name of the custom event.
  • data: Optional data to include in the event’s detail property.
  • Returns a promise that resolves when the action is complete.
describe('Test script', function () {
it('Test 1', async () => {
const element = await gf.get('.my-element');
await element.trigger('test-event', { value: 1 });
});
});