puppeteer_lib: Fix get_element_text typing.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2022-09-02 20:40:15 -07:00 committed by Tim Abbott
parent 5e4cec56cb
commit 7e6e98aefb
1 changed files with 3 additions and 1 deletions

View File

@ -192,7 +192,9 @@ class CommonUtils {
} }
async get_element_text(element: ElementHandle<Element>): Promise<string> { async get_element_text(element: ElementHandle<Element>): Promise<string> {
return (await element.getProperty("innerText"))!.jsonValue(); const text = await (await element.getProperty("innerText"))!.jsonValue();
assert.ok(typeof text === "string");
return text;
} }
async get_text_from_selector(page: Page, selector: string): Promise<string> { async get_text_from_selector(page: Page, selector: string): Promise<string> {