diff --git a/types/expect-puppeteer/expect-puppeteer-tests.ts b/types/expect-puppeteer/expect-puppeteer-tests.ts index 4c646da1d9..dc8c37365c 100644 --- a/types/expect-puppeteer/expect-puppeteer-tests.ts +++ b/types/expect-puppeteer/expect-puppeteer-tests.ts @@ -23,6 +23,9 @@ const testGlobal = async (instance: ElementHandle | Page) => { await expect(instance).toUploadFile("selector", "filePath"); await expect(instance).toUploadFile("selector", "filePath", { timeout: 777 }); + + await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 }); + await expect(instance).toFillForm("selector", { foo: 'bar', baz: 123 }, { timeout: 777 }); }; const testImported = async (instance: ElementHandle | Page) => { diff --git a/types/expect-puppeteer/index.d.ts b/types/expect-puppeteer/index.d.ts index 7c216f4259..b77bc948bd 100644 --- a/types/expect-puppeteer/index.d.ts +++ b/types/expect-puppeteer/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for expect-puppeteer 2.2 +// Type definitions for expect-puppeteer 3.3 // Project: https://github.com/smooth-code/jest-puppeteer/tree/master/packages/expect-puppeteer // Definitions by: Josh Goldberg // Tanguy Krotoff @@ -57,6 +57,7 @@ declare global { toClick(selector: string, options?: ExpectToClickOptions): Promise; toDisplayDialog(block: () => Promise): Promise; toFill(selector: string, value: string, options?: ExpectTimingActions): Promise; + toFillForm(selector: string, value: { [key: string]: any}, options?: ExpectTimingActions): Promise; toMatch(selector: string, options?: ExpectTimingActions): Promise; toMatchElement(selector: string, options?: ExpectToClickOptions): Promise; toSelect(selector: string, valueOrText: string, options?: ExpectTimingActions): Promise;