Skip to content

gf.contains

gf.contains(text: string, selector: string): Promise<DOMElement>

Section titled “gf.contains(text: string, selector: string): Promise<DOMElement>”

Retrieves a DOM element containing the specified text.

  • text: The text to search for in the DOM element.
  • selector: The selector used to find the element that the search will be started from.
  • Returns a promise that resolves to DOMElement that contains the text.
describe('Test script', function () {
it('Test 1', async () => {
const element = await gf.contains('Hello, World!', '.my-element');
});
});