mirror of https://github.com/zulip/zulip.git
puppeteer_lib: Fix get_element_text typing.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
5e4cec56cb
commit
7e6e98aefb
|
@ -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> {
|
||||||
|
|
Loading…
Reference in New Issue