From 72166f1b03ecc5c6936715eb2461e61141415686 Mon Sep 17 00:00:00 2001 From: evykassirer Date: Wed, 1 Jun 2022 19:50:51 -0700 Subject: [PATCH] puppeteer: Fix get_element_text including hidden text. Previously, this function used the `textContent` property, which includes hidden elements. Fix this by using innerText instead. --- frontend_tests/puppeteer_lib/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend_tests/puppeteer_lib/common.ts b/frontend_tests/puppeteer_lib/common.ts index 2ebf116ba0..0e0f45c519 100644 --- a/frontend_tests/puppeteer_lib/common.ts +++ b/frontend_tests/puppeteer_lib/common.ts @@ -192,7 +192,7 @@ class CommonUtils { } async get_element_text(element: ElementHandle): Promise { - return (await element.getProperty("textContent"))!.jsonValue(); + return (await element.getProperty("innerText"))!.jsonValue(); } async get_text_from_selector(page: Page, selector: string): Promise {