From 7e6e98aefb007980a364bf537d9a73abcd045989 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 2 Sep 2022 20:40:15 -0700 Subject: [PATCH] puppeteer_lib: Fix get_element_text typing. Signed-off-by: Anders Kaseorg --- frontend_tests/puppeteer_lib/common.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend_tests/puppeteer_lib/common.ts b/frontend_tests/puppeteer_lib/common.ts index e4a1e5f31d..b30c830b9d 100644 --- a/frontend_tests/puppeteer_lib/common.ts +++ b/frontend_tests/puppeteer_lib/common.ts @@ -192,7 +192,9 @@ class CommonUtils { } async get_element_text(element: ElementHandle): Promise { - 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 {